diff --git a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py index 27b70e37ce48..538af0d1dffe 100644 --- a/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py @@ -3943,7 +3943,7 @@ class EasyInputMessage(InputItem, discriminator="message"): """The role of the message input. One of ``user``, ``assistant``, ``system``, or ``developer``. Required. Is one of the following types: Literal[\"user\"], Literal[\"assistant\"], Literal[\"system\"], Literal[\"developer\"]""" - content: Union[str, list["_models.InputContent"]] = rest_field( + content: Union["str", list["_models.InputContent"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Text, image, or audio input to the model, used to generate a response. Can also contain @@ -3962,7 +3962,7 @@ def __init__( self, *, role: Literal["user", "assistant", "system", "developer"], - content: Union[str, list["_models.InputContent"]], + content: Union["str", list["_models.InputContent"]], status: Optional[Literal["in_progress", "completed", "incomplete"]] = None, ) -> None: ... diff --git a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd index 34f29db3477a..a704810ce700 100644 --- a/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd +++ b/sdk/ai/azure-ai-projects/post-emitter-fixes.cmd @@ -17,6 +17,9 @@ REM Rename `"items_property": items`, to `"items": items` in search_memories and powershell -Command "(Get-Content azure\ai\projects\aio\operations\_operations.py) -replace '\"items_property\": items', '\"items\": items' | Set-Content azure\ai\projects\aio\operations\_operations.py" powershell -Command "(Get-Content azure\ai\projects\operations\_operations.py) -replace '\"items_property\": items', '\"items\": items' | Set-Content azure\ai\projects\operations\_operations.py" +REM Fix content type annotation: replace `content: Union[str, list[...]]` with `content: Union["str", list[...]]`. Otherwise serialization fails. +powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace 'content: Union\[str, list\[\"_models\.InputContent\"\]\]', 'content: Union[\"str\", list[\"_models.InputContent\"]]' | Set-Content azure\ai\projects\models\_models.py" + REM Fix Sphinx issue in class ToolChoiceAllowed, in "tools" property doc string. Everything should be aligned including JSON example, like this: REM """A list of tool definitions that the model should be allowed to call. For the Responses API, the REM list of tool definitions might look like: