43 lines
1.6 KiB
Python
43 lines
1.6 KiB
Python
import requests
|
|
|
|
def check_classification_search():
|
|
base_url = 'http://localhost:3015'
|
|
headers = {'X-API-Key': 'jleu1212', 'Content-Type': 'application/json'}
|
|
|
|
# Search for classification content
|
|
query = "Image Classifications:"
|
|
print(f"🔍 Searching for: '{query}'")
|
|
|
|
try:
|
|
response = requests.post(f"{base_url}/api/search", headers=headers, json={'query': query, 'top_k': 10}, timeout=20)
|
|
print(f'Status: {response.status_code}')
|
|
|
|
if response.status_code == 200:
|
|
results = response.json()
|
|
chunks = results.get('chunks', [])
|
|
print(f'Chunks found: {len(chunks)}')
|
|
|
|
for i, chunk in enumerate(chunks):
|
|
print(f'Chunk {i+1}:')
|
|
print(f' File: {chunk.get("file_path")}')
|
|
content = chunk.get('content', '')
|
|
|
|
if 'Image Classifications:' in content:
|
|
print(f' Contains Image Classifications: YES')
|
|
# Find and print the classification section
|
|
lines = content.split('\n')
|
|
for line in lines:
|
|
if 'Image Classifications:' in line or 'bee' in line.lower():
|
|
print(f' {line}')
|
|
else:
|
|
print(f' Contains Image Classifications: NO')
|
|
|
|
print(f' Content preview: {content[:200]}...')
|
|
else:
|
|
print(f'Error: {response.text}')
|
|
|
|
except Exception as e:
|
|
print(f'Exception: {e}')
|
|
|
|
if __name__ == '__main__':
|
|
check_classification_search() |