Commit 7ad6447
committed
fix(azure-ai): widen response_format types + normalize json_object/text dict shapes
Per @Copilot review:
- widen _merge_options and _normalize_response_format to accept str | ResponseFormatJsonSchemaType | dict | None, matching AzureAIAgent's AgentsApiResponseFormatOption
- map {'type': 'json_object'} and {'type': 'text'} dict shapes to their canonical string form so the Azure SDK sees the expected type
- narrow return type to str | ResponseFormatJsonSchemaType | None (dict is only passed through as an unrecognized escape hatch, never intentionally)
Avoids importing AgentsApiResponseFormatOption directly (would be circular — azure_ai_agent imports from this module). The inline union keeps type checkers satisfied without duplicating the alias definition.1 parent a89215e commit 7ad6447
1 file changed
Lines changed: 10 additions & 4 deletions
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
| 896 | + | |
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
923 | | - | |
| 922 | + | |
| 923 | + | |
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
930 | 930 | | |
931 | | - | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
932 | 938 | | |
933 | 939 | | |
934 | 940 | | |
| |||
0 commit comments