jack 1 ay önce
ebeveyn
işleme
75cbd50b9d
2 değiştirilmiş dosya ile 8 ekleme ve 4 silme
  1. 1 1
      app/core/tools/file_search_tool.py
  2. 7 3
      app/providers/r2r.py

+ 1 - 1
app/core/tools/file_search_tool.py

@@ -60,7 +60,7 @@ class FileSearchTool(BaseTool):
                     )
                 print(folder_fileinfo)
                 for file in folder_fileinfo:
-                    self.__filenames.append(file.title)
+                    self.__filenames.append(file.get("title"))
                     self.__keys.append(file.get("metadata").get("file_key"))
 
         # pre-cache data to prevent thread conflicts that may occur later on.

+ 7 - 3
app/providers/r2r.py

@@ -100,9 +100,13 @@ class R2R:
             "collectionscollectionscollectionscollectionscollectionscollectionscollectionscollectionscollectionscollectionscollectionscollections"
         )
         if id != "":
-            listed = await self.client.collections.list_documents(
-                id=id, limit=limit, offset=offset
-            )
+            try:
+                listed = await self.client.collections.list_documents(
+                    id=id, limit=limit, offset=offset
+                )
+            except Exception as e:
+                print(e)
+                listed = []
             print(listed.get("results"))
             return listed.get("results")
         else: