mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Add explicit validation for empty model_id in AzureOpenAIResponsesClient
Reject empty or whitespace-only model_id with ValueError instead of silently passing an empty deployment name downstream. This ensures the test_init_model_id_kwarg_empty_string test correctly validates behavior defined in production code rather than relying on downstream validation. Addresses PR review feedback for #4299. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -181,6 +181,8 @@ class AzureOpenAIResponsesClient( # type: ignore[misc]
|
||||
response = await client.get_response("Hello", options={"my_custom_option": "value"})
|
||||
"""
|
||||
model_id = kwargs.pop("model_id", None)
|
||||
if model_id is not None and not str(model_id).strip():
|
||||
raise ValueError("model_id must not be empty")
|
||||
if model_id is not None and deployment_name is None:
|
||||
deployment_name = str(model_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user