From 6c60642bb9ad27778b9a18b7bc7f95b6610b1fb8 Mon Sep 17 00:00:00 2001 From: Leonid Kuligin Date: Mon, 26 Feb 2024 14:16:08 +0100 Subject: [PATCH] fixed lint --- .../vectorstores/vectorstores.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/libs/vertexai/langchain_google_vertexai/vectorstores/vectorstores.py b/libs/vertexai/langchain_google_vertexai/vectorstores/vectorstores.py index ea0be4422..4b6ed0b8d 100644 --- a/libs/vertexai/langchain_google_vertexai/vectorstores/vectorstores.py +++ b/libs/vertexai/langchain_google_vertexai/vectorstores/vectorstores.py @@ -1,6 +1,6 @@ import uuid import warnings -from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Tuple, Type, Union +from typing import Any, Iterable, List, Optional, Tuple, Type, Union from google.cloud.aiplatform.matching_engine.matching_engine_index_endpoint import ( Namespace, @@ -19,9 +19,6 @@ Searcher, ) -if TYPE_CHECKING: - from langchain_community.embeddings import TensorflowHubEmbeddings - class _BaseVertexAIVectorStore(VectorStore): """Represents a base vector store based on VertexAI.""" @@ -189,7 +186,7 @@ def from_texts( ) @classmethod - def _get_default_embeddings(cls) -> "TensorflowHubEmbeddings": + def _get_default_embeddings(cls) -> Embeddings: """This function returns the default embedding. Returns: Default TensorflowHubEmbeddings to use. @@ -205,12 +202,9 @@ def _get_default_embeddings(cls) -> "TensorflowHubEmbeddings": ) # TODO: Change to vertexai embbedingss + from langchain_community import embeddings - from langchain_community.embeddings import ( - TensorflowHubEmbeddings, # type: ignore - ) - - return TensorflowHubEmbeddings() + return embeddings.TensorflowHubEmbeddings() def _generate_unique_ids(self, number: int) -> List[str]: """Generates a list of unique ids of length `number`