Spaces:
Sleeping
Sleeping
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() | |