34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
import requests
|
|
import json
|
|
|
|
base_url = 'http://localhost:3015'
|
|
headers = {'X-API-Key': 'jleu1212', 'Content-Type': 'application/json'}
|
|
|
|
print('🔍 Testing search functionality with fixed DeepSeek API headers...')
|
|
|
|
# Test basic search
|
|
try:
|
|
response = requests.post(
|
|
f'{base_url}/api/search',
|
|
headers=headers,
|
|
json={'query': 'bee', 'top_k': 5},
|
|
timeout=10
|
|
)
|
|
print(f'Status Code: {response.status_code}')
|
|
|
|
if response.status_code == 200:
|
|
results = response.json()
|
|
print(f'✅ Search successful! Found {len(results.get("chunks", []))} chunks')
|
|
print(f'Entities found: {len(results.get("entities", []))}')
|
|
|
|
# Show bee-related content
|
|
for i, chunk in enumerate(results.get('chunks', [])[:3]):
|
|
content = chunk.get('content', '')
|
|
if 'bee' in content.lower() or 'photo of a bee' in content.lower():
|
|
print(f'🐝 Bee-related chunk {i+1}:')
|
|
print(f' {content[:200]}...')
|
|
else:
|
|
print(f'❌ Search failed: {response.text}')
|
|
|
|
except Exception as e:
|
|
print(f'❌ Search error: {e}') |