diff --git a/langchain/retrievers/llama_index.py b/langchain/retrievers/llama_index.py index 5ede25e7b3..90be4d6445 100644 --- a/langchain/retrievers/llama_index.py +++ b/langchain/retrievers/llama_index.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Optional, cast +from typing import Any, Dict, List, cast from pydantic import BaseModel, Field @@ -40,7 +40,7 @@ class LlamaIndexRetriever(BaseRetriever, BaseModel): return docs async def _aget_relevant_documents( - self, query: str, *, run_manager: Optional[AsyncCallbackManagerForRetrieverRun] + self, query: str, *, run_manager: AsyncCallbackManagerForRetrieverRun ) -> List[Document]: raise NotImplementedError("LlamaIndexRetriever does not support async") diff --git a/langchain/retrievers/self_query/base.py b/langchain/retrievers/self_query/base.py index 5e07a10d9e..c139ca736b 100644 --- a/langchain/retrievers/self_query/base.py +++ b/langchain/retrievers/self_query/base.py @@ -117,7 +117,7 @@ class SelfQueryRetriever(BaseRetriever, BaseModel): return docs async def _aget_relevant_documents( - self, query: str, *, run_manager: Optional[AsyncCallbackManagerForRetrieverRun] + self, query: str, *, run_manager: AsyncCallbackManagerForRetrieverRun ) -> List[Document]: raise NotImplementedError diff --git a/langchain/vectorstores/base.py b/langchain/vectorstores/base.py index 0328a3bcbf..563493d695 100644 --- a/langchain/vectorstores/base.py +++ b/langchain/vectorstores/base.py @@ -407,7 +407,7 @@ class VectorStoreRetriever(BaseRetriever, BaseModel): return values def _get_relevant_documents( - self, query: str, *, run_manager: Optional[CallbackManagerForRetrieverRun] + self, query: str, *, run_manager: CallbackManagerForRetrieverRun ) -> List[Document]: if self.search_type == "similarity": docs = self.vectorstore.similarity_search(query, **self.search_kwargs) @@ -427,7 +427,7 @@ class VectorStoreRetriever(BaseRetriever, BaseModel): return docs async def _aget_relevant_documents( - self, query: str, *, run_manager: Optional[AsyncCallbackManagerForRetrieverRun] + self, query: str, *, run_manager: AsyncCallbackManagerForRetrieverRun ) -> List[Document]: if self.search_type == "similarity": docs = await self.vectorstore.asimilarity_search( diff --git a/langchain/vectorstores/redis.py b/langchain/vectorstores/redis.py index 10bda5123b..57e737d215 100644 --- a/langchain/vectorstores/redis.py +++ b/langchain/vectorstores/redis.py @@ -620,7 +620,7 @@ class RedisVectorStoreRetriever(VectorStoreRetriever, BaseModel): return values def _get_relevant_documents( - self, query: str, *, run_manager: Optional[CallbackManagerForRetrieverRun] + self, query: str, *, run_manager: CallbackManagerForRetrieverRun ) -> List[Document]: if self.search_type == "similarity": docs = self.vectorstore.similarity_search(query, k=self.k) @@ -633,7 +633,7 @@ class RedisVectorStoreRetriever(VectorStoreRetriever, BaseModel): return docs async def _aget_relevant_documents( - self, query: str, *, run_manager: Optional[AsyncCallbackManagerForRetrieverRun] + self, query: str, *, run_manager: AsyncCallbackManagerForRetrieverRun ) -> List[Document]: raise NotImplementedError("RedisVectorStoreRetriever does not support async") diff --git a/langchain/vectorstores/singlestoredb.py b/langchain/vectorstores/singlestoredb.py index 90f1693092..b9fa63ede4 100644 --- a/langchain/vectorstores/singlestoredb.py +++ b/langchain/vectorstores/singlestoredb.py @@ -451,7 +451,7 @@ class SingleStoreDBRetriever(VectorStoreRetriever): allowed_search_types: ClassVar[Collection[str]] = ("similarity",) def _get_relevant_documents( - self, query: str, *, run_manager: Optional[CallbackManagerForRetrieverRun] + self, query: str, *, run_manager: CallbackManagerForRetrieverRun ) -> List[Document]: if self.search_type == "similarity": docs = self.vectorstore.similarity_search(query, k=self.k) @@ -460,7 +460,7 @@ class SingleStoreDBRetriever(VectorStoreRetriever): return docs async def _aget_relevant_documents( - self, query: str, *, run_manager: Optional[AsyncCallbackManagerForRetrieverRun] + self, query: str, *, run_manager: AsyncCallbackManagerForRetrieverRun ) -> List[Document]: raise NotImplementedError( "SingleStoreDBVectorStoreRetriever does not support async"