community[minor]: Breebs docs retriever (#16578)

- **Description:** Implementation of breeb retriever with integration
tests ->
libs/community/tests/integration_tests/retrievers/test_breebs.py and
documentation (notebook) ->
docs/docs/integrations/retrievers/breebs.ipynb.
  - **Dependencies:** None
This commit is contained in:
Alex Boury
2024-02-06 00:51:08 +01:00
committed by GitHub
parent eb7b05885f
commit 334b6ebdf3
6 changed files with 192 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
from typing import List
from langchain_core.callbacks.manager import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_community.retrievers.breebs import BreebsRetriever
class TestBreebsRetriever:
def test_breeb_query(self) -> None:
breeb_key = "Parivoyage"
query = "What are the best churches to visit in Paris?"
breeb_retriever = BreebsRetriever(breeb_key)
documents: List[Document] = breeb_retriever._get_relevant_documents(
query, run_manager=CallbackManagerForRetrieverRun
)
assert isinstance(documents, list), "Documents should be a list"
for doc in documents:
assert doc.page_content, "Document page_content should not be None"
assert doc.metadata["source"], "Document metadata should contain 'source'"
assert doc.metadata["score"] == 1, "Document score should be equal to 1"

View File

@@ -6,6 +6,7 @@ EXPECTED_ALL = [
"ArceeRetriever",
"ArxivRetriever",
"AzureCognitiveSearchRetriever",
"BreebsRetriever",
"ChatGPTPluginRetriever",
"ChaindeskRetriever",
"CohereRagRetriever",