Skip to content

Commit ab31883

Browse files
authored
refactor: update document store import to use BaseDocumentStore in DocumentContextExtractor (#19466)
1 parent 9050875 commit ab31883

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llama-index-core/llama_index/core/extractors/document_context.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
DocumentBlock,
3131
)
3232
from llama_index.core.schema import BaseNode, Node, TextNode
33-
from llama_index.core.storage.docstore.simple_docstore import DocumentStore
33+
from llama_index.core.storage.docstore.types import BaseDocumentStore
3434

3535

3636
def is_text_node(node: BaseNode) -> TypeGuard[Union[Node, TextNode]]:
@@ -64,7 +64,7 @@ class DocumentContextExtractor(BaseExtractor):
6464
6565
Attributes:
6666
llm (LLM): Language model instance for generating context
67-
docstore (DocumentStore): Storage for parent documents
67+
docstore (BaseDocumentStore): Storage for parent documents
6868
key (str): Metadata key for storing extracted context
6969
prompt (str): Prompt template for context generation
7070
doc_ids (Set[str]): Set of processed document IDs
@@ -87,7 +87,7 @@ class DocumentContextExtractor(BaseExtractor):
8787

8888
# Pydantic fields
8989
llm: LLM
90-
docstore: DocumentStore
90+
docstore: BaseDocumentStore
9191
key: str
9292
prompt: str
9393
doc_ids: Set[str]
@@ -103,7 +103,7 @@ class DocumentContextExtractor(BaseExtractor):
103103

104104
def __init__(
105105
self,
106-
docstore: DocumentStore,
106+
docstore: BaseDocumentStore,
107107
llm: Optional[LLM] = None,
108108
max_context_length: int = 1000,
109109
key: str = DEFAULT_KEY,

0 commit comments

Comments
 (0)