mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Restore explicit model_id validation to fix test failures (#4299)
The walrus operator refactor silently dropped the empty-string validation, causing test_init_model_id_kwarg_empty_string to fail. Restore the explicit None check and ValueError raise for empty model_id. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -180,7 +180,10 @@ class AzureOpenAIResponsesClient( # type: ignore[misc]
|
||||
client: AzureOpenAIResponsesClient[MyOptions] = AzureOpenAIResponsesClient()
|
||||
response = await client.get_response("Hello", options={"my_custom_option": "value"})
|
||||
"""
|
||||
if (model_id := kwargs.pop("model_id", None)) and not deployment_name:
|
||||
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)
|
||||
|
||||
# Project client path: create OpenAI client from an Azure AI Foundry project
|
||||
|
||||
Reference in New Issue
Block a user