diff --git a/Makefile b/Makefile index c60f3c4..6ab09ab 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ install-dev: test: @echo "Running tests..." pre-commit run --all-files - mypy . + mypy langchain_linkup # Follow the test practices recommanded by LangChain (v0.3) # See https://python.langchain.com/docs/contributing/how_to/integrations/standard_tests/ pytest --cov=langchain_linkup/ --cov-report term-missing --disable-socket --allow-unix-socket tests/unit_tests diff --git a/langchain_linkup/search_retriever.py b/langchain_linkup/search_retriever.py index 9ea9605..bd4d9a2 100644 --- a/langchain_linkup/search_retriever.py +++ b/langchain_linkup/search_retriever.py @@ -1,4 +1,4 @@ -from typing import Literal, Optional +from typing import Literal, Optional, cast from langchain_core.callbacks import ( AsyncCallbackManagerForRetrieverRun, @@ -6,7 +6,7 @@ ) from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever -from linkup import LinkupClient, LinkupSearchResults +from linkup import LinkupClient, LinkupSearchResults, LinkupSearchTextResult class LinkupSearchRetriever(BaseRetriever): @@ -129,11 +129,12 @@ def _get_relevant_documents( query=query, depth=self.depth, output_type="searchResults", + include_images=False, ) return [ Document( - page_content=result.content, + page_content=cast(LinkupSearchTextResult, result).content, metadata=dict( name=result.name, url=result.url, @@ -153,11 +154,12 @@ async def _aget_relevant_documents( query=query, depth=self.depth, output_type="searchResults", + include_images=False, ) return [ Document( - page_content=result.content, + page_content=cast(LinkupSearchTextResult, result).content, metadata=dict( name=result.name, url=result.url,