-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix emitted code to avoid serialization error of content field in class EasyInputMessage
#45299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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. | ||||||
dargilco marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| 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" | ||||||
|
|
||||||
|
||||||
| 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" |
There was a problem hiding this comment.
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
ComparisonFilterclass (line 2674) hasvalue: Union[str, int, bool, list["_types.ComparisonFilterValueItems"]]wherestr,int, andboolare 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 whyEasyInputMessage.contentrequires quotedstrwhileComparisonFilter.valuedoes not.