akryldigital commited on
Commit
a533525
·
verified ·
1 Parent(s): 93c65c5

langchain.docstore Document

Browse files
Files changed (1) hide show
  1. src/gemini/file_search.py +6 -1
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