community[patch]: more deprecations (#15782)

This commit is contained in:
Erick Friis 2024-01-09 20:36:16 -08:00 committed by GitHub
parent 33dccf0f66
commit 85a4594ed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 36 additions and 52 deletions

View File

@ -20,14 +20,7 @@ logger = logging.getLogger(__name__)
@deprecated( @deprecated(
since="0.0.10", since="0.0.10",
removal="0.2.0", removal="0.2.0",
message=( alternative_import="langchain_openai.AzureChatOpenAI",
"The class langchain_community.chat_models.azure_openai.AzureChatOpenAI was "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import AzureChatOpenAI`."
),
) )
class AzureChatOpenAI(ChatOpenAI): class AzureChatOpenAI(ChatOpenAI):
"""`Azure OpenAI` Chat Completion API. """`Azure OpenAI` Chat Completion API.

View File

@ -145,16 +145,7 @@ def _convert_delta_to_message_chunk(
@deprecated( @deprecated(
since="0.0.10", since="0.0.10", removal="0.2.0", alternative_import="langchain_openai.ChatOpenAI"
removal="0.2.0",
message=(
"The class langchain_community.chat_models.openai.ChatOpenAI was "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import ChatOpenAI`."
),
) )
class ChatOpenAI(BaseChatModel): class ChatOpenAI(BaseChatModel):
"""`OpenAI` Chat large language models API. """`OpenAI` Chat large language models API.

View File

@ -9,6 +9,7 @@ from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union, ca
from urllib.parse import urlparse from urllib.parse import urlparse
import requests import requests
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks import ( from langchain_core.callbacks import (
AsyncCallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun, CallbackManagerForLLMRun,
@ -203,6 +204,11 @@ def _get_question(messages: List[BaseMessage]) -> HumanMessage:
return question return question
@deprecated(
since="0.0.12",
removal="0.2.0",
alternative_import="langchain_google_vertexai.ChatVertexAI",
)
class ChatVertexAI(_VertexAICommon, BaseChatModel): class ChatVertexAI(_VertexAICommon, BaseChatModel):
"""`Vertex AI` Chat large language models API.""" """`Vertex AI` Chat large language models API."""

View File

@ -14,7 +14,9 @@ from langchain_community.utils.openai import is_openai_v1
@deprecated( @deprecated(
since="0.1.0", removal="0.2.0", alternative="langchain_openai.AzureOpenAIEmbeddings" since="0.1.0",
removal="0.2.0",
alternative_import="langchain_openai.AzureOpenAIEmbeddings",
) )
class AzureOpenAIEmbeddings(OpenAIEmbeddings): class AzureOpenAIEmbeddings(OpenAIEmbeddings):
"""`Azure OpenAI` Embeddings API.""" """`Azure OpenAI` Embeddings API."""

View File

@ -141,7 +141,7 @@ async def async_embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) ->
@deprecated( @deprecated(
since="0.1.0", since="0.1.0",
removal="0.2.0", removal="0.2.0",
alternative="langchain_openai.OpenAIEmbeddings", alternative_import="langchain_openai.OpenAIEmbeddings",
) )
class OpenAIEmbeddings(BaseModel, Embeddings): class OpenAIEmbeddings(BaseModel, Embeddings):
"""OpenAI embedding models. """OpenAI embedding models.

View File

@ -5,6 +5,7 @@ import threading
from concurrent.futures import ThreadPoolExecutor, wait from concurrent.futures import ThreadPoolExecutor, wait
from typing import Any, Dict, List, Literal, Optional, Tuple from typing import Any, Dict, List, Literal, Optional, Tuple
from langchain_core._api.deprecation import deprecated
from langchain_core.embeddings import Embeddings from langchain_core.embeddings import Embeddings
from langchain_core.language_models.llms import create_base_retry_decorator from langchain_core.language_models.llms import create_base_retry_decorator
from langchain_core.pydantic_v1 import root_validator from langchain_core.pydantic_v1 import root_validator
@ -19,6 +20,11 @@ _MAX_BATCH_SIZE = 250
_MIN_BATCH_SIZE = 5 _MIN_BATCH_SIZE = 5
@deprecated(
since="0.0.12",
removal="0.2.0",
alternative_import="langchain_google_vertexai.VertexAIEmbeddings",
)
class VertexAIEmbeddings(_VertexAICommon, Embeddings): class VertexAIEmbeddings(_VertexAICommon, Embeddings):
"""Google Cloud VertexAI embedding models.""" """Google Cloud VertexAI embedding models."""

View File

@ -59,7 +59,7 @@ def _strip_erroneous_leading_spaces(text: str) -> str:
return text return text
@deprecated("0.0.351", alternative="langchain_google_genai.GoogleGenerativeAI") @deprecated("0.0.351", alternative_import="langchain_google_genai.GoogleGenerativeAI")
class GooglePalm(BaseLLM, BaseModel): class GooglePalm(BaseLLM, BaseModel):
""" """
DEPRECATED: Use `langchain_google_genai.GoogleGenerativeAI` instead. DEPRECATED: Use `langchain_google_genai.GoogleGenerativeAI` instead.

View File

@ -726,16 +726,7 @@ class BaseOpenAI(BaseLLM):
@deprecated( @deprecated(
since="0.0.10", since="0.0.10", removal="0.2.0", alternative_import="langchain_openai.OpenAI"
removal="0.2.0",
message=(
"The class langchain_community.llms.openai.OpenAI was "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import OpenAI`."
),
) )
class OpenAI(BaseOpenAI): class OpenAI(BaseOpenAI):
"""OpenAI large language models. """OpenAI large language models.
@ -764,16 +755,7 @@ class OpenAI(BaseOpenAI):
@deprecated( @deprecated(
since="0.0.10", since="0.0.10", removal="0.2.0", alternative_import="langchain_openai.AzureOpenAI"
removal="0.2.0",
message=(
"The class langchain_community.llms.openai.AzureOpenAI was "
"deprecated in langchain-community 0.0.10 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import AzureOpenAI`."
),
) )
class AzureOpenAI(BaseOpenAI): class AzureOpenAI(BaseOpenAI):
"""Azure-specific OpenAI large language models. """Azure-specific OpenAI large language models.
@ -981,14 +963,7 @@ class AzureOpenAI(BaseOpenAI):
@deprecated( @deprecated(
since="0.0.1", since="0.0.1",
removal="0.2.0", removal="0.2.0",
message=( alternative_import="langchain_openai.ChatOpenAI",
"The class langchain_community.llms.openai.OpenAIChat was "
"deprecated in langchain-community 0.0.1 and will be removed in "
"langchain-community 0.2.0. An updated version of the class lives in the "
"langchain-openai package and should be used instead. To use it run "
"`pip install -U langchain-openai` and import as "
"`from langchain_openai import ChatOpenAI`."
),
) )
class OpenAIChat(BaseLLM): class OpenAIChat(BaseLLM):
"""OpenAI Chat large language models. """OpenAI Chat large language models.

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from concurrent.futures import Executor, ThreadPoolExecutor from concurrent.futures import Executor, ThreadPoolExecutor
from typing import TYPE_CHECKING, Any, ClassVar, Dict, Iterator, List, Optional, Union from typing import TYPE_CHECKING, Any, ClassVar, Dict, Iterator, List, Optional, Union
from langchain_core._api.deprecation import deprecated
from langchain_core.callbacks.manager import ( from langchain_core.callbacks.manager import (
AsyncCallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun,
CallbackManagerForLLMRun, CallbackManagerForLLMRun,
@ -200,6 +201,11 @@ class _VertexAICommon(_VertexAIBase):
return params return params
@deprecated(
since="0.0.12",
removal="0.2.0",
alternative_import="langchain_google_vertexai.VertexAI",
)
class VertexAI(_VertexAICommon, BaseLLM): class VertexAI(_VertexAICommon, BaseLLM):
"""Google Vertex AI large language models.""" """Google Vertex AI large language models."""
@ -385,6 +391,11 @@ class VertexAI(_VertexAICommon, BaseLLM):
) )
@deprecated(
since="0.0.12",
removal="0.2.0",
alternative_import="langchain_google_vertexai.VertexAIModelGarden",
)
class VertexAIModelGarden(_VertexAIBase, BaseLLM): class VertexAIModelGarden(_VertexAIBase, BaseLLM):
"""Large language models served from Vertex AI Model Garden.""" """Large language models served from Vertex AI Model Garden."""

View File

@ -3881,7 +3881,7 @@ files = [
[[package]] [[package]]
name = "langchain-core" name = "langchain-core"
version = "0.1.8" version = "0.1.9"
description = "Building applications with LLMs through composability" description = "Building applications with LLMs through composability"
optional = false optional = false
python-versions = ">=3.8.1,<4.0" python-versions = ">=3.8.1,<4.0"
@ -9144,4 +9144,4 @@ extended-testing = ["aiosqlite", "aleph-alpha-client", "anthropic", "arxiv", "as
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = ">=3.8.1,<4.0" python-versions = ">=3.8.1,<4.0"
content-hash = "a3765004062afc80420d49d782e3e023aec1707bf35ae2f808d88a1cac53b694" content-hash = "edadd024e8b2b4a817a90336013a1d92be102d03d4c41fbf5ac137f16d97fdfb"

View File

@ -9,7 +9,7 @@ repository = "https://github.com/langchain-ai/langchain"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.8.1,<4.0" python = ">=3.8.1,<4.0"
langchain-core = ">=0.1.8,<0.2" langchain-core = ">=0.1.9,<0.2"
SQLAlchemy = ">=1.4,<3" SQLAlchemy = ">=1.4,<3"
requests = "^2" requests = "^2"
PyYAML = ">=5.3" PyYAML = ">=5.3"