-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Simplify OpenAI inferrence models and use core #21609
Simplify OpenAI inferrence models and use core #21609
Conversation
Hi, @johanste Thanks for your PR. I am workflow bot for review process. Here are some small tips. Any feedback about review process or workflow bot, pls contact swagger and tools team. [email protected] |
Swagger Validation Report
|
Rule | Message |
---|---|
HowToFix |
Unknown word (apiview), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L10:28 |
HowToFix |
Unknown word (apiview), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L20:37 |
HowToFix |
Unknown word (globby), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L98:10 |
HowToFix |
Unknown word (picocolors), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L104:10 |
HowToFix |
Unknown word (nodelib), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L201:20 |
HowToFix |
Unknown word (scandir), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L201:31 |
HowToFix |
Unknown word (nodelib), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L206:11 |
HowToFix |
Unknown word (nodelib), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L213:20 |
HowToFix |
Unknown word (nodelib), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L221:20 |
HowToFix |
Unknown word (scandir), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L226:22 |
HowToFix |
Unknown word (fastq), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L227:10 |
HowToFix |
Unknown word (cliui), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L334:19 |
HowToFix |
Unknown word (fastq), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L439:19 |
HowToFix |
Unknown word (reusify), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L444:10 |
HowToFix |
Unknown word (domexception), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L462:15 |
HowToFix |
Unknown word (formdata), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L480:19 |
HowToFix |
Unknown word (globby), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L510:19 |
HowToFix |
Unknown word (extglob), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L553:22 |
HowToFix |
Unknown word (extglob), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L574:13 |
HowToFix |
Unknown word (kleur), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L609:19 |
HowToFix |
Unknown word (picomatch), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L639:10 |
HowToFix |
Unknown word (domexception), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L673:24 |
HowToFix |
Unknown word (formdata), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L698:10 |
HowToFix |
Unknown word (opencollective), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L704:18 |
HowToFix |
Unknown word (picocolors), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L751:19 |
HowToFix |
Unknown word (picomatch), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L756:19 |
HowToFix |
Unknown word (kleur), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L786:10 |
HowToFix |
Unknown word (sisteransi), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L787:10 |
HowToFix |
Unknown word (reusify), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L836:19 |
HowToFix |
Unknown word (iojs), please fix the error or add words to ./custom-words.txt path: specification/cognitiveservices/OpenAI.Inference/package-lock.json#L841:10 |
️❌
CadlValidation: 4 Errors, 20 Warnings failed [Detail]
Rule | Message |
---|---|
MissingExamplesDirectory |
"details":"The 'examples' directory is missing in the cadl folder specification/cognitiveservices/OpenAI.Authoring, please ensure the 'examples' is added in the PR." |
InConsistentSwagger |
"details":"The generated swagger file 2022-06-01-preview/openapi.json from cadl specification/cognitiveservices/OpenAI.Authoring is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/cognitiveservices/data-plane/AzureOpenAI/authoring/preview/2022-06-01-preview/azureopenai.json' in PR, please make sure the swagger is consistent with the generated swagger. You can find the difference in the pipeline log." |
MissingExamplesDirectory |
"details":"The 'examples' directory is missing in the cadl folder specification/cognitiveservices/OpenAI.Inference, please ensure the 'examples' is added in the PR." |
InConsistentSwagger |
"details":"The generated swagger file 2022-06-01-preview/openapi.json from cadl specification/cognitiveservices/OpenAI.Inference is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/cognitiveservices/data-plane/AzureOpenAI/authoring/preview/2022-06-01-preview/azureopenai.json' in PR, please make sure the swagger is consistent with the generated swagger. You can find the difference in the pipeline log." |
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L128 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L160 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L150 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L12 |
|
The ModelProperty named 'object' should have a documentation or description, please use decorator @doc to add it. Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L26 |
|
The Model named 'Embedding' should have a documentation or description, please use decorator @doc to add it. Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L35 |
|
The ModelProperty named 'embedding' should have a documentation or description, please use decorator @doc to add it. Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L37 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L21 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L47 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L96 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L109 |
|
The Model named 'Usage' should have a documentation or description, please use decorator @doc to add it. Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L30 |
|
The ModelProperty named 'total_tokens' should have a documentation or description, please use decorator @doc to add it. Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L32 |
|
The names of Property types must use camelCase Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L32 |
|
Unions containing multiple model types cannot be emitted to OpenAPI v2 unless the union is between one model type and 'null'. Location: cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl#L22 |
|
Unions containing multiple model types cannot be emitted to OpenAPI v2 unless the union is between one model type and 'null'. Location: cognitiveservices/OpenAI.Inference/models/completions.create.cadl#L124 |
|
"details":"The configuration 'output-file' for '@azure-tools/cadl-autorest' is missing in the cadl-project.yaml under folder specification/cognitiveservices/OpenAI.Authoring, please ensure it is added in the configuration of the emitter '@azure-tools/cadl-autorest'." |
|
"details":"The configuration 'azure-resource-provider-folder' for '@azure-tools/cadl-autorest' is missing in the cadl-project.yaml under folder specification/cognitiveservices/OpenAI.Authoring, please ensure it is added in the configuration of the emitter '@azure-tools/cadl-autorest'." |
|
"details":"The configuration 'output-file' for '@azure-tools/cadl-autorest' is missing in the cadl-project.yaml under folder specification/cognitiveservices/OpenAI.Inference, please ensure it is added in the configuration of the emitter '@azure-tools/cadl-autorest'." |
|
"details":"The configuration 'azure-resource-provider-folder' for '@azure-tools/cadl-autorest' is missing in the cadl-project.yaml under folder specification/cognitiveservices/OpenAI.Inference, please ensure it is added in the configuration of the emitter '@azure-tools/cadl-autorest'." |
️️✔️
PR Summary succeeded [Detail] [Expand]
Validation passes for Summary.
Swagger Generation Artifacts
|
Rule | Message |
---|---|
RestBuild error |
"logUrl":"https://apidrop.visualstudio.com/Content%20CI/_build/results?buildId=336295&view=logs&j=fd490c07-0b22-5182-fac9-6d67fe1e939b", "detail":"Run.ps1 failed with exit code 1 " |
️️✔️
SDK Breaking Change Tracking succeeded [Detail] [Expand]
Breaking Changes Tracking
Swagger pipeline restarted successfully. If there is ApiView generated, it will be updated in this comment. |
…b.com/Azure/azure-rest-api-specs into feature/cognitiveservices/openai-cadl # Conflicts: # specification/cognitiveservices/OpenAI.Inference/cadl-output/2022-06-01-preview/openapi.json # specification/cognitiveservices/OpenAI.Inference/cadl-output/apiview/apiview.json # specification/cognitiveservices/OpenAI.Inference/models/completions.create.cadl # specification/cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl # specification/cognitiveservices/OpenAI.Inference/routes.cadl
specification/cognitiveservices/OpenAI.Inference/models/completions.create.cadl
Outdated
Show resolved
Hide resolved
…b.com/Azure/azure-rest-api-specs into feature/cognitiveservices/openai-cadl # Conflicts: # specification/cognitiveservices/OpenAI.Inference/cadl-project.yaml
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.
Thank you for all the feedback!
specification/cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl
Outdated
Show resolved
Hide resolved
@doc("Request ID for troubleshooting purposes") | ||
@header "apim-request-id": string; | ||
@doc("Id for completion response") | ||
id?: string; | ||
@doc("Object for completion response") | ||
object?: string; | ||
object: "text_completion"; |
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.
I don't know what this type represents or where it could be defined. Could you point me to where it is defined?
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.
@johanste what is this?
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.
I see several object: "some_string_literal"
in various models. Are these discriminators?
specification/cognitiveservices/OpenAI.Inference/models/completions.create.cadl
Show resolved
Hide resolved
specification/cognitiveservices/OpenAI.Inference/models/completions.create.cadl
Show resolved
Hide resolved
* Initial commit. * Commit OpenAI inference cadl files. * use non-deprecated service decorator * Fixes to main * Reverted changes * use latest cadl to sync with vs code properly * cadl compilation works for authoring (but it is correct?) * Cleaned up routes and model for Inference REST CADL spec * Added cadl-output to .gitignore file and removed error response * Implemented polymorphic return for endpoint * enable Files_Import as non-standard operation, use standard operation names * Authoring CADL now emits openAPI schema almost identical to current Authoring schema * Empty model used for polymorphic expectation in embedding endpoint * Renamed models to match convention * Renamed completions related models * Adjusted comment for embeddings body types * Split up models.cadl into completions and embeddings files * Renamed models * Refactored model names * Removed redundants bits of model names * added headers * Added header to correct model * break up monolithic routes and model cadl files * add namespace to all models * Removed gitIgnore file and changed files to not have domain related namespaces * Finished embeddings endpoint and verified against source json * Verified round trip for swagger * Almost done with security types * Configured correctly OAth2 * Add Auth and OAuth2 to service (thanks Jose!) * Add auth and OAuth to openapi json * Review comments * Review comments * camel casing * add versionedDependency * better versioning * Added the apiview emitter to OpenAI.Inference endpoints * PR feedback for Inference endpoints * Feature/cognitiveservices/openai cadl (#21574) * Added openai specific list API op template. * Simplified OAI authoring cadl * update package versions, correct camelCase warning in common * remove commented out models, changed AcceptedResponse to CreatedResponse * Reverted completion to use snake_casing and removed the Response and Request namespaces * reverted to snake_casing and removed Request namespace for embeddings * Added missing namespace declaration in embeddings * Updated dependencies and enabled csharp emitter for Inference * use string literals for now as enum value types (TypeDiscriminatorKnownValues) not supported in csharp emitter * Add TODO to TypeDiscriminatorKnownValues def * More specific route operation names, use snake casing for all model fields * Added more options to csharp emitter * Simplify OpenAI inferrence models and use core (#21609) * Simplify OpenAI inferrence models and use core * Simplified and corrected Cadl type usage for OpenAI.Inference * Fix camel case issues. Co-authored-by: tjprescott <[email protected]> * Upgrade Cadl file to 0.38 for OpenAI.Authoring service (#22104) * Upgrade Cadl file to 0.38 * Upgrade the package.json file and relevant cadl decorator * Embedding in Azure do not support integer (#22091) * Fix auth in OpenAI CADL (#22191) * Change aliases to models, renamed model Embedding to EmbeddingItem to avoid conflicts, and Completion types * Changed prompt into string[][] * update package name (#22312) * Archboard feedback (#22315) * Archboard feedback * Disable stream for now * Rename to options * Fix operation name (#22319) * Feature/openai add missing usage (#22337) * add new API version and usage field on completions and embeddings * typo * Added docs for Usage classes in completions and embeddings * Added versioning mark for new usage model * Added disambiguation for names and removed unnecessary versioning decorator * Removed unused version bump * Removed unused version from enum * Removed wrong annotation --------- Co-authored-by: Jose Alvarez <[email protected]> * Update main.cadl (#22362) * Embeddings model and field documentation and fix to models (#22368) * Moved usage to the response object of embeddings and added some basic documentation to models and fields * Fixed typo * Update specification/cognitiveservices/OpenAI.Inference/models/embeddings.create.cadl --------- Co-authored-by: Laurent Mazuel <[email protected]> * Removing Model from model name and removing unnecessary aliases (#22390) * updated deps and added visibility decorator to deploymentId (#22417) * Made CompletionsOptions.model optional again * Removing ...Models namespace in the C# classes (#22449) * AOAI: fix CompletionsUsage model (#22439) --------- Co-authored-by: tjprescott <[email protected]> Co-authored-by: Glenn Harper <[email protected]> Co-authored-by: Jose Alvarez <[email protected]> Co-authored-by: Glenn Harper <[email protected]> Co-authored-by: Johan Stenberg (MSFT) <[email protected]> Co-authored-by: Mary Gao <[email protected]> Co-authored-by: m-nash <[email protected]> Co-authored-by: Jose Alvarez <[email protected]> Co-authored-by: Travis Wilson <[email protected]>
Simplify object model + use azure core actions for openai inferrence...