From 26409b01bde25bdfb87174557b86beef267b345a Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 5 Jul 2023 19:02:27 +0100 Subject: [PATCH] Remove extra base model (#7213) --- langchain/vectorstores/azuresearch.py | 4 ++-- langchain/vectorstores/base.py | 4 ++-- langchain/vectorstores/redis.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/langchain/vectorstores/azuresearch.py b/langchain/vectorstores/azuresearch.py index 2404d31431b..2fe4c50b1c2 100644 --- a/langchain/vectorstores/azuresearch.py +++ b/langchain/vectorstores/azuresearch.py @@ -18,7 +18,7 @@ from typing import ( ) import numpy as np -from pydantic import BaseModel, root_validator +from pydantic import root_validator from langchain.callbacks.manager import ( AsyncCallbackManagerForRetrieverRun, @@ -475,7 +475,7 @@ class AzureSearch(VectorStore): return azure_search -class AzureSearchVectorStoreRetriever(BaseRetriever, BaseModel): +class AzureSearchVectorStoreRetriever(BaseRetriever): vectorstore: AzureSearch search_type: str = "hybrid" k: int = 4 diff --git a/langchain/vectorstores/base.py b/langchain/vectorstores/base.py index 563493d6957..346108617d4 100644 --- a/langchain/vectorstores/base.py +++ b/langchain/vectorstores/base.py @@ -19,7 +19,7 @@ from typing import ( TypeVar, ) -from pydantic import BaseModel, Field, root_validator +from pydantic import Field, root_validator from langchain.callbacks.manager import ( AsyncCallbackManagerForRetrieverRun, @@ -373,7 +373,7 @@ class VectorStore(ABC): return VectorStoreRetriever(vectorstore=self, **kwargs) -class VectorStoreRetriever(BaseRetriever, BaseModel): +class VectorStoreRetriever(BaseRetriever): vectorstore: VectorStore search_type: str = "similarity" search_kwargs: dict = Field(default_factory=dict) diff --git a/langchain/vectorstores/redis.py b/langchain/vectorstores/redis.py index 57e737d215b..20eecf7ee23 100644 --- a/langchain/vectorstores/redis.py +++ b/langchain/vectorstores/redis.py @@ -20,7 +20,7 @@ from typing import ( ) import numpy as np -from pydantic import BaseModel, root_validator +from pydantic import root_validator from langchain.callbacks.manager import ( AsyncCallbackManagerForRetrieverRun, @@ -599,7 +599,7 @@ class Redis(VectorStore): return RedisVectorStoreRetriever(vectorstore=self, **kwargs) -class RedisVectorStoreRetriever(VectorStoreRetriever, BaseModel): +class RedisVectorStoreRetriever(VectorStoreRetriever): vectorstore: Redis search_type: str = "similarity" k: int = 4