Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,17 +2,18 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
import pandas as pd
|
| 4 |
import traceback
|
| 5 |
-
from graph_builder import build_graph
|
| 6 |
from api_client import fetch_questions, submit_answers
|
| 7 |
|
| 8 |
class GaiaAgent:
|
| 9 |
def __init__(self):
|
| 10 |
self.graph = build_graph()
|
| 11 |
-
self.executor = self.graph.compile()
|
| 12 |
|
| 13 |
def __call__(self, question):
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
def run_and_submit_all(profile):
|
| 18 |
try:
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import pandas as pd
|
| 4 |
import traceback
|
| 5 |
+
from graph_builder import build_graph
|
| 6 |
from api_client import fetch_questions, submit_answers
|
| 7 |
|
| 8 |
class GaiaAgent:
|
| 9 |
def __init__(self):
|
| 10 |
self.graph = build_graph()
|
| 11 |
+
self.executor = self.graph.compile()
|
| 12 |
|
| 13 |
def __call__(self, question):
|
| 14 |
+
# Explicitly pass the state dictionary
|
| 15 |
+
result_state = self.executor.invoke({"question": question})
|
| 16 |
+
return result_state.get("final_answer", "No answer generated.")
|
| 17 |
|
| 18 |
def run_and_submit_all(profile):
|
| 19 |
try:
|