Spaces:
Sleeping
Sleeping
langchain.docstore Document
Browse files
src/gemini/file_search.py
CHANGED
|
@@ -19,6 +19,12 @@ except ImportError:
|
|
| 19 |
GEMINI_AVAILABLE = False
|
| 20 |
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
@dataclass
|
| 23 |
class GeminiFileSearchResult:
|
| 24 |
"""Result from Gemini File Search query"""
|
|
@@ -369,7 +375,6 @@ IMPORTANT: Only use information from the retrieved documents. Do not use informa
|
|
| 369 |
|
| 370 |
Returns list of document-like objects compatible with existing display code.
|
| 371 |
"""
|
| 372 |
-
from langchain.docstore.document import Document
|
| 373 |
|
| 374 |
formatted_sources = []
|
| 375 |
|
|
|
|
| 19 |
GEMINI_AVAILABLE = False
|
| 20 |
|
| 21 |
|
| 22 |
+
try:
|
| 23 |
+
from langchain.docstore.document import Document
|
| 24 |
+
except:
|
| 25 |
+
from langchain_core.documents import Document
|
| 26 |
+
|
| 27 |
+
|
| 28 |
@dataclass
|
| 29 |
class GeminiFileSearchResult:
|
| 30 |
"""Result from Gemini File Search query"""
|
|
|
|
| 375 |
|
| 376 |
Returns list of document-like objects compatible with existing display code.
|
| 377 |
"""
|
|
|
|
| 378 |
|
| 379 |
formatted_sources = []
|
| 380 |
|