-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_citations_ttd_dr.py
More file actions
60 lines (47 loc) · 1.54 KB
/
test_citations_ttd_dr.py
File metadata and controls
60 lines (47 loc) · 1.54 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
"""Test citations formatting for TTD-DR strategy."""
import requests
import json
BACKEND_URL = "http://af3615e06391145bc88022ac024a36ca-bd296660cda3522f.elb.us-west-2.amazonaws.com"
# Test query with TTD-DR
payload = {
"topic": "What are the key benefits of microservices architecture?",
"report_organization": "Create a brief comprehensive report. Use dynamic strategy.",
"collection": "",
"search_web": True,
"strategy": "ttd_dr" # Test with TTD-DR
}
print("=" * 80)
print("Testing Citation Formatting - TTD-DR Strategy")
print("=" * 80)
print()
try:
response = requests.post(f"{BACKEND_URL}/research", json=payload, timeout=180)
result = response.json()
print("📊 RESPONSE STATUS:", response.status_code)
print()
# Extract and display citations
if "citations" in result:
print("📚 CITATIONS:")
print("-" * 80)
print(result["citations"])
print("-" * 80)
print()
# Check for [unknown] references
if "[unknown]" in result["citations"]:
print("❌ WARNING: Found [unknown] references!")
else:
print("✅ All sources have proper names!")
else:
print("❌ No citations field in response")
print()
print("📝 LOGS:")
for log in result.get("logs", []):
print(f" {log}")
print()
print("🔍 STRATEGY EXECUTED:")
print(f" Execution Path: {result.get('execution_path', 'N/A')}")
except Exception as e:
print(f"❌ ERROR: {e}")
print()
print("=" * 80)