File size: 901 Bytes
3068aa9
cc19f91
 
 
b8de053
cc19f91
 
 
 
 
 
 
 
 
 
 
 
 
34b88c0
b8de053
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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}")