Skip to content

Commit

Permalink
Merge pull request #26 from NASA-IMPACT/bugfix/document-retriever
Browse files Browse the repository at this point in the history
Bugfix `larch.indexing.DocumentIndexer.as_langchain_retriever(...)`
  • Loading branch information
NISH1001 authored Feb 14, 2024
2 parents 3440f77 + 15ecf3d commit 8e8489b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion larch/indexing/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ def query(self, query: str, **kwargs) -> Response:

def as_langchain_retriever(self) -> Type[BaseRetriever]:
# to avoid circular import
from .search.chains import DocumentIndexerAsRetriever
from ..search.chains import DocumentIndexerAsRetriever

return DocumentIndexerAsRetriever(document_indexer=self)
4 changes: 2 additions & 2 deletions larch/search/chains.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

from typing import List, Type
from typing import List

from langchain.callbacks.manager import CallbackManagerForRetrieverRun
from langchain.schema.retriever import BaseRetriever
Expand All @@ -10,7 +10,7 @@


class DocumentIndexerAsRetriever(BaseRetriever):
document_indexer: Type[DocumentIndexer]
document_indexer: DocumentIndexer

def _get_relevant_documents(
self,
Expand Down

0 comments on commit 8e8489b

Please sign in to comment.