Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions langchain/llms/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _AnthropicCommon(BaseModel):
default_request_timeout: Optional[Union[float, Tuple[float, float]]] = None
"""Timeout for requests to Anthropic Completion API. Default is 600 seconds."""

anthropic_api_url: str = "https://api.anthropic.com"
anthropic_api_url: Optional[str] = None

anthropic_api_key: Optional[str] = None

Expand All @@ -52,7 +52,10 @@ def validate_environment(cls, values: Dict) -> Dict:
)
"""Get custom api url from environment."""
anthropic_api_url = get_from_dict_or_env(
values, "anthropic_api_url", "ANTHROPIC_API_URL"
values,
"anthropic_api_url",
"ANTHROPIC_API_URL",
default="https://api.anthropic.com",
)

try:
Expand Down