Simplify Anthropic base URL condition

This commit is contained in:
Zhengda Lu 2026-03-22 18:09:08 -04:00
parent 1835313207
commit fdd92867e9
No known key found for this signature in database
1 changed files with 2 additions and 3 deletions

View File

@ -20,9 +20,8 @@ class AnthropicClient(BaseLLMClient):
llm_kwargs = {"model": self.model}
env_base_url = os.getenv("ANTHROPIC_BASE_URL")
if self.base_url and not (
env_base_url
and self.base_url.rstrip("/") == self._DEFAULT_API_URL
if self.base_url and (
not env_base_url or self.base_url.rstrip("/") != self._DEFAULT_API_URL
):
llm_kwargs["anthropic_api_url"] = self.base_url