-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
10 changed files
with
315 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
_all__ = [] | ||
|
||
try: | ||
from byaldi.integrations._langchain import ByaldiLangChainRetriever | ||
|
||
_all__.append("ByaldiLangChainRetriever") | ||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from typing import Any, List | ||
|
||
from langchain_core.callbacks.manager import CallbackManagerForRetrieverRun | ||
from langchain_core.retrievers import BaseRetriever | ||
|
||
from byaldi.objects import Result | ||
|
||
|
||
class ByaldiLangChainRetriever(BaseRetriever): | ||
model: Any | ||
kwargs: dict = {} | ||
|
||
def _get_relevant_documents( | ||
self, | ||
query: str, | ||
*, | ||
run_manager: CallbackManagerForRetrieverRun, # noqa | ||
) -> List[Result]: | ||
"""Get documents relevant to a query.""" | ||
docs = self.model.search(query, **self.kwargs) | ||
return docs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.