diff --git a/libs/vertexai/langchain_google_vertexai/embeddings.py b/libs/vertexai/langchain_google_vertexai/embeddings.py index 241730fd..c5563597 100644 --- a/libs/vertexai/langchain_google_vertexai/embeddings.py +++ b/libs/vertexai/langchain_google_vertexai/embeddings.py @@ -48,7 +48,7 @@ def validate_environment(cls, values: Dict) -> Dict: "textembedding-gecko@001" ) values["model_name"] = "textembedding-gecko@001" - _, user_agent = get_user_agent(f"{cls.__name__}_{values['model_name']}") + _, user_agent = get_user_agent(f"{cls.__name__}_{values['model_name']}") # type: ignore with tool_context_manager(user_agent): values["client"] = TextEmbeddingModel.from_pretrained(values["model_name"]) return values @@ -83,9 +83,9 @@ def __init__( self.instance["task_executor"] = ThreadPoolExecutor( max_workers=request_parallelism ) - self.instance[ - "embeddings_task_type_supported" - ] = not self.client._endpoint_name.endswith("/textembedding-gecko@001") + self.instance["embeddings_task_type_supported"] = ( + not self.client._endpoint_name.endswith("/textembedding-gecko@001") + ) @staticmethod def _split_by_punctuation(text: str) -> List[str]: