jcleee commited on
Commit
cd8644c
·
verified ·
1 Parent(s): e32f4a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -16
app.py CHANGED
@@ -1,17 +1,14 @@
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()
 
 
 
1
  import gradio as gr
2
+ from agent import agent # Import your refactored agent
3
+ from Gradio_UI import GradioUI
4
+
5
+ # Optional: Uncomment to test agent endpoint separately
6
+ # def run_agent(question):
7
+ # try:
8
+ # result = agent(question)
9
+ # return [str(result)]
10
+ # except Exception as e:
11
+ # return [f"Error: {e}"]
12
+
13
+ if __name__ == "__main__":
14
+ GradioUI(agent).launch(debug=True, share=True)