community[patch]: deprecating remaining google_community integrations (#20471)

Deprecating remaining google community integrations
pull/12271/head^2
Leonid Kuligin 6 months ago committed by GitHub
parent b66a4f48fa
commit 676c68d318
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,4 +1,5 @@
"""Retriever wrapper for Google Cloud Document AI Warehouse."""
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from langchain_core._api.deprecation import deprecated
@ -24,7 +25,7 @@ if TYPE_CHECKING:
@deprecated(
since="0.0.32",
removal="0.2.0",
alternative_import="langchain_google_community.GoogleDriveLoader",
alternative_import="langchain_google_community.DocumentAIWarehouseRetriever",
)
class GoogleDocumentAIWarehouseRetriever(BaseRetriever):
"""A retriever based on Document AI Warehouse.

@ -4,6 +4,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.pydantic_v1 import BaseModel, Extra, Field, root_validator
@ -195,6 +196,11 @@ class _BaseGoogleVertexAISearchRetriever(BaseModel):
return documents
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.VertexAISearchRetriever",
)
class GoogleVertexAISearchRetriever(BaseRetriever, _BaseGoogleVertexAISearchRetriever):
"""`Google Vertex AI Search` retriever.
@ -390,6 +396,11 @@ class GoogleVertexAISearchRetriever(BaseRetriever, _BaseGoogleVertexAISearchRetr
return documents, response
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.VertexAIMultiTurnSearchRetriever",
)
class GoogleVertexAIMultiTurnSearchRetriever(
BaseRetriever, _BaseGoogleVertexAISearchRetriever
):

@ -3,6 +3,7 @@ from __future__ import annotations
import tempfile
from typing import TYPE_CHECKING, Any, Optional
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.tools import BaseTool
@ -36,6 +37,11 @@ def _encoding_file_extension_map(encoding: texttospeech.AudioEncoding) -> Option
return ENCODING_FILE_EXTENSION_MAP.get(encoding)
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.TextToSpeechTool",
)
class GoogleCloudTextToSpeechTool(BaseTool):
"""Tool that queries the Google Cloud Text to Speech API.

@ -2,6 +2,7 @@
from typing import Optional, Type
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.tools import BaseTool
@ -15,6 +16,11 @@ class GooglePlacesSchema(BaseModel):
query: str = Field(..., description="Query for google maps")
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.GooglePlacesTool",
)
class GooglePlacesTool(BaseTool):
"""Tool that queries the Google places API."""

@ -2,12 +2,18 @@
from typing import Optional
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.tools import BaseTool
from langchain_community.utilities.google_search import GoogleSearchAPIWrapper
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.GoogleSearchRun",
)
class GoogleSearchRun(BaseTool):
"""Tool that queries the Google search API."""
@ -28,6 +34,11 @@ class GoogleSearchRun(BaseTool):
return self.api_wrapper.run(query)
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.GoogleSearchResults",
)
class GoogleSearchResults(BaseTool):
"""Tool that queries the Google Search API and gets back json."""

@ -1,13 +1,18 @@
"""Chain that calls Google Places API.
"""
"""Chain that calls Google Places API."""
import logging
from typing import Any, Dict, Optional
from langchain_core._api.deprecation import deprecated
from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator
from langchain_core.utils import get_from_dict_or_env
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.GooglePlacesAPIWrapper",
)
class GooglePlacesAPIWrapper(BaseModel):
"""Wrapper around Google Places API.

@ -1,10 +1,17 @@
"""Util that calls Google Search."""
from typing import Any, Dict, List, Optional
from langchain_core._api.deprecation import deprecated
from langchain_core.pydantic_v1 import BaseModel, Extra, root_validator
from langchain_core.utils import get_from_dict_or_env
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.GoogleSearchAPIWrapper",
)
class GoogleSearchAPIWrapper(BaseModel):
"""Wrapper for Google Search API.

@ -1,4 +1,5 @@
"""Vector Store in Google Cloud BigQuery."""
from __future__ import annotations
import asyncio
@ -12,6 +13,7 @@ from threading import Lock, Thread
from typing import Any, Callable, Dict, List, Optional, Tuple, Type
import numpy as np
from langchain_core._api.deprecation import deprecated
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.vectorstores import VectorStore
@ -34,6 +36,11 @@ _INDEX_CHECK_PERIOD_SECONDS = 60 # Do not check for index more often that this.
_vector_table_lock = Lock() # process-wide BigQueryVectorSearch table lock
@deprecated(
since="0.0.33",
removal="0.2.0",
alternative_import="langchain_google_community.BigQueryVectorSearch",
)
class BigQueryVectorSearch(VectorStore):
"""Google Cloud BigQuery vector store.

Loading…
Cancel
Save