Spaces:
Build error
Build error
Update services/chat_service.py
Browse files- services/chat_service.py +5 -2
services/chat_service.py
CHANGED
|
@@ -160,7 +160,7 @@ class ChatService:
|
|
| 160 |
|
| 161 |
# Search all sources
|
| 162 |
search_results = await self.search_all_sources(user_input)
|
| 163 |
-
|
| 164 |
# Build context
|
| 165 |
context = self.build_context(search_results, chat_history_raw)
|
| 166 |
|
|
@@ -197,6 +197,8 @@ class ChatService:
|
|
| 197 |
) -> Dict[str, List[Dict[str, Any]]]:
|
| 198 |
"""Search across all available data sources"""
|
| 199 |
try:
|
|
|
|
|
|
|
| 200 |
# Run searches in parallel
|
| 201 |
product_task = asyncio.create_task(
|
| 202 |
self.data_service.search(query, top_k)
|
|
@@ -212,7 +214,8 @@ class ChatService:
|
|
| 212 |
products, pdfs, faqs = await asyncio.gather(
|
| 213 |
product_task, pdf_task, faq_task
|
| 214 |
)
|
| 215 |
-
|
|
|
|
| 216 |
return {
|
| 217 |
'products': products,
|
| 218 |
'documents': pdfs,
|
|
|
|
| 160 |
|
| 161 |
# Search all sources
|
| 162 |
search_results = await self.search_all_sources(user_input)
|
| 163 |
+
print(search_results)
|
| 164 |
# Build context
|
| 165 |
context = self.build_context(search_results, chat_history_raw)
|
| 166 |
|
|
|
|
| 197 |
) -> Dict[str, List[Dict[str, Any]]]:
|
| 198 |
"""Search across all available data sources"""
|
| 199 |
try:
|
| 200 |
+
print("-----------------------------")
|
| 201 |
+
print("starting searches .... ")
|
| 202 |
# Run searches in parallel
|
| 203 |
product_task = asyncio.create_task(
|
| 204 |
self.data_service.search(query, top_k)
|
|
|
|
| 214 |
products, pdfs, faqs = await asyncio.gather(
|
| 215 |
product_task, pdf_task, faq_task
|
| 216 |
)
|
| 217 |
+
|
| 218 |
+
print(products)
|
| 219 |
return {
|
| 220 |
'products': products,
|
| 221 |
'documents': pdfs,
|