Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecating integrations moved to langchain_google_community #19841

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions libs/community/langchain_community/chat_loaders/gmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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

Expand Down Expand Up @@ -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`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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
Expand All @@ -11,6 +12,11 @@
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`.

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +11,11 @@
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."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
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
from langchain_community.document_loaders.unstructured import UnstructuredFileLoader
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."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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
Expand All @@ -12,6 +13,11 @@
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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

Expand All @@ -19,6 +20,11 @@
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`."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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

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

Expand Down
Original file line number Diff line number Diff line change
@@ -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."""

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,6 +21,11 @@
)


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

Expand Down