From 9fd36efdb53df850d172f220e04e975371f3d7f0 Mon Sep 17 00:00:00 2001 From: Fayfox Date: Tue, 16 Apr 2024 22:16:51 +0800 Subject: [PATCH] anthropic[patch]: env ANTHROPIC_API_URL not work (#20507) enviroment variable ANTHROPIC_API_URL will not work if anthropic_api_url has default value --------- Co-authored-by: Eugene Yurtsev --- libs/partners/anthropic/langchain_anthropic/chat_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.py index faca14a49e..4a216d2c18 100644 --- a/libs/partners/anthropic/langchain_anthropic/chat_models.py +++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py @@ -251,7 +251,7 @@ class ChatAnthropic(BaseChatModel): max_retries: int = 2 """Number of retries allowed for requests sent to the Anthropic Completion API.""" - anthropic_api_url: str = "https://api.anthropic.com" + anthropic_api_url: Optional[str] = None anthropic_api_key: Optional[SecretStr] = Field(None, alias="api_key") """Automatically read from env var `ANTHROPIC_API_KEY` if not provided."""