test(standard-tests): assert ls_model_name honors per-call model override (#37504)

Adds a standard unit test so every chat-model integration verifies that
`_get_ls_params` picks up a runtime `model` kwarg instead of always
reporting the constructor default.
This commit is contained in:
Mason Daugherty
2026-05-18 13:33:11 -07:00
committed by GitHub
parent 764db7afab
commit 730d066285
2 changed files with 25 additions and 1 deletions

View File

@@ -749,7 +749,10 @@ class AzureChatOpenAI(BaseChatOpenAI):
"""Get the parameters used to invoke the model."""
params = super()._get_ls_params(stop=stop, **kwargs)
params["ls_provider"] = "azure"
if self.model_name:
if "model" in kwargs:
# Honor explicit per-call override resolved by super().
pass
elif self.model_name:
if self.model_version and self.model_version not in self.model_name:
params["ls_model_name"] = (
self.model_name + "-" + self.model_version.lstrip("-")