Skip to content
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

Adding 'model' property to ChatCompletions. #28554

Merged
merged 4 commits into from
Apr 2, 2024

Conversation

richardpark-msft
Copy link
Member

ChatCompletions (the response from GetChatCompletions) is missing the model property that's in OpenAI's docs and in our example output in our docs.

This adds it back in, with the C# project to rename it to DeploymentName.

…own docs, in OpenAI docs but is missing from our TSP for some reason.
Copy link

openapi-pipeline-app bot commented Apr 2, 2024

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see https://aka.ms/azsdk/specreview/merge.

Copy link

openapi-pipeline-app bot commented Apr 2, 2024

Swagger Validation Report

️❌BreakingChange: 5 Errors, 0 Warnings failed [Detail]
Compared specs (v0.10.7) new version base version
generated.json 2023-06-01-preview(1236daa) 2023-06-01-preview(main)
generated.json 2023-07-01-preview(1236daa) 2023-07-01-preview(main)
generated.json 2024-02-15-preview(1236daa) 2024-02-15-preview(main)
generated.json 2024-03-01-preview(1236daa) 2024-03-01-preview(main)
generated.json 2023-05-15(1236daa) 2023-05-15(main)
Rule Message
1041 - AddedPropertyInResponse The new version has a new property 'model' in response that was not found in the old version.
New: inference/preview/2023-06-01-preview/generated.json#L489:7
Old: inference/preview/2023-06-01-preview/generated.json#L489:7
1041 - AddedPropertyInResponse The new version has a new property 'model' in response that was not found in the old version.
New: inference/preview/2023-07-01-preview/generated.json#L489:7
Old: inference/preview/2023-07-01-preview/generated.json#L489:7
1041 - AddedPropertyInResponse The new version has a new property 'model' in response that was not found in the old version.
New: inference/preview/2024-02-15-preview/generated.json#L1780:7
Old: inference/preview/2024-02-15-preview/generated.json#L1780:7
1041 - AddedPropertyInResponse The new version has a new property 'model' in response that was not found in the old version.
New: inference/preview/2024-03-01-preview/generated.json#L1780:7
Old: inference/preview/2024-03-01-preview/generated.json#L1780:7
1041 - AddedPropertyInResponse The new version has a new property 'model' in response that was not found in the old version.
New: inference/stable/2023-05-15/generated.json#L310:7
Old: inference/stable/2023-05-15/generated.json#L310:7
️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️CredScan succeeded [Detail] [Expand]
There is no credential detected.
️⚠️LintDiff: 0 Warnings warning [Detail]
Compared specs (v2.2.0) new version base version
release_2023_05_15_autogen release_2023_05_15_autogen(1236daa) release_2023_05_15_autogen(main)
release_2023_06_01_preview_autogen release_2023_06_01_preview_autogen(1236daa) release_2023_06_01_preview_autogen(main)
release_2023_07_01_preview_autogen release_2023_07_01_preview_autogen(1236daa) release_2023_07_01_preview_autogen(main)
release_2024_02_15_preview_autogen release_2024_02_15_preview_autogen(1236daa) release_2024_02_15_preview_autogen(main)

The following errors/warnings exist before current PR submission:

Only 30 items are listed, please refer to log for more details.

Rule Message
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-06-01-preview/generated.json#L423
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-06-01-preview/generated.json#L494
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-06-01-preview/generated.json#L793
DefaultInEnum Default value should appear in the enum constraint for a schema
Location: inference/preview/2023-06-01-preview/generated.json#L1289
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-06-01-preview/generated.json#L1353
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-07-01-preview/generated.json#L423
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-07-01-preview/generated.json#L494
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-07-01-preview/generated.json#L846
DefaultInEnum Default value should appear in the enum constraint for a schema
Location: inference/preview/2023-07-01-preview/generated.json#L1386
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2023-07-01-preview/generated.json#L1450
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2024-02-15-preview/generated.json#L1785
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2024-02-15-preview/generated.json#L2428
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/preview/2024-02-15-preview/generated.json#L3430
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/stable/2023-05-15/generated.json#L315
IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
Location: inference/stable/2023-05-15/generated.json#L600
⚠️ SecurityDefinitionDescription Security definition should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L46
⚠️ SecurityDefinitionDescription Security definition should have a description.
Location: inference/preview/2023-06-01-preview/generated.json#L51
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L64
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L70
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L115
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L121
⚠️ PaginationResponse Operation might be pageable. Consider adding the x-ms-pageable extension.
Location: inference/preview/2023-06-01-preview/generated.json#L165
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L166
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L172
⚠️ LongRunningOperationsOptionsValidator A LRO Post operation with return schema must have 'x-ms-long-running-operation-options' extension enabled.
Location: inference/preview/2023-06-01-preview/generated.json#L215
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L217
⚠️ OperationId OperationId should be of the form 'Noun_Verb'
Location: inference/preview/2023-06-01-preview/generated.json#L269
⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: inference/preview/2023-06-01-preview/generated.json#L275
⚠️ EnumInsteadOfBoolean Booleans properties are not descriptive in all cases and can make them to use, evaluate whether is makes sense to keep the property as boolean or turn it into an enum.
Location: inference/preview/2023-06-01-preview/generated.json#L598
⚠️ PropertyType Property should have a defined type.
Location: inference/preview/2023-06-01-preview/generated.json#L676
️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️SwaggerAPIView succeeded [Detail] [Expand]
️❌TypeSpecAPIView: 0 Errors, 0 Warnings failed [Detail]
️️✔️ModelValidation succeeded [Detail] [Expand]
Validation passes for ModelValidation.
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️PoliCheck succeeded [Detail] [Expand]
Validation passed for PoliCheck.
️️✔️SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
Validation passes for Lint(RPaaS).
️️✔️PR Summary succeeded [Detail] [Expand]
Validation passes for Summary.
️️✔️Automated merging requirements met succeeded [Detail] [Expand]
Posted by Swagger Pipeline | How to fix these errors?

