yooke commited on
Commit
f7a1d84
·
verified ·
1 Parent(s): d1416ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -75,8 +75,11 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
75
  results_log = []
76
  answers_payload = []
77
  print(f"Running agent on {len(questions_data)} questions...")
 
78
  for item in questions_data:
79
  task_id = item.get("task_id")
 
 
80
  question_text = item.get("question")
81
  if not task_id or question_text is None:
82
  print(f"Skipping item with missing task_id or question: {item}")
@@ -87,6 +90,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
87
 
88
  # Extract the final answer from the last message
89
  submitted_answer = "Error: Agent did not provide a response." # Default in case extraction fails
 
90
  if result_state and "messages" in result_state and result_state["messages"]:
91
  last_message = result_state["messages"][-1]
92
  # The final content is typically in the content attribute of the last message
 
75
  results_log = []
76
  answers_payload = []
77
  print(f"Running agent on {len(questions_data)} questions...")
78
+ print(f"--- Starting processing Task ID: {task_id}, Question: {question_text[:100]}...")
79
  for item in questions_data:
80
  task_id = item.get("task_id")
81
+ print(f"--- Finished agent invoke for Task ID: {task_id}")
82
+
83
  question_text = item.get("question")
84
  if not task_id or question_text is None:
85
  print(f"Skipping item with missing task_id or question: {item}")
 
90
 
91
  # Extract the final answer from the last message
92
  submitted_answer = "Error: Agent did not provide a response." # Default in case extraction fails
93
+ print(f"--- Extracted answer for Task ID: {task_id}: {submitted_answer[:100]}...")
94
  if result_state and "messages" in result_state and result_state["messages"]:
95
  last_message = result_state["messages"][-1]
96
  # The final content is typically in the content attribute of the last message