Final_Assignment_Template / debug_q1_q14.py
Paperbag's picture
Enhance question handling and answer extraction logic in agent.py; add debugging script for Q1 and Q14 in debug_q1_q14.py; update results in gaia_results.csv and gaia_results.json for accuracy.
feece06
raw
history blame contribute delete
541 Bytes
import requests
from langchain_core.messages import HumanMessage
from agent import build_graph
graph = build_graph()
resp = requests.get('https://agents-course-unit4-scoring.hf.space/questions')
questions = resp.json()
# Q1
q1 = questions[0]
result = graph.invoke({'messages': [HumanMessage(content=q1['question'])]})
print(f"Q1 answer: {result['messages'][-1].content}")
print()
# Q14
q14 = questions[13]
result = graph.invoke({'messages': [HumanMessage(content=q14['question'])]})
print(f"Q14 answer: {result['messages'][-1].content}")