From 5c387a173f0217f521c26c7a5d8522621ed5cf1d Mon Sep 17 00:00:00 2001 From: aditya thomas Date: Tue, 5 Mar 2024 00:14:54 +0530 Subject: [PATCH] docs: update to docstrings of ChatAnthropic class (#18493) **Description:** Update docstrings of ChatAnthropic class **Issue:** Change to ChatAnthropic from ChatAnthropicMessages **Dependencies:** None **Lint and test**: `make format`, `make lint` and `make test` passed --- .../anthropic/langchain_anthropic/chat_models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.py index 651a232892..0a81b81b3b 100644 --- a/libs/partners/anthropic/langchain_anthropic/chat_models.py +++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py @@ -56,14 +56,18 @@ def _format_messages(messages: List[BaseMessage]) -> Tuple[Optional[str], List[D class ChatAnthropic(BaseChatModel): - """ChatAnthropicMessages chat model. + """Anthropic chat model. + + To use, you should have the packages ``anthropic`` and ``langchain-anthropic`` + installed, and the environment variable ANTHROPIC_API_KEY set with your API key, + or pass it as a named parameter to the constructor. Example: .. code-block:: python - from langchain_anthropic import ChatAnthropicMessages + from langchain_anthropic import ChatAnthropic - model = ChatAnthropicMessages() + model = ChatAnthropic() """ class Config: