Spaces:
Sleeping
Sleeping
File size: 784 Bytes
f67e636 3a9a144 f67e636 798ac46 3a9a144 798ac46 f67e636 798ac46 f67e636 798ac46 f67e636 798ac46 f67e636 798ac46 f67e636 798ac46 f67e636 798ac46 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
import streamlit as st
import requests
# API URL
API_URL = "https://startrz-proagents.hf.space/api/v1/prediction/7fae8aea-4e25-4feb-8af3-f08e2cd0c020"
# Function to query the API
def query(payload):
response = requests.post(API_URL, json=payload)
return response.json()
# Streamlit app
def main():
st.title("DEVI RESEARCH")
# Input box for user query
user_input = st.text_input("Ask a question:")
if user_input:
# Send the user input to the API
response = query({"question": user_input})
# Display the response from the API
if response.get("answer"):
st.write(f"Response: {response['answer']}")
else:
st.write("No answer received, please try again.")
if __name__ == "__main__":
main()
|