Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,14 +125,9 @@ import gradio as gr
|
|
| 125 |
def run_agent(question):
|
| 126 |
try:
|
| 127 |
result = agent(question)
|
| 128 |
-
return [str(result)] #
|
| 129 |
except Exception as e:
|
| 130 |
return [f"Error: {e}"]
|
| 131 |
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
gr.Markdown("### Chat with your agent")
|
| 135 |
-
chatbot_ui = GradioUI(agent)
|
| 136 |
-
gr.Interface(fn=run_agent, inputs="text", outputs="text") # Hidden interface
|
| 137 |
-
|
| 138 |
-
demo.launch()
|
|
|
|
| 125 |
def run_agent(question):
|
| 126 |
try:
|
| 127 |
result = agent(question)
|
| 128 |
+
return [str(result)] # Must return a list with one string (like ["answer"])
|
| 129 |
except Exception as e:
|
| 130 |
return [f"Error: {e}"]
|
| 131 |
|
| 132 |
+
demo = gr.Interface(fn=run_agent, inputs="text", outputs="text")
|
| 133 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|