Umer797 commited on
Commit
0d42337
·
verified ·
1 Parent(s): c2d02ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -2,17 +2,17 @@ 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() # ✅ compile the graph for execution
12
 
13
  def __call__(self, question):
14
- state = {"question": question}
15
- result_state = self.executor.invoke(state) # ✅ run using executor
16
  return result_state["final_answer"]
17
 
18
  def run_and_submit_all(profile):
 
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()
12
 
13
  def __call__(self, question):
14
+ initial_state = AgentState({"question": question}) # ✅ validated state init
15
+ result_state = self.executor.invoke(initial_state)
16
  return result_state["final_answer"]
17
 
18
  def run_and_submit_all(profile):