-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_recommendations.py
More file actions
30 lines (25 loc) · 903 Bytes
/
test_recommendations.py
File metadata and controls
30 lines (25 loc) · 903 Bytes
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
import requests
import json
# Test the recommendations API with minimal data
url = "http://127.0.0.1:8002/api/recommendations/generate"
data = {
"filename": "test_video.mp4",
"metadata": None
}
print("🔄 Testing recommendations API...")
print(f"URL: {url}")
print(f"Data: {json.dumps(data, indent=2)}")
try:
print("🔄 Making request...")
response = requests.post(url, json=data, timeout=10)
print(f"✅ Response received! Status: {response.status_code}")
if response.headers.get('content-type', '').startswith('application/json'):
result = response.json()
print(f"\n📋 Response JSON:")
print(json.dumps(result, indent=2))
else:
print(f"\n� Response Text: {response.text}")
except requests.exceptions.RequestException as e:
print(f"❌ Request Error: {e}")
except Exception as e:
print(f"❌ Other Error: {e}")