kenqia commited on
Commit
8c3eeb5
·
verified ·
1 Parent(s): 1fbdfbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -18,6 +18,7 @@ from tools import (
18
  answer_image_question,
19
  answer_excel_question,
20
  answer_python_question,
 
21
  get_youtube_transcript,
22
  )
23
  # (Keep Constants as is)
@@ -58,6 +59,7 @@ class BasicAgent:
58
  answer_image_question,
59
  answer_excel_question,
60
  answer_python_question,
 
61
  get_youtube_transcript,
62
  TavilySearch(
63
  max_results=5,
@@ -267,7 +269,7 @@ class BasicAgent:
267
  if getattr(last_message, "tool_calls", None):
268
  return "tools"
269
 
270
- return "final_process"
271
 
272
  def retry_with_feedback(self, state: AgentState):
273
  notes = state.get("verification_notes", "")
@@ -357,7 +359,12 @@ class BasicAgent:
357
  "file_path": file_path,
358
  "question": question
359
  })
360
- return self.format_final_answer(question, raw)
 
 
 
 
 
361
 
362
  user_content = question
363
  if task_id:
 
18
  answer_image_question,
19
  answer_excel_question,
20
  answer_python_question,
21
+ answer_audio_question,
22
  get_youtube_transcript,
23
  )
24
  # (Keep Constants as is)
 
59
  answer_image_question,
60
  answer_excel_question,
61
  answer_python_question,
62
+ answer_audio_question,
63
  get_youtube_transcript,
64
  TavilySearch(
65
  max_results=5,
 
269
  if getattr(last_message, "tool_calls", None):
270
  return "tools"
271
 
272
+ return "verify_answer"
273
 
274
  def retry_with_feedback(self, state: AgentState):
275
  notes = state.get("verification_notes", "")
 
359
  "file_path": file_path,
360
  "question": question
361
  })
362
+ result = self.react_graph.invoke({
363
+ "messages": [
364
+ HumanMessage(content=f"Question:\n{question}\n\nTool result:\n{raw}\n\nReturn only the final answer.")
365
+ ]
366
+ })
367
+ return result["messages"][-1].content
368
 
369
  user_content = question
370
  if task_id: