Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from agent_code import agent
|
| 3 |
+
|
| 4 |
+
def ask_question(q):
|
| 5 |
+
state = {
|
| 6 |
+
"question": q,
|
| 7 |
+
"thoughts": [],
|
| 8 |
+
"tool_results": [],
|
| 9 |
+
"answer": None
|
| 10 |
+
}
|
| 11 |
+
result = agent.invoke(state)
|
| 12 |
+
return result["answer"]
|
| 13 |
+
|
| 14 |
+
gr.Interface(fn=ask_question,
|
| 15 |
+
inputs=gr.Textbox(label="Ask a question"),
|
| 16 |
+
outputs="text",
|
| 17 |
+
title="GIAI LangGraph Agent").launch()
|