Skip to content

The agent engineering platform.

deprecating integrations moved to langchain_google_community (#19841)

Leonid Kuligineb0521064eb3
diff --git a/libs/community/langchain_community/chat_loaders/gmail.py b/libs/community/langchain_community/chat_loaders/gmail.py
index 7f120347f5..27dd0ff906 100644
--- a/libs/community/langchain_community/chat_loaders/gmail.py
+++ b/libs/community/langchain_community/chat_loaders/gmail.py
@@ -2,6 +2,7 @@ import base64
import re
from typing import Any, Iterator
+from langchain_core._api.deprecation import deprecated
from langchain_core.chat_sessions import ChatSession
from langchain_core.messages import HumanMessage
@@ -63,6 +64,11 @@ def _get_message_data(service: Any, message: Any) -> ChatSession:
return ChatSession(messages=[starter_content, message_content])
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.GMailLoader",
+)
class GMailLoader(BaseChatLoader):
"""Load data from `GMail`.
diff --git a/libs/community/langchain_community/document_loaders/bigquery.py b/libs/community/langchain_community/document_loaders/bigquery.py
index e007b1f495..0d809ce53f 100644
--- a/libs/community/langchain_community/document_loaders/bigquery.py
+++ b/libs/community/langchain_community/document_loaders/bigquery.py
@@ -2,6 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional
+from langchain_core._api.deprecation import deprecated
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
@@ -11,6 +12,11 @@ if TYPE_CHECKING:
from google.auth.credentials import Credentials
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.BigQueryLoader",
+)
class BigQueryLoader(BaseLoader):
"""Load from the Google Cloud Platform `BigQuery`.
diff --git a/libs/community/langchain_community/document_loaders/gcs_directory.py b/libs/community/langchain_community/document_loaders/gcs_directory.py
index 3414ec3b67..3bb0cd0738 100644
--- a/libs/community/langchain_community/document_loaders/gcs_directory.py
+++ b/libs/community/langchain_community/document_loaders/gcs_directory.py
@@ -1,6 +1,7 @@
import logging
from typing import Callable, List, Optional
+from langchain_core._api.deprecation import deprecated
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
@@ -10,6 +11,11 @@ from langchain_community.utilities.vertexai import get_client_info
logger = logging.getLogger(__name__)
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.GCSDirectoryLoader",
+)
class GCSDirectoryLoader(BaseLoader):
"""Load from GCS directory."""
diff --git a/libs/community/langchain_community/document_loaders/gcs_file.py b/libs/community/langchain_community/document_loaders/gcs_file.py
index a527d2f5b0..26993f6125 100644
--- a/libs/community/langchain_community/document_loaders/gcs_file.py
+++ b/libs/community/langchain_community/document_loaders/gcs_file.py
@@ -2,6 +2,7 @@ import os
import tempfile
from typing import Callable, List, Optional
+from langchain_core._api.deprecation import deprecated
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
@@ -9,6 +10,11 @@ from langchain_community.document_loaders.unstructured import UnstructuredFileLo
from langchain_community.utilities.vertexai import get_client_info
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.GCSFileLoader",
+)
class GCSFileLoader(BaseLoader):
"""Load from GCS file."""
diff --git a/libs/community/langchain_community/document_loaders/google_speech_to_text.py b/libs/community/langchain_community/document_loaders/google_speech_to_text.py
index da3c743dea..c90e1e7a02 100644
--- a/libs/community/langchain_community/document_loaders/google_speech_to_text.py
+++ b/libs/community/langchain_community/document_loaders/google_speech_to_text.py
@@ -2,6 +2,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional
+from langchain_core._api.deprecation import deprecated
from langchain_core.documents import Document
from langchain_community.document_loaders.base import BaseLoader
@@ -12,6 +13,11 @@ if TYPE_CHECKING:
from google.protobuf.field_mask_pb2 import FieldMask
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.SpeechToTextLoader",
+)
class GoogleSpeechToTextLoader(BaseLoader):
"""
Loader for Google Cloud Speech-to-Text audio transcripts.
diff --git a/libs/community/langchain_community/document_loaders/googledrive.py b/libs/community/langchain_community/document_loaders/googledrive.py
index 9e28b4dedf..581c4285b2 100644
--- a/libs/community/langchain_community/document_loaders/googledrive.py
+++ b/libs/community/langchain_community/document_loaders/googledrive.py
@@ -11,6 +11,7 @@ import os
from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Union
+from langchain_core._api.deprecation import deprecated
from langchain_core.documents import Document
from langchain_core.pydantic_v1 import BaseModel, root_validator, validator
@@ -19,6 +20,11 @@ from langchain_community.document_loaders.base import BaseLoader
SCOPES = ["https://www.googleapis.com/auth/drive.readonly"]
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.GoogleDriveLoader",
+)
class GoogleDriveLoader(BaseLoader, BaseModel):
"""Load Google Docs from `Google Drive`."""
diff --git a/libs/community/langchain_community/document_loaders/parsers/docai.py b/libs/community/langchain_community/document_loaders/parsers/docai.py
index ca2bc8e535..bb7a502db2 100644
--- a/libs/community/langchain_community/document_loaders/parsers/docai.py
+++ b/libs/community/langchain_community/document_loaders/parsers/docai.py
@@ -10,6 +10,7 @@ import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, Iterator, List, Optional, Sequence
+from langchain_core._api.deprecation import deprecated
from langchain_core.documents import Document
from langchain_core.utils.iter import batch_iterate
@@ -33,6 +34,11 @@ class DocAIParsingResults:
parsed_path: str
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.DocAIParser",
+)
class DocAIParser(BaseBlobParser):
"""`Google Cloud Document AI` parser.
diff --git a/libs/community/langchain_community/document_transformers/google_translate.py b/libs/community/langchain_community/document_transformers/google_translate.py
index b2653c4891..d21cfd47de 100644
--- a/libs/community/langchain_community/document_transformers/google_translate.py
+++ b/libs/community/langchain_community/document_transformers/google_translate.py
@@ -1,10 +1,16 @@
from typing import Any, Optional, Sequence
+from langchain_core._api.deprecation import deprecated
from langchain_core.documents import BaseDocumentTransformer, Document
from langchain_community.utilities.vertexai import get_client_info
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.DocAIParser",
+)
class GoogleTranslateTransformer(BaseDocumentTransformer):
"""Translate text documents using Google Cloud Translation."""
diff --git a/libs/community/langchain_community/retrievers/google_cloud_documentai_warehouse.py b/libs/community/langchain_community/retrievers/google_cloud_documentai_warehouse.py
index ce71a2db1d..50913a65dc 100644
--- a/libs/community/langchain_community/retrievers/google_cloud_documentai_warehouse.py
+++ b/libs/community/langchain_community/retrievers/google_cloud_documentai_warehouse.py
@@ -1,6 +1,7 @@
"""Retriever wrapper for Google Cloud Document AI Warehouse."""
from typing import TYPE_CHECKING, Any, Dict, List, Optional
+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 root_validator
@@ -20,6 +21,11 @@ if TYPE_CHECKING:
)
+@deprecated(
+ since="0.0.32",
+ removal="0.2.0",
+ alternative_import="langchain_google_community.GoogleDriveLoader",
+)
class GoogleDocumentAIWarehouseRetriever(BaseRetriever):
"""A retriever based on Document AI Warehouse.