deprecating integrations moved to langchain_google_community (#19841)

Thank you for contributing to LangChain!

- [ ] **PR title**: "community: deprecating integrations moved to
langchain_google_community"

- [ ] **PR message**: deprecating integrations moved to
langchain_google_community

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
Leonid Kuligin 2024-04-02 23:06:07 +02:00 committed by GitHub
parent f0d5b59962
commit eb0521064e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 54 additions and 0 deletions

View File

@ -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`.

View File

@ -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`.

View File

@ -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."""

View File

@ -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."""

View File

@ -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.

View File

@ -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`."""

View File

@ -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.

View File

@ -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."""

View File

@ -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.