traversaal-ai's picture
Create app.py
c2ee5cd verified
raw
history blame
720 Bytes
import os
import streamlit as st
import requests
ares_api = os.getenv("ARES_API")
url = "https://api-ares.traversaal.ai/live/predict"
headers = {
"x-api-key": ares_api,
"content-type": "application/json"
}
st.title('Ares Demo')
st.text_input(label, value="", max_chars=None, key=None, type="default", help=None, autocomplete=None, on_change=None, args=None, kwargs=None, *, placeholder=None, disabled=False, label_visibility="visible")
def inference(query):
payload = { "query": [query] }
response = requests.post(url, json=payload, headers=headers)
response_text=response.json().get('data').get('response_text')
urls=response.json().get('data').get('web_url')
return response_text, urls