Spaces:
Running
Running
fix: use await instead of asyncio.run for hybrid search
Browse files- Fixes 'asyncio.run() cannot be called from a running event loop' error
- Hybrid search now executes properly in async context
- Live search will now work alongside database search
src/core/use_cases/rag_chat_use_case.py
CHANGED
|
@@ -391,16 +391,14 @@ JSON:"""
|
|
| 391 |
|
| 392 |
# Execute hybrid search (parallel live + DB)
|
| 393 |
try:
|
| 394 |
-
db_results, live_results =
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
top_k=per_lang_limit
|
| 403 |
-
)
|
| 404 |
)
|
| 405 |
|
| 406 |
print(f"DEBUG: Hybrid search returned {len(db_results)} DB + {len(live_results)} live results")
|
|
|
|
| 391 |
|
| 392 |
# Execute hybrid search (parallel live + DB)
|
| 393 |
try:
|
| 394 |
+
db_results, live_results = await self.orchestrator.execute_hybrid_search(
|
| 395 |
+
query=query,
|
| 396 |
+
english_query=expanded_query,
|
| 397 |
+
strategy=strategy,
|
| 398 |
+
embedder=self.embedder,
|
| 399 |
+
vector_store=self.vector_store,
|
| 400 |
+
translated_queries=lang_sparse_queries,
|
| 401 |
+
top_k=per_lang_limit
|
|
|
|
|
|
|
| 402 |
)
|
| 403 |
|
| 404 |
print(f"DEBUG: Hybrid search returned {len(db_results)} DB + {len(live_results)} live results")
|