From 27690506d0b65a425d3fd9b73a0a77eec5520ad3 Mon Sep 17 00:00:00 2001 From: ccurme Date: Wed, 14 Aug 2024 09:50:39 -0400 Subject: [PATCH] multiple: update removal targets (#25361) --- libs/community/langchain_community/cache.py | 4 ++-- .../langchain_community/chat_loaders/gmail.py | 2 +- .../chat_message_histories/astradb.py | 2 +- .../chat_message_histories/mongodb.py | 2 +- .../chat_message_histories/sql.py | 4 ++-- .../chat_models/anthropic.py | 2 +- .../chat_models/azure_openai.py | 2 +- .../chat_models/bedrock.py | 2 +- .../langchain_community/chat_models/cohere.py | 2 +- .../chat_models/fireworks.py | 2 +- .../chat_models/huggingface.py | 2 +- .../langchain_community/chat_models/openai.py | 2 +- .../langchain_community/chat_models/solar.py | 2 +- .../chat_models/vertexai.py | 2 +- .../document_loaders/astradb.py | 2 +- .../document_loaders/bigquery.py | 2 +- .../document_loaders/docugami.py | 2 +- .../document_loaders/gcs_directory.py | 2 +- .../document_loaders/gcs_file.py | 2 +- .../document_loaders/google_speech_to_text.py | 2 +- .../document_loaders/googledrive.py | 2 +- .../document_loaders/parsers/docai.py | 2 +- .../document_loaders/unstructured.py | 8 ++++---- .../document_transformers/google_translate.py | 2 +- .../embeddings/azure_openai.py | 2 +- .../langchain_community/embeddings/bedrock.py | 2 +- .../langchain_community/embeddings/cohere.py | 2 +- .../embeddings/huggingface.py | 6 +++--- .../embeddings/huggingface_hub.py | 2 +- .../langchain_community/embeddings/openai.py | 2 +- .../langchain_community/embeddings/solar.py | 2 +- .../embeddings/vertexai.py | 2 +- .../embeddings/voyageai.py | 2 +- .../langchain_community/llms/__init__.py | 4 ++-- .../langchain_community/llms/anthropic.py | 2 +- .../langchain_community/llms/bedrock.py | 2 +- .../langchain_community/llms/cohere.py | 6 ++---- .../langchain_community/llms/fireworks.py | 2 +- .../llms/huggingface_endpoint.py | 2 +- .../llms/huggingface_hub.py | 2 +- .../llms/huggingface_pipeline.py | 2 +- .../llms/huggingface_text_gen_inference.py | 2 +- .../langchain_community/llms/openai.py | 8 +++----- .../langchain_community/llms/together.py | 2 +- .../langchain_community/llms/vertexai.py | 4 ++-- .../langchain_community/llms/watsonxllm.py | 2 +- .../retrievers/cohere_rag_retriever.py | 2 +- .../google_cloud_documentai_warehouse.py | 2 +- .../retrievers/google_vertex_ai_search.py | 4 ++-- .../langchain_community/storage/astradb.py | 4 ++-- .../tools/google_cloud/texttospeech.py | 2 +- .../tools/google_places/tool.py | 2 +- .../tools/google_search/tool.py | 4 ++-- .../tools/metaphor_search/tool.py | 2 +- .../utilities/google_places_api.py | 2 +- .../utilities/google_search.py | 2 +- .../utilities/sql_database.py | 2 +- .../vectorstores/astradb.py | 2 +- .../vectorstores/bigquery_vector_search.py | 2 +- .../vectorstores/chroma.py | 4 ++-- .../vectorstores/couchbase.py | 2 +- .../vectorstores/databricks_vector_search.py | 2 +- .../vectorstores/matching_engine.py | 2 +- .../vectorstores/milvus.py | 2 +- .../vectorstores/mongodb_atlas.py | 2 +- .../vectorstores/pinecone.py | 2 +- .../vectorstores/qdrant.py | 4 +--- .../langchain_core/language_models/base.py | 8 ++++---- .../language_models/chat_models.py | 14 ++++++------- .../langchain_core/language_models/llms.py | 10 +++++----- libs/core/langchain_core/retrievers.py | 4 ++-- libs/core/langchain_core/tools.py | 4 ++-- libs/core/langchain_core/tracers/schemas.py | 20 +++++++++---------- .../langchain_core/utils/function_calling.py | 10 +++++----- libs/core/langchain_core/utils/loading.py | 2 +- .../langchain_core/vectorstores/in_memory.py | 4 ++-- .../llms/anthropic_functions.py | 2 +- .../llms/ollama_functions.py | 2 +- .../langchain/langchain/_api/module_import.py | 4 ++-- libs/langchain/langchain/agents/agent.py | 4 ++-- .../langchain/langchain/agents/agent_types.py | 2 +- libs/langchain/langchain/agents/chat/base.py | 2 +- .../langchain/agents/conversational/base.py | 2 +- .../agents/conversational_chat/base.py | 2 +- libs/langchain/langchain/agents/initialize.py | 2 +- libs/langchain/langchain/agents/loading.py | 4 ++-- libs/langchain/langchain/agents/mrkl/base.py | 4 ++-- .../agents/openai_functions_agent/base.py | 2 +- .../openai_functions_multi_agent/base.py | 2 +- libs/langchain/langchain/agents/react/base.py | 8 ++++---- .../agents/self_ask_with_search/base.py | 4 ++-- .../langchain/agents/structured_chat/base.py | 2 +- libs/langchain/langchain/agents/xml/base.py | 2 +- libs/langchain/langchain/chains/base.py | 10 +++++----- .../chains/conversational_retrieval/base.py | 2 +- .../langchain/chains/openai_functions/base.py | 4 ++-- .../chains/openai_functions/extraction.py | 4 ++-- .../chains/openai_tools/extraction.py | 2 +- .../chains/structured_output/base.py | 4 ++-- .../document_compressors/cohere_rerank.py | 2 +- 100 files changed, 160 insertions(+), 166 deletions(-) diff --git a/libs/community/langchain_community/cache.py b/libs/community/langchain_community/cache.py index 48b5c035eba..0507ccc7f0f 100644 --- a/libs/community/langchain_community/cache.py +++ b/libs/community/langchain_community/cache.py @@ -1614,7 +1614,7 @@ ASTRA_DB_CACHE_DEFAULT_COLLECTION_NAME = "langchain_astradb_cache" @deprecated( since="0.0.28", - removal="0.3.0", + removal="1.0", alternative_import="langchain_astradb.AstraDBCache", ) class AstraDBCache(BaseCache): @@ -1819,7 +1819,7 @@ def _async_lru_cache(maxsize: int = 128, typed: bool = False) -> Callable: @deprecated( since="0.0.28", - removal="0.3.0", + removal="1.0", alternative_import="langchain_astradb.AstraDBSemanticCache", ) class AstraDBSemanticCache(BaseCache): diff --git a/libs/community/langchain_community/chat_loaders/gmail.py b/libs/community/langchain_community/chat_loaders/gmail.py index a1fac6ac889..03dff9c243f 100644 --- a/libs/community/langchain_community/chat_loaders/gmail.py +++ b/libs/community/langchain_community/chat_loaders/gmail.py @@ -65,7 +65,7 @@ def _get_message_data(service: Any, message: Any) -> ChatSession: @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GMailLoader", ) class GMailLoader(BaseChatLoader): diff --git a/libs/community/langchain_community/chat_message_histories/astradb.py b/libs/community/langchain_community/chat_message_histories/astradb.py index a74605135f4..f6433935673 100644 --- a/libs/community/langchain_community/chat_message_histories/astradb.py +++ b/libs/community/langchain_community/chat_message_histories/astradb.py @@ -27,7 +27,7 @@ DEFAULT_COLLECTION_NAME = "langchain_message_store" @deprecated( since="0.0.25", - removal="0.3.0", + removal="1.0", alternative_import="langchain_astradb.AstraDBChatMessageHistory", ) class AstraDBChatMessageHistory(BaseChatMessageHistory): diff --git a/libs/community/langchain_community/chat_message_histories/mongodb.py b/libs/community/langchain_community/chat_message_histories/mongodb.py index f93ee5c1306..b6d4a78a046 100644 --- a/libs/community/langchain_community/chat_message_histories/mongodb.py +++ b/libs/community/langchain_community/chat_message_histories/mongodb.py @@ -18,7 +18,7 @@ DEFAULT_COLLECTION_NAME = "message_store" @deprecated( since="0.0.25", - removal="0.3.0", + removal="1.0", alternative_import="langchain_mongodb.MongoDBChatMessageHistory", ) class MongoDBChatMessageHistory(BaseChatMessageHistory): diff --git a/libs/community/langchain_community/chat_message_histories/sql.py b/libs/community/langchain_community/chat_message_histories/sql.py index de948afaf9b..2c3b2351c47 100644 --- a/libs/community/langchain_community/chat_message_histories/sql.py +++ b/libs/community/langchain_community/chat_message_histories/sql.py @@ -147,7 +147,7 @@ class SQLChatMessageHistory(BaseChatMessageHistory): """ @property - @deprecated("0.2.2", removal="0.3.0", alternative="session_maker") + @deprecated("0.2.2", removal="1.0", alternative="session_maker") def Session(self) -> Union[scoped_session, async_sessionmaker]: return self.session_maker @@ -185,7 +185,7 @@ class SQLChatMessageHistory(BaseChatMessageHistory): if not _warned_once_already: warn_deprecated( since="0.2.2", - removal="0.3.0", + removal="1.0", name="connection_string", alternative="connection", ) diff --git a/libs/community/langchain_community/chat_models/anthropic.py b/libs/community/langchain_community/chat_models/anthropic.py index 643572ec959..7ee675e6bac 100644 --- a/libs/community/langchain_community/chat_models/anthropic.py +++ b/libs/community/langchain_community/chat_models/anthropic.py @@ -73,7 +73,7 @@ def convert_messages_to_prompt_anthropic( @deprecated( since="0.0.28", - removal="0.3", + removal="1.0", alternative_import="langchain_anthropic.ChatAnthropic", ) class ChatAnthropic(BaseChatModel, _AnthropicCommon): diff --git a/libs/community/langchain_community/chat_models/azure_openai.py b/libs/community/langchain_community/chat_models/azure_openai.py index e53112583a6..28e27876613 100644 --- a/libs/community/langchain_community/chat_models/azure_openai.py +++ b/libs/community/langchain_community/chat_models/azure_openai.py @@ -20,7 +20,7 @@ logger = logging.getLogger(__name__) @deprecated( since="0.0.10", - removal="0.3.0", + removal="1.0", alternative_import="langchain_openai.AzureChatOpenAI", ) class AzureChatOpenAI(ChatOpenAI): diff --git a/libs/community/langchain_community/chat_models/bedrock.py b/libs/community/langchain_community/chat_models/bedrock.py index 961451565a6..db326d520f1 100644 --- a/libs/community/langchain_community/chat_models/bedrock.py +++ b/libs/community/langchain_community/chat_models/bedrock.py @@ -202,7 +202,7 @@ _message_type_lookups = { @deprecated( - since="0.0.34", removal="0.3", alternative_import="langchain_aws.ChatBedrock" + since="0.0.34", removal="1.0", alternative_import="langchain_aws.ChatBedrock" ) class BedrockChat(BaseChatModel, BedrockBase): """Chat model that uses the Bedrock API.""" diff --git a/libs/community/langchain_community/chat_models/cohere.py b/libs/community/langchain_community/chat_models/cohere.py index e591f79ac43..857cd39dbad 100644 --- a/libs/community/langchain_community/chat_models/cohere.py +++ b/libs/community/langchain_community/chat_models/cohere.py @@ -96,7 +96,7 @@ def get_cohere_chat_request( @deprecated( - since="0.0.30", removal="0.3.0", alternative_import="langchain_cohere.ChatCohere" + since="0.0.30", removal="1.0", alternative_import="langchain_cohere.ChatCohere" ) class ChatCohere(BaseChatModel, BaseCohere): """`Cohere` chat large language models. diff --git a/libs/community/langchain_community/chat_models/fireworks.py b/libs/community/langchain_community/chat_models/fireworks.py index 3147d469fcc..e3a5ac0e12d 100644 --- a/libs/community/langchain_community/chat_models/fireworks.py +++ b/libs/community/langchain_community/chat_models/fireworks.py @@ -81,7 +81,7 @@ def convert_dict_to_message(_dict: Any) -> BaseMessage: @deprecated( since="0.0.26", - removal="0.3", + removal="1.0", alternative_import="langchain_fireworks.ChatFireworks", ) class ChatFireworks(BaseChatModel): diff --git a/libs/community/langchain_community/chat_models/huggingface.py b/libs/community/langchain_community/chat_models/huggingface.py index eb22b9ea4b7..b5d3f905a24 100644 --- a/libs/community/langchain_community/chat_models/huggingface.py +++ b/libs/community/langchain_community/chat_models/huggingface.py @@ -38,7 +38,7 @@ DEFAULT_SYSTEM_PROMPT = """You are a helpful, respectful, and honest assistant." @deprecated( since="0.0.37", - removal="0.3", + removal="1.0", alternative_import="langchain_huggingface.ChatHuggingFace", ) class ChatHuggingFace(BaseChatModel): diff --git a/libs/community/langchain_community/chat_models/openai.py b/libs/community/langchain_community/chat_models/openai.py index 785df401753..a8d197d3be1 100644 --- a/libs/community/langchain_community/chat_models/openai.py +++ b/libs/community/langchain_community/chat_models/openai.py @@ -147,7 +147,7 @@ def _convert_delta_to_message_chunk( @deprecated( - since="0.0.10", removal="0.3.0", alternative_import="langchain_openai.ChatOpenAI" + since="0.0.10", removal="1.0", alternative_import="langchain_openai.ChatOpenAI" ) class ChatOpenAI(BaseChatModel): """`OpenAI` Chat large language models API. diff --git a/libs/community/langchain_community/chat_models/solar.py b/libs/community/langchain_community/chat_models/solar.py index 763d393a7a6..d8a3cb04c89 100644 --- a/libs/community/langchain_community/chat_models/solar.py +++ b/libs/community/langchain_community/chat_models/solar.py @@ -11,7 +11,7 @@ from langchain_community.llms.solar import SOLAR_SERVICE_URL_BASE, SolarCommon @deprecated( # type: ignore[arg-type] - since="0.0.34", removal="0.3.0", alternative_import="langchain_upstage.ChatUpstage" + since="0.0.34", removal="1.0", alternative_import="langchain_upstage.ChatUpstage" ) class SolarChat(SolarCommon, ChatOpenAI): """Wrapper around Solar large language models. diff --git a/libs/community/langchain_community/chat_models/vertexai.py b/libs/community/langchain_community/chat_models/vertexai.py index db038f615c1..eeb638e2dc0 100644 --- a/libs/community/langchain_community/chat_models/vertexai.py +++ b/libs/community/langchain_community/chat_models/vertexai.py @@ -206,7 +206,7 @@ def _get_question(messages: List[BaseMessage]) -> HumanMessage: @deprecated( since="0.0.12", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_vertexai.ChatVertexAI", ) class ChatVertexAI(_VertexAICommon, BaseChatModel): diff --git a/libs/community/langchain_community/document_loaders/astradb.py b/libs/community/langchain_community/document_loaders/astradb.py index a0b4cfe2e7d..18a351d33f5 100644 --- a/libs/community/langchain_community/document_loaders/astradb.py +++ b/libs/community/langchain_community/document_loaders/astradb.py @@ -27,7 +27,7 @@ logger = logging.getLogger(__name__) @deprecated( since="0.0.29", - removal="0.3.0", + removal="1.0", alternative_import="langchain_astradb.AstraDBLoader", ) class AstraDBLoader(BaseLoader): diff --git a/libs/community/langchain_community/document_loaders/bigquery.py b/libs/community/langchain_community/document_loaders/bigquery.py index 770a7c6dc4c..25ce99b3c38 100644 --- a/libs/community/langchain_community/document_loaders/bigquery.py +++ b/libs/community/langchain_community/document_loaders/bigquery.py @@ -14,7 +14,7 @@ if TYPE_CHECKING: @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.BigQueryLoader", ) class BigQueryLoader(BaseLoader): diff --git a/libs/community/langchain_community/document_loaders/docugami.py b/libs/community/langchain_community/document_loaders/docugami.py index c1bdd78965f..c3463a009bb 100644 --- a/libs/community/langchain_community/document_loaders/docugami.py +++ b/libs/community/langchain_community/document_loaders/docugami.py @@ -29,7 +29,7 @@ logger = logging.getLogger(__name__) @deprecated( since="0.0.24", - removal="0.3.0", + removal="1.0", alternative_import="docugami_langchain.DocugamiLoader", ) class DocugamiLoader(BaseLoader, BaseModel): diff --git a/libs/community/langchain_community/document_loaders/gcs_directory.py b/libs/community/langchain_community/document_loaders/gcs_directory.py index aa28ab73151..bc736c3e974 100644 --- a/libs/community/langchain_community/document_loaders/gcs_directory.py +++ b/libs/community/langchain_community/document_loaders/gcs_directory.py @@ -13,7 +13,7 @@ logger = logging.getLogger(__name__) @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GCSDirectoryLoader", ) class GCSDirectoryLoader(BaseLoader): diff --git a/libs/community/langchain_community/document_loaders/gcs_file.py b/libs/community/langchain_community/document_loaders/gcs_file.py index 7e112cc7ddd..52a476a2083 100644 --- a/libs/community/langchain_community/document_loaders/gcs_file.py +++ b/libs/community/langchain_community/document_loaders/gcs_file.py @@ -12,7 +12,7 @@ from langchain_community.utilities.vertexai import get_client_info @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GCSFileLoader", ) class GCSFileLoader(BaseLoader): 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 28acc9d8927..7ed087b8497 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 @@ -15,7 +15,7 @@ if TYPE_CHECKING: @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.SpeechToTextLoader", ) class GoogleSpeechToTextLoader(BaseLoader): diff --git a/libs/community/langchain_community/document_loaders/googledrive.py b/libs/community/langchain_community/document_loaders/googledrive.py index e1b300718f9..5646950a790 100644 --- a/libs/community/langchain_community/document_loaders/googledrive.py +++ b/libs/community/langchain_community/document_loaders/googledrive.py @@ -21,7 +21,7 @@ SCOPES = ["https://www.googleapis.com/auth/drive.readonly"] @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GoogleDriveLoader", ) class GoogleDriveLoader(BaseLoader, BaseModel): diff --git a/libs/community/langchain_community/document_loaders/parsers/docai.py b/libs/community/langchain_community/document_loaders/parsers/docai.py index 724aef54f83..517ea0140aa 100644 --- a/libs/community/langchain_community/document_loaders/parsers/docai.py +++ b/libs/community/langchain_community/document_loaders/parsers/docai.py @@ -37,7 +37,7 @@ class DocAIParsingResults: @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.DocAIParser", ) class DocAIParser(BaseBlobParser): diff --git a/libs/community/langchain_community/document_loaders/unstructured.py b/libs/community/langchain_community/document_loaders/unstructured.py index 2b596a6aaf8..edf52a70855 100644 --- a/libs/community/langchain_community/document_loaders/unstructured.py +++ b/libs/community/langchain_community/document_loaders/unstructured.py @@ -168,7 +168,7 @@ class UnstructuredBaseLoader(BaseLoader, ABC): @deprecated( since="0.2.8", - removal="0.4.0", + removal="1.0", alternative_import="langchain_unstructured.UnstructuredLoader", ) class UnstructuredFileLoader(UnstructuredBaseLoader): @@ -269,7 +269,7 @@ def get_elements_from_api( @deprecated( since="0.2.8", - removal="0.4.0", + removal="1.0", alternative_import="langchain_unstructured.UnstructuredLoader", ) class UnstructuredAPIFileLoader(UnstructuredBaseLoader): @@ -351,7 +351,7 @@ class UnstructuredAPIFileLoader(UnstructuredBaseLoader): @deprecated( since="0.2.8", - removal="0.4.0", + removal="1.0", alternative_import="langchain_unstructured.UnstructuredLoader", ) class UnstructuredFileIOLoader(UnstructuredBaseLoader): @@ -418,7 +418,7 @@ class UnstructuredFileIOLoader(UnstructuredBaseLoader): @deprecated( since="0.2.8", - removal="0.4.0", + removal="1.0", alternative_import="langchain_unstructured.UnstructuredLoader", ) class UnstructuredAPIFileIOLoader(UnstructuredBaseLoader): diff --git a/libs/community/langchain_community/document_transformers/google_translate.py b/libs/community/langchain_community/document_transformers/google_translate.py index 21fd27911d6..613ab0bdfc1 100644 --- a/libs/community/langchain_community/document_transformers/google_translate.py +++ b/libs/community/langchain_community/document_transformers/google_translate.py @@ -8,7 +8,7 @@ from langchain_community.utilities.vertexai import get_client_info @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.DocAIParser", ) class GoogleTranslateTransformer(BaseDocumentTransformer): diff --git a/libs/community/langchain_community/embeddings/azure_openai.py b/libs/community/langchain_community/embeddings/azure_openai.py index 489a81b9394..61aee8a8668 100644 --- a/libs/community/langchain_community/embeddings/azure_openai.py +++ b/libs/community/langchain_community/embeddings/azure_openai.py @@ -16,7 +16,7 @@ from langchain_community.utils.openai import is_openai_v1 @deprecated( since="0.0.9", - removal="0.3.0", + removal="1.0", alternative_import="langchain_openai.AzureOpenAIEmbeddings", ) class AzureOpenAIEmbeddings(OpenAIEmbeddings): diff --git a/libs/community/langchain_community/embeddings/bedrock.py b/libs/community/langchain_community/embeddings/bedrock.py index 64e9b23d710..70d4f411914 100644 --- a/libs/community/langchain_community/embeddings/bedrock.py +++ b/libs/community/langchain_community/embeddings/bedrock.py @@ -12,7 +12,7 @@ from langchain_core.runnables.config import run_in_executor @deprecated( since="0.2.11", - removal="0.4.0", + removal="1.0", alternative_import="langchain_aws.BedrockEmbeddings", ) class BedrockEmbeddings(BaseModel, Embeddings): diff --git a/libs/community/langchain_community/embeddings/cohere.py b/libs/community/langchain_community/embeddings/cohere.py index f32ea975f65..8c3ea9e1018 100644 --- a/libs/community/langchain_community/embeddings/cohere.py +++ b/libs/community/langchain_community/embeddings/cohere.py @@ -10,7 +10,7 @@ from langchain_community.llms.cohere import _create_retry_decorator @deprecated( since="0.0.30", - removal="0.3.0", + removal="1.0", alternative_import="langchain_cohere.CohereEmbeddings", ) class CohereEmbeddings(BaseModel, Embeddings): diff --git a/libs/community/langchain_community/embeddings/huggingface.py b/libs/community/langchain_community/embeddings/huggingface.py index 188232b0c45..2304d28a3c9 100644 --- a/libs/community/langchain_community/embeddings/huggingface.py +++ b/libs/community/langchain_community/embeddings/huggingface.py @@ -21,7 +21,7 @@ DEFAULT_QUERY_BGE_INSTRUCTION_ZH = "为这个句子生成表示以用于检索 @deprecated( since="0.2.2", - removal="0.3.0", + removal="1.0", alternative_import="langchain_huggingface.HuggingFaceEmbeddings", ) class HuggingFaceEmbeddings(BaseModel, Embeddings): @@ -171,7 +171,7 @@ class HuggingFaceInstructEmbeddings(BaseModel, Embeddings): if "show_progress_bar" in self.encode_kwargs: warn_deprecated( since="0.2.5", - removal="0.4.0", + removal="1.0", name="encode_kwargs['show_progress_bar']", alternative=f"the show_progress method on {self.__class__.__name__}", ) @@ -298,7 +298,7 @@ class HuggingFaceBgeEmbeddings(BaseModel, Embeddings): if "show_progress_bar" in self.encode_kwargs: warn_deprecated( since="0.2.5", - removal="0.4.0", + removal="1.0", name="encode_kwargs['show_progress_bar']", alternative=f"the show_progress method on {self.__class__.__name__}", ) diff --git a/libs/community/langchain_community/embeddings/huggingface_hub.py b/libs/community/langchain_community/embeddings/huggingface_hub.py index 417207e776b..6b688913b9b 100644 --- a/libs/community/langchain_community/embeddings/huggingface_hub.py +++ b/libs/community/langchain_community/embeddings/huggingface_hub.py @@ -12,7 +12,7 @@ VALID_TASKS = ("feature-extraction",) @deprecated( since="0.2.2", - removal="0.3.0", + removal="1.0", alternative_import="langchain_huggingface.HuggingFaceEndpointEmbeddings", ) class HuggingFaceHubEmbeddings(BaseModel, Embeddings): diff --git a/libs/community/langchain_community/embeddings/openai.py b/libs/community/langchain_community/embeddings/openai.py index b5862ba40c4..09936de8057 100644 --- a/libs/community/langchain_community/embeddings/openai.py +++ b/libs/community/langchain_community/embeddings/openai.py @@ -144,7 +144,7 @@ async def async_embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) -> @deprecated( since="0.0.9", - removal="0.3.0", + removal="1.0", alternative_import="langchain_openai.OpenAIEmbeddings", ) class OpenAIEmbeddings(BaseModel, Embeddings): diff --git a/libs/community/langchain_community/embeddings/solar.py b/libs/community/langchain_community/embeddings/solar.py index 8b617002dca..e441b0cea17 100644 --- a/libs/community/langchain_community/embeddings/solar.py +++ b/libs/community/langchain_community/embeddings/solar.py @@ -46,7 +46,7 @@ def embed_with_retry(embeddings: SolarEmbeddings, *args: Any, **kwargs: Any) -> @deprecated( - since="0.0.34", removal="0.3.0", alternative_import="langchain_upstage.ChatUpstage" + since="0.0.34", removal="1.0", alternative_import="langchain_upstage.ChatUpstage" ) class SolarEmbeddings(BaseModel, Embeddings): """Solar's embedding service. diff --git a/libs/community/langchain_community/embeddings/vertexai.py b/libs/community/langchain_community/embeddings/vertexai.py index c1b38c9ab8f..5cf409e53cb 100644 --- a/libs/community/langchain_community/embeddings/vertexai.py +++ b/libs/community/langchain_community/embeddings/vertexai.py @@ -22,7 +22,7 @@ _MIN_BATCH_SIZE = 5 @deprecated( since="0.0.12", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_vertexai.VertexAIEmbeddings", ) class VertexAIEmbeddings(_VertexAICommon, Embeddings): diff --git a/libs/community/langchain_community/embeddings/voyageai.py b/libs/community/langchain_community/embeddings/voyageai.py index 0c902e67ada..e9c24b666ab 100644 --- a/libs/community/langchain_community/embeddings/voyageai.py +++ b/libs/community/langchain_community/embeddings/voyageai.py @@ -61,7 +61,7 @@ def embed_with_retry(embeddings: VoyageEmbeddings, **kwargs: Any) -> Any: @deprecated( since="0.0.29", - removal="0.3", + removal="1.0", alternative_import="langchain_voyageai.VoyageAIEmbeddings", ) class VoyageEmbeddings(BaseModel, Embeddings): diff --git a/libs/community/langchain_community/llms/__init__.py b/libs/community/langchain_community/llms/__init__.py index 74fed97af65..a82ab6a8cea 100644 --- a/libs/community/langchain_community/llms/__init__.py +++ b/libs/community/langchain_community/llms/__init__.py @@ -172,7 +172,7 @@ def _import_databricks() -> Type[BaseLLM]: def _import_databricks_chat() -> Any: warn_deprecated( since="0.0.22", - removal="0.3", + removal="1.0", alternative_import="langchain_community.chat_models.ChatDatabricks", ) from langchain_community.chat_models.databricks import ChatDatabricks @@ -342,7 +342,7 @@ def _import_mlflow() -> Type[BaseLLM]: def _import_mlflow_chat() -> Any: warn_deprecated( since="0.0.22", - removal="0.3", + removal="1.0", alternative_import="langchain_community.chat_models.ChatMlflow", ) from langchain_community.chat_models.mlflow import ChatMlflow diff --git a/libs/community/langchain_community/llms/anthropic.py b/libs/community/langchain_community/llms/anthropic.py index 3c1ec479c73..f6b977ab455 100644 --- a/libs/community/langchain_community/llms/anthropic.py +++ b/libs/community/langchain_community/llms/anthropic.py @@ -151,7 +151,7 @@ class _AnthropicCommon(BaseLanguageModel): @deprecated( since="0.0.28", - removal="0.3", + removal="1.0", alternative_import="langchain_anthropic.AnthropicLLM", ) class Anthropic(LLM, _AnthropicCommon): diff --git a/libs/community/langchain_community/llms/bedrock.py b/libs/community/langchain_community/llms/bedrock.py index 78e880dc22b..d47a762973b 100644 --- a/libs/community/langchain_community/llms/bedrock.py +++ b/libs/community/langchain_community/llms/bedrock.py @@ -713,7 +713,7 @@ class BedrockBase(BaseModel, ABC): @deprecated( - since="0.0.34", removal="0.3", alternative_import="langchain_aws.BedrockLLM" + since="0.0.34", removal="1.0", alternative_import="langchain_aws.BedrockLLM" ) class Bedrock(LLM, BedrockBase): """Bedrock models. diff --git a/libs/community/langchain_community/llms/cohere.py b/libs/community/langchain_community/llms/cohere.py index 37a06207083..9d075b25a45 100644 --- a/libs/community/langchain_community/llms/cohere.py +++ b/libs/community/langchain_community/llms/cohere.py @@ -71,7 +71,7 @@ def acompletion_with_retry(llm: Cohere, **kwargs: Any) -> Any: @deprecated( - since="0.0.30", removal="0.3.0", alternative_import="langchain_cohere.BaseCohere" + since="0.0.30", removal="1.0", alternative_import="langchain_cohere.BaseCohere" ) class BaseCohere(Serializable): """Base class for Cohere models.""" @@ -121,9 +121,7 @@ class BaseCohere(Serializable): return values -@deprecated( - since="0.1.14", removal="0.3.0", alternative_import="langchain_cohere.Cohere" -) +@deprecated(since="0.1.14", removal="1.0", alternative_import="langchain_cohere.Cohere") class Cohere(LLM, BaseCohere): """Cohere large language models. diff --git a/libs/community/langchain_community/llms/fireworks.py b/libs/community/langchain_community/llms/fireworks.py index a8f55c2012f..73948062e6c 100644 --- a/libs/community/langchain_community/llms/fireworks.py +++ b/libs/community/langchain_community/llms/fireworks.py @@ -29,7 +29,7 @@ def _stream_response_to_generation_chunk( @deprecated( since="0.0.26", - removal="0.3", + removal="1.0", alternative_import="langchain_fireworks.Fireworks", ) class Fireworks(BaseLLM): diff --git a/libs/community/langchain_community/llms/huggingface_endpoint.py b/libs/community/langchain_community/llms/huggingface_endpoint.py index d78c0ead883..27c1adce07f 100644 --- a/libs/community/langchain_community/llms/huggingface_endpoint.py +++ b/libs/community/langchain_community/llms/huggingface_endpoint.py @@ -28,7 +28,7 @@ VALID_TASKS = ( @deprecated( since="0.0.37", - removal="0.3", + removal="1.0", alternative_import="langchain_huggingface.HuggingFaceEndpoint", ) class HuggingFaceEndpoint(LLM): diff --git a/libs/community/langchain_community/llms/huggingface_hub.py b/libs/community/langchain_community/llms/huggingface_hub.py index 48edbbc5725..9c207c491f3 100644 --- a/libs/community/langchain_community/llms/huggingface_hub.py +++ b/libs/community/langchain_community/llms/huggingface_hub.py @@ -21,7 +21,7 @@ VALID_TASKS_DICT = { @deprecated( "0.0.21", - removal="0.3.0", + removal="1.0", alternative_import="langchain_huggingface.HuggingFaceEndpoint", ) class HuggingFaceHub(LLM): diff --git a/libs/community/langchain_community/llms/huggingface_pipeline.py b/libs/community/langchain_community/llms/huggingface_pipeline.py index aba008aef14..a1989702b0e 100644 --- a/libs/community/langchain_community/llms/huggingface_pipeline.py +++ b/libs/community/langchain_community/llms/huggingface_pipeline.py @@ -24,7 +24,7 @@ logger = logging.getLogger(__name__) @deprecated( since="0.0.37", - removal="0.3", + removal="1.0", alternative_import="langchain_huggingface.HuggingFacePipeline", ) class HuggingFacePipeline(BaseLLM): diff --git a/libs/community/langchain_community/llms/huggingface_text_gen_inference.py b/libs/community/langchain_community/llms/huggingface_text_gen_inference.py index f90e6eadbfa..56bcf69166e 100644 --- a/libs/community/langchain_community/llms/huggingface_text_gen_inference.py +++ b/libs/community/langchain_community/llms/huggingface_text_gen_inference.py @@ -16,7 +16,7 @@ logger = logging.getLogger(__name__) @deprecated( "0.0.21", - removal="0.3.0", + removal="1.0", alternative_import="langchain_huggingface.HuggingFaceEndpoint", ) class HuggingFaceTextGenInference(LLM): diff --git a/libs/community/langchain_community/llms/openai.py b/libs/community/langchain_community/llms/openai.py index 6a9cd5d9e45..c912f8e4150 100644 --- a/libs/community/langchain_community/llms/openai.py +++ b/libs/community/langchain_community/llms/openai.py @@ -730,9 +730,7 @@ class BaseOpenAI(BaseLLM): return self.max_context_size - num_tokens -@deprecated( - since="0.0.10", removal="0.3.0", alternative_import="langchain_openai.OpenAI" -) +@deprecated(since="0.0.10", removal="1.0", alternative_import="langchain_openai.OpenAI") class OpenAI(BaseOpenAI): """OpenAI large language models. @@ -760,7 +758,7 @@ class OpenAI(BaseOpenAI): @deprecated( - since="0.0.10", removal="0.3.0", alternative_import="langchain_openai.AzureOpenAI" + since="0.0.10", removal="1.0", alternative_import="langchain_openai.AzureOpenAI" ) class AzureOpenAI(BaseOpenAI): """Azure-specific OpenAI large language models. @@ -968,7 +966,7 @@ class AzureOpenAI(BaseOpenAI): @deprecated( since="0.0.1", - removal="0.3.0", + removal="1.0", alternative_import="langchain_openai.ChatOpenAI", ) class OpenAIChat(BaseLLM): diff --git a/libs/community/langchain_community/llms/together.py b/libs/community/langchain_community/llms/together.py index 691b9c9576e..a0729c3723a 100644 --- a/libs/community/langchain_community/llms/together.py +++ b/libs/community/langchain_community/llms/together.py @@ -19,7 +19,7 @@ logger = logging.getLogger(__name__) @deprecated( - since="0.0.12", removal="0.3", alternative_import="langchain_together.Together" + since="0.0.12", removal="1.0", alternative_import="langchain_together.Together" ) class Together(LLM): """LLM models from `Together`. diff --git a/libs/community/langchain_community/llms/vertexai.py b/libs/community/langchain_community/llms/vertexai.py index 42572f3ac19..19409c004de 100644 --- a/libs/community/langchain_community/llms/vertexai.py +++ b/libs/community/langchain_community/llms/vertexai.py @@ -203,7 +203,7 @@ class _VertexAICommon(_VertexAIBase): @deprecated( since="0.0.12", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_vertexai.VertexAI", ) class VertexAI(_VertexAICommon, BaseLLM): @@ -393,7 +393,7 @@ class VertexAI(_VertexAICommon, BaseLLM): @deprecated( since="0.0.12", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_vertexai.VertexAIModelGarden", ) class VertexAIModelGarden(_VertexAIBase, BaseLLM): diff --git a/libs/community/langchain_community/llms/watsonxllm.py b/libs/community/langchain_community/llms/watsonxllm.py index 84aaf4cb6cb..2e910b23323 100644 --- a/libs/community/langchain_community/llms/watsonxllm.py +++ b/libs/community/langchain_community/llms/watsonxllm.py @@ -13,7 +13,7 @@ logger = logging.getLogger(__name__) @deprecated( - since="0.0.18", removal="0.3", alternative_import="langchain_ibm.WatsonxLLM" + since="0.0.18", removal="1.0", alternative_import="langchain_ibm.WatsonxLLM" ) class WatsonxLLM(BaseLLM): """ diff --git a/libs/community/langchain_community/retrievers/cohere_rag_retriever.py b/libs/community/langchain_community/retrievers/cohere_rag_retriever.py index 670514c44f1..dd0f8d21872 100644 --- a/libs/community/langchain_community/retrievers/cohere_rag_retriever.py +++ b/libs/community/langchain_community/retrievers/cohere_rag_retriever.py @@ -43,7 +43,7 @@ def _get_docs(response: Any) -> List[Document]: @deprecated( since="0.0.30", - removal="0.3.0", + removal="1.0", alternative_import="langchain_cohere.CohereRagRetriever", ) class CohereRagRetriever(BaseRetriever): 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 d4722775013..869602229ed 100644 --- a/libs/community/langchain_community/retrievers/google_cloud_documentai_warehouse.py +++ b/libs/community/langchain_community/retrievers/google_cloud_documentai_warehouse.py @@ -23,7 +23,7 @@ if TYPE_CHECKING: @deprecated( since="0.0.32", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.DocumentAIWarehouseRetriever", ) class GoogleDocumentAIWarehouseRetriever(BaseRetriever): diff --git a/libs/community/langchain_community/retrievers/google_vertex_ai_search.py b/libs/community/langchain_community/retrievers/google_vertex_ai_search.py index d7f102799fd..6b836389a77 100644 --- a/libs/community/langchain_community/retrievers/google_vertex_ai_search.py +++ b/libs/community/langchain_community/retrievers/google_vertex_ai_search.py @@ -198,7 +198,7 @@ class _BaseGoogleVertexAISearchRetriever(BaseModel): @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.VertexAISearchRetriever", ) class GoogleVertexAISearchRetriever(BaseRetriever, _BaseGoogleVertexAISearchRetriever): @@ -396,7 +396,7 @@ class GoogleVertexAISearchRetriever(BaseRetriever, _BaseGoogleVertexAISearchRetr @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.VertexAIMultiTurnSearchRetriever", ) class GoogleVertexAIMultiTurnSearchRetriever( diff --git a/libs/community/langchain_community/storage/astradb.py b/libs/community/langchain_community/storage/astradb.py index a8808c48edc..8ed1246a074 100644 --- a/libs/community/langchain_community/storage/astradb.py +++ b/libs/community/langchain_community/storage/astradb.py @@ -99,7 +99,7 @@ class AstraDBBaseStore(Generic[V], BaseStore[str, V], ABC): @deprecated( since="0.0.22", - removal="0.3.0", + removal="1.0", alternative_import="langchain_astradb.AstraDBStore", ) class AstraDBStore(AstraDBBaseStore[Any]): @@ -167,7 +167,7 @@ class AstraDBStore(AstraDBBaseStore[Any]): @deprecated( since="0.0.22", - removal="0.3.0", + removal="1.0", alternative_import="langchain_astradb.AstraDBByteStore", ) class AstraDBByteStore(AstraDBBaseStore[bytes], ByteStore): diff --git a/libs/community/langchain_community/tools/google_cloud/texttospeech.py b/libs/community/langchain_community/tools/google_cloud/texttospeech.py index 6d637f4d637..02a24e9cf1a 100644 --- a/libs/community/langchain_community/tools/google_cloud/texttospeech.py +++ b/libs/community/langchain_community/tools/google_cloud/texttospeech.py @@ -39,7 +39,7 @@ def _encoding_file_extension_map(encoding: texttospeech.AudioEncoding) -> Option @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.TextToSpeechTool", ) class GoogleCloudTextToSpeechTool(BaseTool): diff --git a/libs/community/langchain_community/tools/google_places/tool.py b/libs/community/langchain_community/tools/google_places/tool.py index 5c7eb3dcf5a..de33e0196a1 100644 --- a/libs/community/langchain_community/tools/google_places/tool.py +++ b/libs/community/langchain_community/tools/google_places/tool.py @@ -18,7 +18,7 @@ class GooglePlacesSchema(BaseModel): @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GooglePlacesTool", ) class GooglePlacesTool(BaseTool): diff --git a/libs/community/langchain_community/tools/google_search/tool.py b/libs/community/langchain_community/tools/google_search/tool.py index 9afc24c9e14..3ba05079df8 100644 --- a/libs/community/langchain_community/tools/google_search/tool.py +++ b/libs/community/langchain_community/tools/google_search/tool.py @@ -11,7 +11,7 @@ from langchain_community.utilities.google_search import GoogleSearchAPIWrapper @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GoogleSearchRun", ) class GoogleSearchRun(BaseTool): @@ -36,7 +36,7 @@ class GoogleSearchRun(BaseTool): @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GoogleSearchResults", ) class GoogleSearchResults(BaseTool): diff --git a/libs/community/langchain_community/tools/metaphor_search/tool.py b/libs/community/langchain_community/tools/metaphor_search/tool.py index eac2bddc71c..98e932e8d2f 100644 --- a/libs/community/langchain_community/tools/metaphor_search/tool.py +++ b/libs/community/langchain_community/tools/metaphor_search/tool.py @@ -14,7 +14,7 @@ from langchain_community.utilities.metaphor_search import MetaphorSearchAPIWrapp @deprecated( since="0.0.15", - removal="0.3.0", + removal="1.0", alternative="langchain_exa.ExaSearchResults", ) class MetaphorSearchResults(BaseTool): diff --git a/libs/community/langchain_community/utilities/google_places_api.py b/libs/community/langchain_community/utilities/google_places_api.py index 0c68540e098..5143aeb9e60 100644 --- a/libs/community/langchain_community/utilities/google_places_api.py +++ b/libs/community/langchain_community/utilities/google_places_api.py @@ -10,7 +10,7 @@ from langchain_core.utils import get_from_dict_or_env @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GooglePlacesAPIWrapper", ) class GooglePlacesAPIWrapper(BaseModel): diff --git a/libs/community/langchain_community/utilities/google_search.py b/libs/community/langchain_community/utilities/google_search.py index 37f0fb52777..997df2f9acf 100644 --- a/libs/community/langchain_community/utilities/google_search.py +++ b/libs/community/langchain_community/utilities/google_search.py @@ -9,7 +9,7 @@ from langchain_core.utils import get_from_dict_or_env @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.GoogleSearchAPIWrapper", ) class GoogleSearchAPIWrapper(BaseModel): diff --git a/libs/community/langchain_community/utilities/sql_database.py b/libs/community/langchain_community/utilities/sql_database.py index fb3e4c39f79..85f0a107677 100644 --- a/libs/community/langchain_community/utilities/sql_database.py +++ b/libs/community/langchain_community/utilities/sql_database.py @@ -287,7 +287,7 @@ class SQLDatabase: return sorted(self._include_tables) return sorted(self._all_tables - self._ignore_tables) - @deprecated("0.0.1", alternative="get_usable_table_names", removal="0.3.0") + @deprecated("0.0.1", alternative="get_usable_table_names", removal="1.0") def get_table_names(self) -> Iterable[str]: """Get names of tables available.""" return self.get_usable_table_names() diff --git a/libs/community/langchain_community/vectorstores/astradb.py b/libs/community/langchain_community/vectorstores/astradb.py index 54c619c7ebb..ad6f1d358af 100644 --- a/libs/community/langchain_community/vectorstores/astradb.py +++ b/libs/community/langchain_community/vectorstores/astradb.py @@ -67,7 +67,7 @@ def _unique_list(lst: List[T], key: Callable[[T], U]) -> List[T]: @deprecated( since="0.0.21", - removal="0.3.0", + removal="1.0", alternative_import="langchain_astradb.AstraDBVectorStore", ) class AstraDB(VectorStore): diff --git a/libs/community/langchain_community/vectorstores/bigquery_vector_search.py b/libs/community/langchain_community/vectorstores/bigquery_vector_search.py index 9dd98f8c911..07114924dca 100644 --- a/libs/community/langchain_community/vectorstores/bigquery_vector_search.py +++ b/libs/community/langchain_community/vectorstores/bigquery_vector_search.py @@ -38,7 +38,7 @@ _vector_table_lock = Lock() # process-wide BigQueryVectorSearch table lock @deprecated( since="0.0.33", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_community.BigQueryVectorSearch", ) class BigQueryVectorSearch(VectorStore): diff --git a/libs/community/langchain_community/vectorstores/chroma.py b/libs/community/langchain_community/vectorstores/chroma.py index 5f1c171088d..fdd756e14df 100644 --- a/libs/community/langchain_community/vectorstores/chroma.py +++ b/libs/community/langchain_community/vectorstores/chroma.py @@ -50,7 +50,7 @@ def _results_to_docs_and_scores(results: Any) -> List[Tuple[Document, float]]: ] -@deprecated(since="0.2.9", removal="0.4", alternative_import="langchain_chroma.Chroma") +@deprecated(since="0.2.9", removal="1.0", alternative_import="langchain_chroma.Chroma") class Chroma(VectorStore): """`ChromaDB` vector store. @@ -705,7 +705,7 @@ class Chroma(VectorStore): "Since Chroma 0.4.x the manual persistence method is no longer " "supported as docs are automatically persisted." ), - removal="0.3.0", + removal="1.0", ) def persist(self) -> None: """Persist the collection. diff --git a/libs/community/langchain_community/vectorstores/couchbase.py b/libs/community/langchain_community/vectorstores/couchbase.py index 7bd5d727cc1..0c9897110c6 100644 --- a/libs/community/langchain_community/vectorstores/couchbase.py +++ b/libs/community/langchain_community/vectorstores/couchbase.py @@ -14,7 +14,7 @@ if TYPE_CHECKING: @deprecated( since="0.2.4", - removal="0.3.0", + removal="1.0", alternative_import="langchain_couchbase.CouchbaseVectorStore", ) class CouchbaseVectorStore(VectorStore): diff --git a/libs/community/langchain_community/vectorstores/databricks_vector_search.py b/libs/community/langchain_community/vectorstores/databricks_vector_search.py index 556f7c7878a..cd52db0180d 100644 --- a/libs/community/langchain_community/vectorstores/databricks_vector_search.py +++ b/libs/community/langchain_community/vectorstores/databricks_vector_search.py @@ -657,7 +657,7 @@ def _alias_filters(kwargs: Dict[str, Any]) -> Optional[Dict[str, Any]]: if "filters" in kwargs: warn_deprecated( since="0.2.11", - removal="0.3", + removal="1.0", message="DatabricksVectorSearch received a key `filters` in search_kwargs. " "`filters` was deprecated since langchain-community 0.2.11 and will " "be removed in 0.3. Please use `filter` instead.", diff --git a/libs/community/langchain_community/vectorstores/matching_engine.py b/libs/community/langchain_community/vectorstores/matching_engine.py index 2cf8594e9fc..8b55d626267 100644 --- a/libs/community/langchain_community/vectorstores/matching_engine.py +++ b/libs/community/langchain_community/vectorstores/matching_engine.py @@ -28,7 +28,7 @@ logger = logging.getLogger(__name__) @deprecated( since="0.0.12", - removal="0.3.0", + removal="1.0", alternative_import="langchain_google_vertexai.VectorSearchVectorStore", ) class MatchingEngine(VectorStore): diff --git a/libs/community/langchain_community/vectorstores/milvus.py b/libs/community/langchain_community/vectorstores/milvus.py index 01d5df92c82..04bff999913 100644 --- a/libs/community/langchain_community/vectorstores/milvus.py +++ b/libs/community/langchain_community/vectorstores/milvus.py @@ -25,7 +25,7 @@ DEFAULT_MILVUS_CONNECTION = { @deprecated( since="0.2.0", - removal="0.3.0", + removal="1.0", alternative_import="langchain_milvus.MilvusVectorStore", ) class Milvus(VectorStore): diff --git a/libs/community/langchain_community/vectorstores/mongodb_atlas.py b/libs/community/langchain_community/vectorstores/mongodb_atlas.py index dba27bb8dd8..ec4a07c3dd0 100644 --- a/libs/community/langchain_community/vectorstores/mongodb_atlas.py +++ b/libs/community/langchain_community/vectorstores/mongodb_atlas.py @@ -35,7 +35,7 @@ DEFAULT_INSERT_BATCH_SIZE = 100 @deprecated( since="0.0.25", - removal="0.3.0", + removal="1.0", alternative_import="langchain_mongodb.MongoDBAtlasVectorSearch", ) class MongoDBAtlasVectorSearch(VectorStore): diff --git a/libs/community/langchain_community/vectorstores/pinecone.py b/libs/community/langchain_community/vectorstores/pinecone.py index 7e1233f8dcf..2cd41903dc8 100644 --- a/libs/community/langchain_community/vectorstores/pinecone.py +++ b/libs/community/langchain_community/vectorstores/pinecone.py @@ -43,7 +43,7 @@ def _is_pinecone_v3() -> bool: @deprecated( - since="0.0.18", removal="0.3.0", alternative_import="langchain_pinecone.Pinecone" + since="0.0.18", removal="1.0", alternative_import="langchain_pinecone.Pinecone" ) class Pinecone(VectorStore): """`Pinecone` vector store. diff --git a/libs/community/langchain_community/vectorstores/qdrant.py b/libs/community/langchain_community/vectorstores/qdrant.py index 66f296225e4..9f402718e66 100644 --- a/libs/community/langchain_community/vectorstores/qdrant.py +++ b/libs/community/langchain_community/vectorstores/qdrant.py @@ -66,9 +66,7 @@ def sync_call_fallback(method: Callable) -> Callable: return wrapper -@deprecated( - since="0.0.37", removal="0.3.0", alternative_import="langchain_qdrant.Qdrant" -) +@deprecated(since="0.0.37", removal="1.0", alternative_import="langchain_qdrant.Qdrant") class Qdrant(VectorStore): """`Qdrant` vector store. diff --git a/libs/core/langchain_core/language_models/base.py b/libs/core/langchain_core/language_models/base.py index 262a3b4e548..bc6887b27c0 100644 --- a/libs/core/langchain_core/language_models/base.py +++ b/libs/core/langchain_core/language_models/base.py @@ -220,7 +220,7 @@ class BaseLanguageModel( # generate responses that match a given schema. raise NotImplementedError() - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") @abstractmethod def predict( self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any @@ -241,7 +241,7 @@ class BaseLanguageModel( Top model prediction as a string. """ - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") @abstractmethod def predict_messages( self, @@ -266,7 +266,7 @@ class BaseLanguageModel( Top model prediction as a message. """ - @deprecated("0.1.7", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.7", alternative="ainvoke", removal="1.0") @abstractmethod async def apredict( self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any @@ -287,7 +287,7 @@ class BaseLanguageModel( Top model prediction as a string. """ - @deprecated("0.1.7", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.7", alternative="ainvoke", removal="1.0") @abstractmethod async def apredict_messages( self, diff --git a/libs/core/langchain_core/language_models/chat_models.py b/libs/core/langchain_core/language_models/chat_models.py index a8615faae35..64d61ccc05f 100644 --- a/libs/core/langchain_core/language_models/chat_models.py +++ b/libs/core/langchain_core/language_models/chat_models.py @@ -209,7 +209,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): """ # noqa: E501 callback_manager: Optional[BaseCallbackManager] = deprecated( - name="callback_manager", since="0.1.7", removal="0.3.0", alternative="callbacks" + name="callback_manager", since="0.1.7", removal="1.0", alternative="callbacks" )( Field( default=None, @@ -1019,7 +1019,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): break yield item # type: ignore[misc] - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") def __call__( self, messages: List[BaseMessage], @@ -1051,13 +1051,13 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): else: raise ValueError("Unexpected generation type") - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") def call_as_llm( self, message: str, stop: Optional[List[str]] = None, **kwargs: Any ) -> str: return self.predict(message, stop=stop, **kwargs) - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") def predict( self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any ) -> str: @@ -1071,7 +1071,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): else: raise ValueError("Cannot use predict when output is not a string.") - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") def predict_messages( self, messages: List[BaseMessage], @@ -1085,7 +1085,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): _stop = list(stop) return self(messages, stop=_stop, **kwargs) - @deprecated("0.1.7", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.7", alternative="ainvoke", removal="1.0") async def apredict( self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any ) -> str: @@ -1101,7 +1101,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC): else: raise ValueError("Cannot use predict when output is not a string.") - @deprecated("0.1.7", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.7", alternative="ainvoke", removal="1.0") async def apredict_messages( self, messages: List[BaseMessage], diff --git a/libs/core/langchain_core/language_models/llms.py b/libs/core/langchain_core/language_models/llms.py index 03ae2be5e23..74032d6ded4 100644 --- a/libs/core/langchain_core/language_models/llms.py +++ b/libs/core/langchain_core/language_models/llms.py @@ -1150,7 +1150,7 @@ class BaseLLM(BaseLanguageModel[str], ABC): generations = [existing_prompts[i] for i in range(len(prompts))] return LLMResult(generations=generations, llm_output=llm_output, run=run_info) - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") def __call__( self, prompt: str, @@ -1220,7 +1220,7 @@ class BaseLLM(BaseLanguageModel[str], ABC): ) return result.generations[0][0].text - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") def predict( self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any ) -> str: @@ -1230,7 +1230,7 @@ class BaseLLM(BaseLanguageModel[str], ABC): _stop = list(stop) return self(text, stop=_stop, **kwargs) - @deprecated("0.1.7", alternative="invoke", removal="0.3.0") + @deprecated("0.1.7", alternative="invoke", removal="1.0") def predict_messages( self, messages: List[BaseMessage], @@ -1246,7 +1246,7 @@ class BaseLLM(BaseLanguageModel[str], ABC): content = self(text, stop=_stop, **kwargs) return AIMessage(content=content) - @deprecated("0.1.7", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.7", alternative="ainvoke", removal="1.0") async def apredict( self, text: str, *, stop: Optional[Sequence[str]] = None, **kwargs: Any ) -> str: @@ -1256,7 +1256,7 @@ class BaseLLM(BaseLanguageModel[str], ABC): _stop = list(stop) return await self._call_async(text, stop=_stop, **kwargs) - @deprecated("0.1.7", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.7", alternative="ainvoke", removal="1.0") async def apredict_messages( self, messages: List[BaseMessage], diff --git a/libs/core/langchain_core/retrievers.py b/libs/core/langchain_core/retrievers.py index c4971fd4962..41b6080b27d 100644 --- a/libs/core/langchain_core/retrievers.py +++ b/libs/core/langchain_core/retrievers.py @@ -349,7 +349,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC): run_manager=run_manager.get_sync(), ) - @deprecated(since="0.1.46", alternative="invoke", removal="0.3.0") + @deprecated(since="0.1.46", alternative="invoke", removal="1.0") def get_relevant_documents( self, query: str, @@ -393,7 +393,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC): config["run_name"] = run_name return self.invoke(query, config, **kwargs) - @deprecated(since="0.1.46", alternative="ainvoke", removal="0.3.0") + @deprecated(since="0.1.46", alternative="ainvoke", removal="1.0") async def aget_relevant_documents( self, query: str, diff --git a/libs/core/langchain_core/tools.py b/libs/core/langchain_core/tools.py index 0dfe3f877e9..34d76f86791 100644 --- a/libs/core/langchain_core/tools.py +++ b/libs/core/langchain_core/tools.py @@ -332,7 +332,7 @@ class ChildTool(BaseTool): """Callbacks to be called during tool execution.""" callback_manager: Optional[BaseCallbackManager] = deprecated( - name="callback_manager", since="0.1.7", removal="0.3.0", alternative="callbacks" + name="callback_manager", since="0.1.7", removal="1.0", alternative="callbacks" )( Field( default=None, @@ -740,7 +740,7 @@ class ChildTool(BaseTool): await run_manager.on_tool_end(output, color=color, name=self.name, **kwargs) return output - @deprecated("0.1.47", alternative="invoke", removal="0.3.0") + @deprecated("0.1.47", alternative="invoke", removal="1.0") def __call__(self, tool_input: str, callbacks: Callbacks = None) -> str: """Make tool callable.""" return self.run(tool_input, callbacks=callbacks) diff --git a/libs/core/langchain_core/tracers/schemas.py b/libs/core/langchain_core/tracers/schemas.py index dd8982eabd4..fd5560e370c 100644 --- a/libs/core/langchain_core/tracers/schemas.py +++ b/libs/core/langchain_core/tracers/schemas.py @@ -15,7 +15,7 @@ from langchain_core.outputs import LLMResult from langchain_core.pydantic_v1 import BaseModel, Field, root_validator -@deprecated("0.1.0", alternative="Use string instead.", removal="0.3.0") +@deprecated("0.1.0", alternative="Use string instead.", removal="1.0") def RunTypeEnum() -> Type[RunTypeEnumDep]: """RunTypeEnum.""" warnings.warn( @@ -26,7 +26,7 @@ def RunTypeEnum() -> Type[RunTypeEnumDep]: return RunTypeEnumDep -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class TracerSessionV1Base(BaseModel): """Base class for TracerSessionV1.""" @@ -35,33 +35,33 @@ class TracerSessionV1Base(BaseModel): extra: Optional[Dict[str, Any]] = None -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class TracerSessionV1Create(TracerSessionV1Base): """Create class for TracerSessionV1.""" -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class TracerSessionV1(TracerSessionV1Base): """TracerSessionV1 schema.""" id: int -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class TracerSessionBase(TracerSessionV1Base): """Base class for TracerSession.""" tenant_id: UUID -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class TracerSession(TracerSessionBase): """TracerSessionV1 schema for the V2 API.""" id: UUID -@deprecated("0.1.0", alternative="Run", removal="0.3.0") +@deprecated("0.1.0", alternative="Run", removal="1.0") class BaseRun(BaseModel): """Base class for Run.""" @@ -77,7 +77,7 @@ class BaseRun(BaseModel): error: Optional[str] = None -@deprecated("0.1.0", alternative="Run", removal="0.3.0") +@deprecated("0.1.0", alternative="Run", removal="1.0") class LLMRun(BaseRun): """Class for LLMRun.""" @@ -85,7 +85,7 @@ class LLMRun(BaseRun): response: Optional[LLMResult] = None -@deprecated("0.1.0", alternative="Run", removal="0.3.0") +@deprecated("0.1.0", alternative="Run", removal="1.0") class ChainRun(BaseRun): """Class for ChainRun.""" @@ -96,7 +96,7 @@ class ChainRun(BaseRun): child_tool_runs: List[ToolRun] = Field(default_factory=list) -@deprecated("0.1.0", alternative="Run", removal="0.3.0") +@deprecated("0.1.0", alternative="Run", removal="1.0") class ToolRun(BaseRun): """Class for ToolRun.""" diff --git a/libs/core/langchain_core/utils/function_calling.py b/libs/core/langchain_core/utils/function_calling.py index e4a7acabee9..9fa07a5eff0 100644 --- a/libs/core/langchain_core/utils/function_calling.py +++ b/libs/core/langchain_core/utils/function_calling.py @@ -81,7 +81,7 @@ def _rm_titles(kv: dict, prev_key: str = "") -> dict: @deprecated( "0.1.16", alternative="langchain_core.utils.function_calling.convert_to_openai_function()", - removal="0.3.0", + removal="1.0", ) def convert_pydantic_to_openai_function( model: Type[BaseModel], @@ -121,7 +121,7 @@ def convert_pydantic_to_openai_function( @deprecated( "0.1.16", alternative="langchain_core.utils.function_calling.convert_to_openai_tool()", - removal="0.3.0", + removal="1.0", ) def convert_pydantic_to_openai_tool( model: Type[BaseModel], @@ -155,7 +155,7 @@ def _get_python_function_name(function: Callable) -> str: @deprecated( "0.1.16", alternative="langchain_core.utils.function_calling.convert_to_openai_function()", - removal="0.3.0", + removal="1.0", ) def convert_python_function_to_openai_function( function: Callable, @@ -268,7 +268,7 @@ def _convert_any_typed_dicts_to_pydantic( @deprecated( "0.1.16", alternative="langchain_core.utils.function_calling.convert_to_openai_function()", - removal="0.3.0", + removal="1.0", ) def format_tool_to_openai_function(tool: BaseTool) -> FunctionDescription: """Format tool into the OpenAI function API. @@ -305,7 +305,7 @@ def format_tool_to_openai_function(tool: BaseTool) -> FunctionDescription: @deprecated( "0.1.16", alternative="langchain_core.utils.function_calling.convert_to_openai_tool()", - removal="0.3.0", + removal="1.0", ) def format_tool_to_openai_tool(tool: BaseTool) -> ToolDescription: """Format tool into the OpenAI function API. diff --git a/libs/core/langchain_core/utils/loading.py b/libs/core/langchain_core/utils/loading.py index a1977c2f960..eae500bb1a0 100644 --- a/libs/core/langchain_core/utils/loading.py +++ b/libs/core/langchain_core/utils/loading.py @@ -8,7 +8,7 @@ from langchain_core._api.deprecation import deprecated @deprecated( since="0.1.30", - removal="0.3", + removal="1.0", message=( "Using the hwchase17/langchain-hub " "repo for prompts is deprecated. Please use " diff --git a/libs/core/langchain_core/vectorstores/in_memory.py b/libs/core/langchain_core/vectorstores/in_memory.py index ca6d7477820..474ee94baa9 100644 --- a/libs/core/langchain_core/vectorstores/in_memory.py +++ b/libs/core/langchain_core/vectorstores/in_memory.py @@ -154,7 +154,7 @@ class InMemoryVectorStore(VectorStore): "It'll be removed in 0.3.0." ), since="0.2.29", - removal="0.3.0", + removal="1.0", ) def upsert(self, items: Sequence[Document], /, **kwargs: Any) -> UpsertResponse: vectors = self.embedding.embed_documents([item.page_content for item in items]) @@ -180,7 +180,7 @@ class InMemoryVectorStore(VectorStore): "It'll be removed in 0.3.0." ), since="0.2.29", - removal="0.3.0", + removal="1.0", ) async def aupsert( self, items: Sequence[Document], /, **kwargs: Any diff --git a/libs/experimental/langchain_experimental/llms/anthropic_functions.py b/libs/experimental/langchain_experimental/llms/anthropic_functions.py index 599bbcacef3..ec3d465a403 100644 --- a/libs/experimental/langchain_experimental/llms/anthropic_functions.py +++ b/libs/experimental/langchain_experimental/llms/anthropic_functions.py @@ -126,7 +126,7 @@ def _destrip(tool_input: Any) -> Any: @deprecated( since="0.0.54", - removal="0.3", + removal="1.0", alternative_import="langchain_anthropic.experimental.ChatAnthropicTools", ) class AnthropicFunctions(BaseChatModel): diff --git a/libs/experimental/langchain_experimental/llms/ollama_functions.py b/libs/experimental/langchain_experimental/llms/ollama_functions.py index abf6aa753dc..6bab4242097 100644 --- a/libs/experimental/langchain_experimental/llms/ollama_functions.py +++ b/libs/experimental/langchain_experimental/llms/ollama_functions.py @@ -134,7 +134,7 @@ def parse_response(message: BaseMessage) -> str: @deprecated( # type: ignore[arg-type] - since="0.0.64", removal="0.4.0", alternative_import="langchain_ollama.ChatOllama" + since="0.0.64", removal="1.0", alternative_import="langchain_ollama.ChatOllama" ) class OllamaFunctions(ChatOllama): """Function chat model that uses Ollama API.""" diff --git a/libs/langchain/langchain/_api/module_import.py b/libs/langchain/langchain/_api/module_import.py index 048645cf9b4..993432dc4cc 100644 --- a/libs/langchain/langchain/_api/module_import.py +++ b/libs/langchain/langchain/_api/module_import.py @@ -92,7 +92,7 @@ def create_importer( warn_deprecated( since="0.1", pending=False, - removal="0.4", + removal="1.0", message=( f"Importing {name} from {package} is deprecated. " f"Please replace deprecated imports:\n\n" @@ -124,7 +124,7 @@ def create_importer( warn_deprecated( since="0.1", pending=False, - removal="0.4", + removal="1.0", message=( f"Importing {name} from {package} is deprecated. " f"Please replace deprecated imports:\n\n" diff --git a/libs/langchain/langchain/agents/agent.py b/libs/langchain/langchain/agents/agent.py index 987f15b49d4..68170badd47 100644 --- a/libs/langchain/langchain/agents/agent.py +++ b/libs/langchain/langchain/agents/agent.py @@ -633,7 +633,7 @@ class RunnableMultiActionAgent(BaseMultiActionAgent): "Use new agent constructor methods like create_react_agent, create_json_agent, " "create_structured_chat_agent, etc." ), - removal="0.3.0", + removal="1.0", ) class LLMSingleActionAgent(BaseSingleActionAgent): """Base class for single action agents.""" @@ -724,7 +724,7 @@ class LLMSingleActionAgent(BaseSingleActionAgent): "Use new agent constructor methods like create_react_agent, create_json_agent, " "create_structured_chat_agent, etc." ), - removal="0.3.0", + removal="1.0", ) class Agent(BaseSingleActionAgent): """Agent that calls the language model and deciding the action. diff --git a/libs/langchain/langchain/agents/agent_types.py b/libs/langchain/langchain/agents/agent_types.py index b9e5cc0d125..9fbd6f95c4e 100644 --- a/libs/langchain/langchain/agents/agent_types.py +++ b/libs/langchain/langchain/agents/agent_types.py @@ -11,7 +11,7 @@ from langchain_core._api import deprecated "Use new agent constructor methods like create_react_agent, create_json_agent, " "create_structured_chat_agent, etc." ), - removal="0.3.0", + removal="1.0", ) class AgentType(str, Enum): """An enum for agent types. diff --git a/libs/langchain/langchain/agents/chat/base.py b/libs/langchain/langchain/agents/chat/base.py index 65b30a62028..a7a16be7726 100644 --- a/libs/langchain/langchain/agents/chat/base.py +++ b/libs/langchain/langchain/agents/chat/base.py @@ -25,7 +25,7 @@ from langchain.agents.utils import validate_tools_single_input from langchain.chains.llm import LLMChain -@deprecated("0.1.0", alternative="create_react_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_react_agent", removal="1.0") class ChatAgent(Agent): """Chat Agent.""" diff --git a/libs/langchain/langchain/agents/conversational/base.py b/libs/langchain/langchain/agents/conversational/base.py index d5a58fdb70b..bbbf666e590 100644 --- a/libs/langchain/langchain/agents/conversational/base.py +++ b/libs/langchain/langchain/agents/conversational/base.py @@ -19,7 +19,7 @@ from langchain.agents.utils import validate_tools_single_input from langchain.chains import LLMChain -@deprecated("0.1.0", alternative="create_react_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_react_agent", removal="1.0") class ConversationalAgent(Agent): """An agent that holds a conversation in addition to using tools.""" diff --git a/libs/langchain/langchain/agents/conversational_chat/base.py b/libs/langchain/langchain/agents/conversational_chat/base.py index b5b053fc3a5..08ec829613a 100644 --- a/libs/langchain/langchain/agents/conversational_chat/base.py +++ b/libs/langchain/langchain/agents/conversational_chat/base.py @@ -31,7 +31,7 @@ from langchain.agents.utils import validate_tools_single_input from langchain.chains import LLMChain -@deprecated("0.1.0", alternative="create_json_chat_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_json_chat_agent", removal="1.0") class ConversationalChatAgent(Agent): """An agent designed to hold a conversation in addition to using tools.""" diff --git a/libs/langchain/langchain/agents/initialize.py b/libs/langchain/langchain/agents/initialize.py index fcfa35b5364..17765e92276 100644 --- a/libs/langchain/langchain/agents/initialize.py +++ b/libs/langchain/langchain/agents/initialize.py @@ -18,7 +18,7 @@ from langchain.agents.loading import AGENT_TO_CLASS, load_agent "Use new agent constructor methods like create_react_agent, create_json_agent, " "create_structured_chat_agent, etc." ), - removal="0.3.0", + removal="1.0", ) def initialize_agent( tools: Sequence[BaseTool], diff --git a/libs/langchain/langchain/agents/loading.py b/libs/langchain/langchain/agents/loading.py index d2188529b9a..83d2b56f499 100644 --- a/libs/langchain/langchain/agents/loading.py +++ b/libs/langchain/langchain/agents/loading.py @@ -31,7 +31,7 @@ def _load_agent_from_tools( return agent_cls.from_llm_and_tools(llm, tools, **combined_config) -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") def load_agent_from_config( config: dict, llm: Optional[BaseLanguageModel] = None, @@ -90,7 +90,7 @@ def load_agent_from_config( return agent_cls(**combined_config) # type: ignore -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") def load_agent( path: Union[str, Path], **kwargs: Any ) -> Union[BaseSingleActionAgent, BaseMultiActionAgent]: diff --git a/libs/langchain/langchain/agents/mrkl/base.py b/libs/langchain/langchain/agents/mrkl/base.py index 5257f3206bc..8e45027616f 100644 --- a/libs/langchain/langchain/agents/mrkl/base.py +++ b/libs/langchain/langchain/agents/mrkl/base.py @@ -34,7 +34,7 @@ class ChainConfig(NamedTuple): action_description: str -@deprecated("0.1.0", alternative="create_react_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_react_agent", removal="1.0") class ZeroShotAgent(Agent): """Agent for the MRKL chain. @@ -168,7 +168,7 @@ class ZeroShotAgent(Agent): super()._validate_tools(tools) -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class MRKLChain(AgentExecutor): """Chain that implements the MRKL system.""" diff --git a/libs/langchain/langchain/agents/openai_functions_agent/base.py b/libs/langchain/langchain/agents/openai_functions_agent/base.py index f39ae1f266b..fbb23a56e47 100644 --- a/libs/langchain/langchain/agents/openai_functions_agent/base.py +++ b/libs/langchain/langchain/agents/openai_functions_agent/base.py @@ -31,7 +31,7 @@ from langchain.agents.output_parsers.openai_functions import ( ) -@deprecated("0.1.0", alternative="create_openai_functions_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_openai_functions_agent", removal="1.0") class OpenAIFunctionsAgent(BaseSingleActionAgent): """An Agent driven by OpenAIs function powered API. diff --git a/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py b/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py index cf20eb81157..819fc8b1d93 100644 --- a/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py +++ b/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py @@ -94,7 +94,7 @@ def _parse_ai_message(message: BaseMessage) -> Union[List[AgentAction], AgentFin ) -@deprecated("0.1.0", alternative="create_openai_tools_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_openai_tools_agent", removal="1.0") class OpenAIMultiFunctionsAgent(BaseMultiActionAgent): """Agent driven by OpenAIs function powered API. diff --git a/libs/langchain/langchain/agents/react/base.py b/libs/langchain/langchain/agents/react/base.py index 62abcbdc79a..93a60bbe61b 100644 --- a/libs/langchain/langchain/agents/react/base.py +++ b/libs/langchain/langchain/agents/react/base.py @@ -22,7 +22,7 @@ if TYPE_CHECKING: from langchain_community.docstore.base import Docstore -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class ReActDocstoreAgent(Agent): """Agent for the ReAct chain.""" @@ -69,7 +69,7 @@ class ReActDocstoreAgent(Agent): return "Thought:" -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class DocstoreExplorer: """Class to assist with exploration of a document store.""" @@ -119,7 +119,7 @@ class DocstoreExplorer: return self.document.page_content.split("\n\n") -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class ReActTextWorldAgent(ReActDocstoreAgent): """Agent for the ReAct TextWorld chain.""" @@ -139,7 +139,7 @@ class ReActTextWorldAgent(ReActDocstoreAgent): raise ValueError(f"Tool name should be Play, got {tool_names}") -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class ReActChain(AgentExecutor): """[Deprecated] Chain that implements the ReAct paper.""" diff --git a/libs/langchain/langchain/agents/self_ask_with_search/base.py b/libs/langchain/langchain/agents/self_ask_with_search/base.py index e4890254ee4..7a1d81f7d40 100644 --- a/libs/langchain/langchain/agents/self_ask_with_search/base.py +++ b/libs/langchain/langchain/agents/self_ask_with_search/base.py @@ -24,7 +24,7 @@ if TYPE_CHECKING: from langchain_community.utilities.serpapi import SerpAPIWrapper -@deprecated("0.1.0", alternative="create_self_ask_with_search", removal="0.3.0") +@deprecated("0.1.0", alternative="create_self_ask_with_search", removal="1.0") class SelfAskWithSearchAgent(Agent): """Agent for the self-ask-with-search paper.""" @@ -67,7 +67,7 @@ class SelfAskWithSearchAgent(Agent): return "" -@deprecated("0.1.0", removal="0.3.0") +@deprecated("0.1.0", removal="1.0") class SelfAskWithSearchChain(AgentExecutor): """[Deprecated] Chain that does self-ask with search.""" diff --git a/libs/langchain/langchain/agents/structured_chat/base.py b/libs/langchain/langchain/agents/structured_chat/base.py index 31b10934f01..894f3c79a6a 100644 --- a/libs/langchain/langchain/agents/structured_chat/base.py +++ b/libs/langchain/langchain/agents/structured_chat/base.py @@ -28,7 +28,7 @@ from langchain.tools.render import ToolsRenderer, render_text_description_and_ar HUMAN_MESSAGE_TEMPLATE = "{input}\n\n{agent_scratchpad}" -@deprecated("0.1.0", alternative="create_structured_chat_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_structured_chat_agent", removal="1.0") class StructuredChatAgent(Agent): """Structured Chat Agent.""" diff --git a/libs/langchain/langchain/agents/xml/base.py b/libs/langchain/langchain/agents/xml/base.py index 2a224736e5a..2e514b4480f 100644 --- a/libs/langchain/langchain/agents/xml/base.py +++ b/libs/langchain/langchain/agents/xml/base.py @@ -17,7 +17,7 @@ from langchain.chains.llm import LLMChain from langchain.tools.render import ToolsRenderer, render_text_description -@deprecated("0.1.0", alternative="create_xml_agent", removal="0.3.0") +@deprecated("0.1.0", alternative="create_xml_agent", removal="1.0") class XMLAgent(BaseSingleActionAgent): """Agent that uses XML tags. diff --git a/libs/langchain/langchain/chains/base.py b/libs/langchain/langchain/chains/base.py index 4771b83925d..4c1dcc07eb2 100644 --- a/libs/langchain/langchain/chains/base.py +++ b/libs/langchain/langchain/chains/base.py @@ -334,7 +334,7 @@ class Chain(RunnableSerializable[Dict[str, Any], Dict[str, Any]], ABC): None, self._call, inputs, run_manager.get_sync() if run_manager else None ) - @deprecated("0.1.0", alternative="invoke", removal="0.3.0") + @deprecated("0.1.0", alternative="invoke", removal="1.0") def __call__( self, inputs: Union[Dict[str, Any], Any], @@ -385,7 +385,7 @@ class Chain(RunnableSerializable[Dict[str, Any], Dict[str, Any]], ABC): include_run_info=include_run_info, ) - @deprecated("0.1.0", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.0", alternative="ainvoke", removal="1.0") async def acall( self, inputs: Union[Dict[str, Any], Any], @@ -544,7 +544,7 @@ class Chain(RunnableSerializable[Dict[str, Any], Dict[str, Any]], ABC): ) return self.output_keys[0] - @deprecated("0.1.0", alternative="invoke", removal="0.3.0") + @deprecated("0.1.0", alternative="invoke", removal="1.0") def run( self, *args: Any, @@ -615,7 +615,7 @@ class Chain(RunnableSerializable[Dict[str, Any], Dict[str, Any]], ABC): f" but not both. Got args: {args} and kwargs: {kwargs}." ) - @deprecated("0.1.0", alternative="ainvoke", removal="0.3.0") + @deprecated("0.1.0", alternative="ainvoke", removal="1.0") async def arun( self, *args: Any, @@ -753,7 +753,7 @@ class Chain(RunnableSerializable[Dict[str, Any], Dict[str, Any]], ABC): else: raise ValueError(f"{save_path} must be json or yaml") - @deprecated("0.1.0", alternative="batch", removal="0.3.0") + @deprecated("0.1.0", alternative="batch", removal="1.0") def apply( self, input_list: List[Dict[str, Any]], callbacks: Callbacks = None ) -> List[Dict[str, str]]: diff --git a/libs/langchain/langchain/chains/conversational_retrieval/base.py b/libs/langchain/langchain/chains/conversational_retrieval/base.py index 8111978268e..4251ced2fdf 100644 --- a/libs/langchain/langchain/chains/conversational_retrieval/base.py +++ b/libs/langchain/langchain/chains/conversational_retrieval/base.py @@ -242,7 +242,7 @@ class BaseConversationalRetrievalChain(Chain): "create_history_aware_retriever together with create_retrieval_chain " "(see example in docstring)" ), - removal="0.3.0", + removal="1.0", ) class ConversationalRetrievalChain(BaseConversationalRetrievalChain): """Chain for having a conversation based on retrieved documents. diff --git a/libs/langchain/langchain/chains/openai_functions/base.py b/libs/langchain/langchain/chains/openai_functions/base.py index 4cd126e97ba..568d992de99 100644 --- a/libs/langchain/langchain/chains/openai_functions/base.py +++ b/libs/langchain/langchain/chains/openai_functions/base.py @@ -43,7 +43,7 @@ __all__ = [ ] -@deprecated(since="0.1.1", removal="0.3.0", alternative="create_openai_fn_runnable") +@deprecated(since="0.1.1", removal="1.0", alternative="create_openai_fn_runnable") def create_openai_fn_chain( functions: Sequence[Union[Dict[str, Any], Type[BaseModel], Callable]], llm: BaseLanguageModel, @@ -145,7 +145,7 @@ def create_openai_fn_chain( @deprecated( - since="0.1.1", removal="0.3.0", alternative="ChatOpenAI.with_structured_output" + since="0.1.1", removal="1.0", alternative="ChatOpenAI.with_structured_output" ) def create_structured_output_chain( output_schema: Union[Dict[str, Any], Type[BaseModel]], diff --git a/libs/langchain/langchain/chains/openai_functions/extraction.py b/libs/langchain/langchain/chains/openai_functions/extraction.py index 445431438d7..ec76ad8a6cb 100644 --- a/libs/langchain/langchain/chains/openai_functions/extraction.py +++ b/libs/langchain/langchain/chains/openai_functions/extraction.py @@ -58,7 +58,7 @@ Passage: "feedback here:" "" ), - removal="0.3.0", + removal="1.0", alternative=( """ from langchain_core.pydantic_v1 import BaseModel, Field @@ -128,7 +128,7 @@ def create_extraction_chain( "feedback here:" "" ), - removal="0.3.0", + removal="1.0", alternative=( """ from langchain_core.pydantic_v1 import BaseModel, Field diff --git a/libs/langchain/langchain/chains/openai_tools/extraction.py b/libs/langchain/langchain/chains/openai_tools/extraction.py index b00ab66f2de..55251f51867 100644 --- a/libs/langchain/langchain/chains/openai_tools/extraction.py +++ b/libs/langchain/langchain/chains/openai_tools/extraction.py @@ -29,7 +29,7 @@ If a property is not present and is not required in the function parameters, do "feedback here:" "" ), - removal="0.3.0", + removal="1.0", alternative=( """ from langchain_core.pydantic_v1 import BaseModel, Field diff --git a/libs/langchain/langchain/chains/structured_output/base.py b/libs/langchain/langchain/chains/structured_output/base.py index 3b2ae20aa83..14526d014cc 100644 --- a/libs/langchain/langchain/chains/structured_output/base.py +++ b/libs/langchain/langchain/chains/structured_output/base.py @@ -41,7 +41,7 @@ from langchain_core.utils.pydantic import is_basemodel_subclass "feedback here: " "" ), - removal="0.3.0", + removal="1.0", alternative=( """ from langchain_core.pydantic_v1 import BaseModel, Field @@ -159,7 +159,7 @@ def create_openai_fn_runnable( "feedback here: " "" ), - removal="0.3.0", + removal="1.0", alternative=( """ from langchain_core.pydantic_v1 import BaseModel, Field diff --git a/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py b/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py index d2c169aca44..f7d96c29df7 100644 --- a/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py +++ b/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py @@ -13,7 +13,7 @@ from langchain.retrievers.document_compressors.base import BaseDocumentCompresso @deprecated( - since="0.0.30", removal="0.3.0", alternative_import="langchain_cohere.CohereRerank" + since="0.0.30", removal="1.0", alternative_import="langchain_cohere.CohereRerank" ) class CohereRerank(BaseDocumentCompressor): """Document compressor that uses `Cohere Rerank API`."""