Spaces:
Runtime error
Runtime error
Commit ·
091afc0
1
Parent(s): 197512a
Add error handling to semantic_search method in FileService to give ai context
Browse files
src/services/_file_service.py
CHANGED
|
@@ -51,5 +51,8 @@ class FileService:
|
|
| 51 |
await file.close()
|
| 52 |
|
| 53 |
async def semantic_search(self, query):
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
await file.close()
|
| 52 |
|
| 53 |
async def semantic_search(self, query):
|
| 54 |
+
try:
|
| 55 |
+
async with self.pinecone_client() as client:
|
| 56 |
+
return await client.similarity_search(query=query)
|
| 57 |
+
except Exception as e:
|
| 58 |
+
return str(e)
|