Umer797 commited on
Commit
4b2e344
·
verified ·
1 Parent(s): b6b7990

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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, AgentState
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() # ✅ compile graph into executable
12
 
13
  def __call__(self, question):
14
- result_state = self.executor.invoke({"question": question}) # pass as dict
15
- return result_state["final_answer"]
 
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: