Spaces:
Running
Running
| import streamlit as st | |
| import requests | |
| API_URL = "http://localhost:8000/api/service/lynxkite_graph_analytics/LynxScribe/MCP/Multi-agent.lynxkite.json/Chat%20frontend%201/chat/completions" | |
| st.title("LynxScribe Multi-Agent Example") | |
| examples = [ | |
| "Find the value of x given that 4*x^4 = 44.", | |
| "Which movies feature Bette Davis and Ann Sheridan together? Include the year of the movie's release.", | |
| "What is the current stock price of Alphabet?", | |
| "What is the scientific name of Atlantic cod?", | |
| ] | |
| selected_example = st.radio("Choose an example:", examples, index=None) | |
| question = st.text_area( | |
| "Your question:", value="" if selected_example is None else selected_example | |
| ) | |
| if question: | |
| payload = { | |
| "model": "LynxScribe", | |
| "stream": False, | |
| "messages": [{"role": "user", "content": question}], | |
| } | |
| response = requests.post(API_URL, json=payload) | |
| if response.ok: | |
| st.write("\n".join(c["message"]["content"] for c in response.json()["choices"])) | |
| else: | |
| st.error(f"Error: {response.status_code}") | |