fix(deepseek): accept base_url as alias for api_base (#35789)

Add `base_url` as a Pydantic alias for `ChatDeepSeek.api_base`, so users
can pass `base_url=` when constructing the model.
This commit is contained in:
Mason Daugherty
2026-03-12 10:27:34 -04:00
committed by GitHub
parent 5d9568b5f5
commit b676167707
3 changed files with 22 additions and 9 deletions

View File

@@ -189,9 +189,13 @@ class ChatDeepSeek(BaseChatOpenAI):
)
"""DeepSeek API key"""
api_base: str = Field(
alias="base_url",
default_factory=from_env("DEEPSEEK_API_BASE", default=DEFAULT_API_BASE),
)
"""DeepSeek API base URL"""
"""DeepSeek API base URL.
Automatically read from env variable `DEEPSEEK_API_BASE` if not provided.
"""
model_config = ConfigDict(populate_by_name=True)