Copy link

openapi-pipeline-app bot commented Apr 2, 2024

Swagger Generation Artifacts

️️✔️ApiDocPreview succeeded [Detail] [Expand]
 Please click here to preview with your @microsoft account. 
️❌ azure-sdk-for-net-track2 failed [Detail]
  • Failed [Logs] Generate from 2eeb42fb2117e1286859fc5e87f02b4447a60c97. SDK Automation 14.0.0
    command	pwsh ./eng/scripts/Automation-Sdk-Init.ps1 ../azure-sdk-for-net_tmp/initInput.json ../azure-sdk-for-net_tmp/initOutput.json
    warn		specification/cognitiveservices/data-plane/AzureOpenAI/inference/readme.md skipped due to azure-sdk-for-net-track2 not found in swagger-to-sdk
    command	pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1 ../azure-sdk-for-net_tmp/generateInput.json ../azure-sdk-for-net_tmp/generateOutput.json
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGeneratePackage: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:131�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1mLine |�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m 131 | �[0m               �[36;1mGeneratePackage `�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m     | �[31;1m               ~~~~~~~~~~~~~~~~~�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m�[31;1m�[31;1m�[36;1m     | �[31;1mFailed to build sdk. exit code: False�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGeneratePackage: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:131�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1mLine |�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m 131 | �[0m               �[36;1mGeneratePackage `�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m     | �[31;1m               ~~~~~~~~~~~~~~~~~�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m�[31;1m�[31;1m�[36;1m     | �[31;1mFailed to packe sdk. exit code: False�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGet-ChildItem: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/automation/GenerateAndBuildLib.ps1:807�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1mLine |�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m 807 | �[0m … rtifacts += �[36;1mGet-ChildItem $artifactsPath -Filter *.nupkg -exclude *.s�[0m …�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m     | �[31;1m               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m�[31;1m�[31;1m�[36;1m     | �[31;1mCannot find path�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m�[31;1m�[31;1m�[36;1m�[31;1m�[36;1m     | �[31;1m'/mnt/vss/_work/1/s/azure-sdk-for-net/artifacts/packages/Debug/' because�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m�[31;1m�[31;1m�[36;1m�[31;1m�[36;1m�[31;1m�[36;1m     | �[31;1mit does not exist.�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1mGeneratePackage: �[0m/mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/Invoke-GenerateAndBuildV2.ps1:131�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1mLine |�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m 131 | �[0m               �[36;1mGeneratePackage `�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m     | �[31;1m               ~~~~~~~~~~~~~~~~~�[0m
    cmderr	[Invoke-GenerateAndBuildV2.ps1] �[31;1m�[0m�[36;1m�[36;1m�[0m�[36;1m�[0m�[36;1m�[31;1m�[31;1m�[36;1m     | �[31;1mFailed to generate sdk artifact�[0m
  • Azure.AI.OpenAI [View full logs]  [Preview SDK Changes]
    info	[Changelog]
️⚠️ azure-sdk-for-java warning [Detail]
  • ⚠️Warning [Logs] Generate from 2eeb42fb2117e1286859fc5e87f02b4447a60c97. SDK Automation 14.0.0
    command	./eng/mgmt/automation/init.sh ../azure-sdk-for-java_tmp/initInput.json ../azure-sdk-for-java_tmp/initOutput.json
    cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 24.0
    cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
    cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 24.0
    cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
    warn		specification/cognitiveservices/data-plane/AzureOpenAI/inference/readme.md skipped due to azure-sdk-for-java not found in swagger-to-sdk
    command	./eng/mgmt/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
    cmderr	[generate.py]
    cmderr	[generate.py] npm notice New minor version of npm available! 10.2.4 -> 10.5.0
    cmderr	[generate.py] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.5.0>
    cmderr	[generate.py] npm notice Run `npm install -g [email protected]` to update!
    cmderr	[generate.py] npm notice
  • ️✔️azure-ai-openai [View full logs]  [Preview SDK Changes]
️❌ azure-sdk-for-js failed [Detail]
  • Failed [Logs] Generate from 2eeb42fb2117e1286859fc5e87f02b4447a60c97. SDK Automation 14.0.0
    command	sh .scripts/automation_init.sh ../azure-sdk-for-js_tmp/initInput.json ../azure-sdk-for-js_tmp/initOutput.json
    warn	File azure-sdk-for-js_tmp/initOutput.json not found to read
    warn		specification/cognitiveservices/data-plane/AzureOpenAI/inference/readme.md skipped due to azure-sdk-for-js not found in swagger-to-sdk
    command	sh .scripts/automation_generate.sh ../azure-sdk-for-js_tmp/generateInput.json ../azure-sdk-for-js_tmp/generateOutput.json
    cmderr	[automation_generate.sh] [ERROR] Error:
    cmderr	[automation_generate.sh] [ERROR] An error occurred while run build for typespec project: "specification/cognitiveservices/OpenAI.Inference":
    cmderr	[automation_generate.sh] [ERROR] Err: Error: Command failed: rush build -t @azure/openai
    cmderr	[automation_generate.sh] [ERROR] Stderr: "null"
    cmderr	[automation_generate.sh] [ERROR] Stdout: "null"
    cmderr	[automation_generate.sh] [ERROR] ErrorStack: "Error: Command failed: rush build -t @azure/openai
    cmderr	[automation_generate.sh] [ERROR]     at checkExecSyncError (node:child_process:885:11)
    cmderr	[automation_generate.sh] [ERROR]     at Object.execSync (node:child_process:957:15)
    cmderr	[automation_generate.sh] [ERROR]     at Object.<anonymous> (/home/cloudtest/.nvm/versions/node/v18.15.0/lib/node_modules/@azure-tools/js-sdk-release-tools/dist/llc/generateRLCInPipeline/generateRLCInPipeline.js:209:29)
    cmderr	[automation_generate.sh] [ERROR]     at Generator.next (<anonymous>)
    cmderr	[automation_generate.sh] [ERROR]     at fulfilled (/home/cloudtest/.nvm/versions/node/v18.15.0/lib/node_modules/@azure-tools/js-sdk-release-tools/node_modules/tslib/tslib.js:112:62)
    cmderr	[automation_generate.sh] [ERROR]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
  • @azure/openai [View full logs]  [Preview SDK Changes]
    info	[Changelog]
    error	breakingChangeTracking is enabled, but version or changelogItem is not found in output.
Posted by Swagger Pipeline | How to fix these errors?

Copy link

openapi-pipeline-app bot commented Apr 2, 2024

Generated ApiView

Language Package Name ApiView Link
Java azure-ai-openai https://apiview.dev/Assemblies/Review/0b875c11102a447c8807ad710b3d4e7c?revisionId=5352984e7dbd4b25be421840dab010eb
Swagger AzureOpenAI https://apiview.dev/Assemblies/Review/6693675ace534d4aa3159f202a195962?revisionId=88899b3714f04e3599bce9a47b1ca9fc
TypeSpec OpenAI.Inference Create ApiView failed. To get help, please see [aka.ms/azsdk/pr-getting-help](https://aka.ms/azsdk/pr-getting-help).

@richardpark-msft richardpark-msft marked this pull request as ready for review April 2, 2024 02:17
…g spaces that shouldn't be there)

- Checking in the generated.json files.
@AzureRestAPISpecReview AzureRestAPISpecReview added data-plane VersioningReviewRequired <valid label in PR review process>add this label when versioning review is required labels Apr 2, 2024
@johanste johanste added the Versioning-Approved-BugFix https://github.com/Azure/azure-sdk-tools/issues/6374 label Apr 2, 2024
@richardpark-msft richardpark-msft enabled auto-merge (squash) April 2, 2024 18:27
@richardpark-msft richardpark-msft merged commit 2a96c42 into Azure:main Apr 2, 2024
29 of 32 checks passed
@mario-guerra
Copy link
Member

@richardpark-msft is the service team aware of and in agreement with these changes?

@richardpark-msft
Copy link
Member Author

@richardpark-msft is the service team aware of and in agreement with these changes?

I'd worked with @trrwilson and @johanste on this. Apparently this was an SDK omission and, now that we have a good use case for it, we're just bringing it back.

@richardpark-msft richardpark-msft deleted the api-ai-add-model branch April 2, 2024 21:24
wiboris pushed a commit to wiboris/azure-rest-api-specs that referenced this pull request May 7, 2024
* Adding 'model' property. It's present in our example response in our own docs, in OpenAI docs but is missing from our TSP for some reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-plane TypeSpec Authored with TypeSpec Versioning-Approved-BugFix https://github.com/Azure/azure-sdk-tools/issues/6374 VersioningReviewRequired <valid label in PR review process>add this label when versioning review is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants