Spaces:
Sleeping
Sleeping
Update agent_service.py
Browse files- agent_service.py +5 -3
agent_service.py
CHANGED
|
@@ -470,13 +470,15 @@ class AgentService:
|
|
| 470 |
# Format results
|
| 471 |
formatted = []
|
| 472 |
for i, result in enumerate(final_results[:5], 1): # Limit to top 5
|
| 473 |
-
|
|
|
|
| 474 |
|
| 475 |
# DEBUG: Log payload keys for first result
|
| 476 |
if i == 1:
|
| 477 |
-
print(f"
|
|
|
|
| 478 |
if 'texts' not in payload and 'text' in payload:
|
| 479 |
-
print(f"
|
| 480 |
|
| 481 |
# Robust extraction of text content
|
| 482 |
texts = payload.get("texts", [])
|
|
|
|
| 470 |
# Format results
|
| 471 |
formatted = []
|
| 472 |
for i, result in enumerate(final_results[:5], 1): # Limit to top 5
|
| 473 |
+
# NOTE: qdrant_service returns "metadata" not "payload"
|
| 474 |
+
payload = result.get("metadata", {})
|
| 475 |
|
| 476 |
# DEBUG: Log payload keys for first result
|
| 477 |
if i == 1:
|
| 478 |
+
print(f"[DEBUG] First Result Keys: {list(result.keys())}")
|
| 479 |
+
print(f"[DEBUG] Metadata Keys: {list(payload.keys())}")
|
| 480 |
if 'texts' not in payload and 'text' in payload:
|
| 481 |
+
print(f"[INFO] Found 'text' but not 'texts'. Using 'text' field.")
|
| 482 |
|
| 483 |
# Robust extraction of text content
|
| 484 |
texts = payload.get("texts", [])
|