Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
|
|
| 1 |
from agent import get_agent
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
from agent import get_agent
|
| 3 |
+
import gradio as gr
|
| 4 |
|
| 5 |
+
# Load your working agent
|
| 6 |
+
agent = get_agent()
|
| 7 |
+
|
| 8 |
+
# Minimal endpoint that returns just the final answer as a string
|
| 9 |
+
def run_agent(question):
|
| 10 |
+
result = agent(question)
|
| 11 |
+
return str(result).strip() # Ensure it's clean and compatible with the eval system
|
| 12 |
+
|
| 13 |
+
# Define a simple Gradio interface that takes text and returns text
|
| 14 |
+
demo = gr.Interface(fn=run_agent, inputs="text", outputs="text")
|
| 15 |
+
|
| 16 |
+
# Launch the API-style interface (no chat, no UI bells/whistles)
|
| 17 |
+
demo.launch()
|