diff --git a/libs/cohere/langchain_cohere/chat_models.py b/libs/cohere/langchain_cohere/chat_models.py index e71aaac..bd72c15 100644 --- a/libs/cohere/langchain_cohere/chat_models.py +++ b/libs/cohere/langchain_cohere/chat_models.py @@ -15,6 +15,7 @@ ) from cohere.types import NonStreamedChatResponse, ToolCall +from langchain_core._api.deprecation import warn_deprecated from langchain_core.callbacks import ( AsyncCallbackManagerForLLMRun, CallbackManagerForLLMRun, @@ -229,6 +230,15 @@ def get_cohere_chat_request( Returns: The request for the Cohere chat API. """ + if connectors or "connectors" in kwargs: + warn_deprecated( + since="0.3.3", + message=( + "The 'connectors' parameter is deprecated as of version 0.3.3.\n" + "Please use the 'tools' parameter instead." + ), + removal="0.4.0", + ) additional_kwargs = messages[-1].additional_kwargs # cohere SDK will fail loudly if both connectors and documents are provided diff --git a/libs/cohere/langchain_cohere/cohere_agent.py b/libs/cohere/langchain_cohere/cohere_agent.py index 6ef9bb6..8497b2b 100644 --- a/libs/cohere/langchain_cohere/cohere_agent.py +++ b/libs/cohere/langchain_cohere/cohere_agent.py @@ -27,7 +27,7 @@ @deprecated( since="0.1.7", - removal="", + removal="0.4.0", alternative="""Use the 'tool calling agent' or 'Langgraph agent' with the ChatCohere class instead. See https://docs.cohere.com/docs/cohere-and-langchain for more information.""", diff --git a/libs/cohere/langchain_cohere/rag_retrievers.py b/libs/cohere/langchain_cohere/rag_retrievers.py index c1d06fd..5d69f45 100644 --- a/libs/cohere/langchain_cohere/rag_retrievers.py +++ b/libs/cohere/langchain_cohere/rag_retrievers.py @@ -45,7 +45,10 @@ def _get_docs(response: Any) -> List[Document]: class CohereRagRetriever(BaseRetriever): """Cohere Chat API with RAG.""" - connectors: List[Dict] = Field(default_factory=lambda: [{"id": "web-search"}]) + connectors: List[Dict] = Field( + default_factory=lambda: [{"id": "web-search"}], + deprecated="The 'connectors' parameter is deprecated as of version 0.3.3. Please use the 'tools' parameter instead.", # noqa: E501 + ) """ When specified, the model's reply will be enriched with information found by querying each of the connectors (RAG). These will be returned as langchain diff --git a/libs/cohere/pyproject.toml b/libs/cohere/pyproject.toml index c8cc57e..ea4faa2 100644 --- a/libs/cohere/pyproject.toml +++ b/libs/cohere/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain-cohere" -version = "0.3.2" +version = "0.3.3" description = "An integration package connecting Cohere and LangChain" authors = [] readme = "README.md"