exam-agent / test.py
doxiy's picture
version complète v10
34b88c0
raw
history blame contribute delete
901 Bytes
import os
# Testez ceci dans un script séparé pour diagnostiquer :
from duckduckgo_search import DDGS
from agent import run_agent
from tools import enforce_answer_format, detect_answer_type
print(os.getcwd())
try:
with DDGS() as ddgs:
results = list(ddgs.text("Mercedes Sosa albums", max_results=3))
print("✅ DuckDuckGo fonctionne:")
for r in results:
print(f"- {r.get('title', 'No title')}")
except Exception as e:
print(f"❌ Erreur DuckDuckGo: {e}")
# Testez avec une question simple
question_test = "In the video https://www.youtube.com/watch?v=L1vXCYZAYYM, what is the highest number of bird species to be on camera simultaneously?"
expected_type = detect_answer_type(question_test)
print(expected_type)
raw_answer = run_agent(question_test)
final_answer = enforce_answer_format(raw_answer, expected_type)
print(f"Réponse: {final_answer}")