Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After applying this fix, there's an inconsistency in the codebase. The ComparisonFilter class (line 2674) has value: Union[str, int, bool, list["_types.ComparisonFilterValueItems"]] where str, int, and bool are NOT quoted. This creates inconsistent handling of Union types with built-in types across the codebase. Consider whether the fix should be applied consistently to all similar patterns, or if there's a specific reason why EasyInputMessage.content requires quoted str while ComparisonFilter.value does not.

Copilot uses AI. Check for mistakes.
visibility=["read", "create", "update", "delete", "query"]
)
"""Text, image, or audio input to the model, used to generate a response. Can also contain
Expand All @@ -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: ...

Expand Down
3 changes: 3 additions & 0 deletions sdk/ai/azure-ai-projects/post-emitter-fixes.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern in this PowerShell command only fixes the content field in EasyInputMessage, but there's another similar field output in class InputItemCustomToolCallOutput (line 6607 of _models.py) that has the same pattern Union[str, list["_models.FunctionAndCustomToolCallOutput"]] and likely needs the same fix. Consider updating the pattern to cover both cases, or adding a separate command for the output field.

Suggested change
powershell -Command "(Get-Content azure\ai\projects\models\_models.py) -replace 'output: Union\[str, list\[\"_models\.FunctionAndCustomToolCallOutput\"\]\]', 'output: Union[\"str\", list[\"_models.FunctionAndCustomToolCallOutput\"]]' | Set-Content azure\ai\projects\models\_models.py"

Copilot uses AI. Check for mistakes.
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:
Expand Down
Loading