Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,12 +28,19 @@ class BasicAgent:
|
|
| 28 |
if self.graph is None:
|
| 29 |
return "Error: Agent not properly initialized"
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
config = {"configurable": {"thread_id": f"eval_{hash(question)}"}}
|
| 34 |
|
| 35 |
try:
|
| 36 |
-
result = self.graph.invoke(
|
| 37 |
|
| 38 |
# Handle different response formats
|
| 39 |
if isinstance(result, dict):
|
|
|
|
| 28 |
if self.graph is None:
|
| 29 |
return "Error: Agent not properly initialized"
|
| 30 |
|
| 31 |
+
# Create complete state structure that matches EnhancedAgentState
|
| 32 |
+
state = {
|
| 33 |
+
"messages": [HumanMessage(content=question)],
|
| 34 |
+
"query": question, # This was the critical missing field
|
| 35 |
+
"agent_type": "",
|
| 36 |
+
"final_answer": "",
|
| 37 |
+
"perf": {},
|
| 38 |
+
"agno_resp": ""
|
| 39 |
+
}
|
| 40 |
config = {"configurable": {"thread_id": f"eval_{hash(question)}"}}
|
| 41 |
|
| 42 |
try:
|
| 43 |
+
result = self.graph.invoke(state, config)
|
| 44 |
|
| 45 |
# Handle different response formats
|
| 46 |
if isinstance(result, dict):
|