azure-rest-api-specs icon indicating copy to clipboard operation
azure-rest-api-specs copied to clipboard

Data Plane AzureML/Azure-AI - Prompt Asset

Open diondrapeck opened this issue 1 year ago • 5 comments

Data Plane API - Pull Request

Adding a Prompt subclass of AssetVersion for use with prompt engineering tasks

API Info: The Basics

Most of the information about your service should be captured in the issue that serves as your API Spec engagement record.

  • Link to API Spec engagement record issue:

Is this review for (select one):

  • [ ] a private preview
  • [x] a public preview
  • [ ] GA release

Change Scope

This section will help us focus on the specific parts of your API that are new or have been modified.
Please share a link to the design document for the new APIs, a link to the previous API Spec document (if applicable), and the root paths that have been updated.

  • Design Document:
  • Previous API Spec Doc:
  • Updated paths:

Viewing API changes

For convenient view of the API changes made by this PR, refer to the URLs provided in the table in the Generated ApiView comment added to this PR. You can use ApiView to show API versions diff.

Suppressing failures

If one or multiple validation error/warning suppression(s) is detected in your PR, please follow the Swagger-Suppression-Process to get approval.

❔Got questions? Need additional info?? We are here to help!

Contact us!

The Azure API Review Board is dedicated to helping you create amazing APIs. You can read about our mission and learn more about our process on our wiki.

Click here for links to tools, specs, guidelines & other good stuff

Tooling

Guidelines & Specifications

Helpful Links

Checks stuck in `queued` state? If the PR CI checks appear to be stuck in `queued` state, please add a comment with contents `/azp run`. This should result in a new comment denoting a `PR validation pipeline` has started and the checks should be updated after few minutes.

diondrapeck avatar Apr 10 '24 04:04 diondrapeck

Next Steps to Merge

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

Swagger Validation Report

️❌BreakingChange: 7 Errors, 0 Warnings failed [Detail]
Compared specs (v0.10.9) new version base version
azure-ai-assets.json 2024-04-01-preview(ca8829c) 2024-04-01-preview(main)
Rule Message
1025 - RequiredStatusChange The 'required' status changed from the old version('True') to the new version('False').
New: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L518:7
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L514:7
1025 - RequiredStatusChange The 'required' status changed from the old version('True') to the new version('False').
New: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L415:7
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L410:7
1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L132:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L132:11
1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L177:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L176:11
1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L222:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L220:11
1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L301:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L298:11
1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L351:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L347:11
️⚠️Breaking Change(Cross-Version): 8 Warnings warning [Detail]
Compared specs (v0.10.9) new version base version
azure-ai-assets.json 2024-05-01-preview(ca8829c) 2024-04-01-preview(main)

The following breaking changes are detected by comparison with the latest preview version:

Rule Message
:warning: 1025 - RequiredStatusChange The 'required' status changed from the old version('True') to the new version('False').
New: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L852:7
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L514:7
:warning: 1025 - RequiredStatusChange The 'required' status changed from the old version('True') to the new version('False').
New: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L749:7
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L410:7
:warning: 1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L132:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L132:11
:warning: 1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L177:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L176:11
:warning: 1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L222:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L220:11
:warning: 1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L301:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L298:11
:warning: 1036 - ConstraintChanged The new version has a different 'pattern' value than the previous one.
New: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L351:11
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L347:11
:warning: 1046 - RemovedOptionalParameter The optional parameter 'orderBy' was removed in the new version.
Old: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L236:11
️️✔️CredScan succeeded [Detail] [Expand]
There is no credential detected.
️⚠️LintDiff: 3 Warnings warning [Detail]
Compared specs (v2.2.2) new version base version
package-2024-04-01-preview package-2024-04-01-preview(ca8829c) package-2024-04-01-preview(main)
package-2024-05-01-preview package-2024-05-01-preview(ca8829c) default(main)

[must fix]The following errors/warnings are introduced by current PR:

Rule Message Related RPC [For API reviewers]
:warning: ParameterDefaultNotAllowed A required parameter should not specify a default value.
Location: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L571
:warning: PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L644
:warning: PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L694


The following errors/warnings exist before current PR submission:

Rule Message
:warning: SecurityDefinitionDescription Security definition should have a description.
Location: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L65
:warning: ParameterDefaultNotAllowed A required parameter should not specify a default value.
Location: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L237
:warning: PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L310
:warning: PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: Microsoft.MachineLearningServices/preview/2024-04-01-preview/azure-ai-assets.json#L360
:warning: SecurityDefinitionDescription Security definition should have a description.
Location: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L65
:warning: ParameterDefaultNotAllowed A required parameter should not specify a default value.
Location: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L237
:warning: PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L310
:warning: PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
Location: Microsoft.MachineLearningServices/preview/2024-05-01-preview/azure-ai-assets.json#L360
️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️SwaggerAPIView succeeded [Detail] [Expand]
️️✔️TypeSpecAPIView succeeded [Detail] [Expand]
️️✔️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?

Swagger Generation Artifacts

️️✔️ApiDocPreview succeeded [Detail] [Expand]
 Please click here to preview with your @microsoft account. 
️❌ azure-sdk-for-python failed [Detail]
  • Code Generator Failed in generating from cb80c5613905e9e83097749c9c14c08cc17e77c9. SDK Automation 14.0.0
    command	sh scripts/automation_init.sh ../azure-sdk-for-python_tmp/initInput.json ../azure-sdk-for-python_tmp/initOutput.json
    cmderr	[automation_init.sh] W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] WARNING: Skipping azure-nspkg as it is not installed.
    cmderr	[automation_init.sh]  notice
    cmderr	[automation_init.sh] npm notice New minor version of npm available! 10.5.0 -> 10.8.0
    cmderr	[automation_init.sh] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.8.0>
    cmderr	[automation_init.sh] npm notice Run `npm install -g [email protected]` to update!
    cmderr	[automation_init.sh] npm notice
    warn		specification/machinelearningservices/data-plane/readme.md skipped due to azure-sdk-for-python not found in swagger-to-sdk
    command	sh scripts/automation_generate.sh ../azure-sdk-for-python_tmp/generateInput.json ../azure-sdk-for-python_tmp/generateOutput.json
    cmdout	[automation_generate.sh] [Autorest]/mnt/vss/_work/1/s/azure-sdk-for-python_tmp/venv-sdk/auto_temp.json does not exist!!!Error happened during codegen
    error	Script return with result [failed] code [1] signal [null] cwd [azure-sdk-for-python]: sh scripts/automation_generate.sh
    warn	Skip package processing as generation is failed
Posted by Swagger Pipeline | How to fix these errors?

could you also remove v2.0 from the generic asset url? Here: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/machinelearningservices/AzureAI.Assets/main.tsp

kseager avatar Apr 17 '24 18:04 kseager

I left a bunch of comments. Many of these are on the existing "Index" type and I apologize that I missed these in the earlier review. Most of these also apply to the new Prompt type -- I just didn't want to try to flag every instance. So please consider all the comments to apply across the whole API even if they are only on specific lines.

Also, I am still uncomfortable with the versioning approach being used here and I think it warrants a deeper review and discussion. I'm not questioning the need to support versioning, but just the specific approach being used, where there are indexes and versions of indexes that are both actually the same thing, but from the URL structure look like different resources.

It isn't necessary to fix all of these in this API version, but I think most should be addressed before the API goes GA, so fixing them as soon as you can is probably best for your users.

We can re-open the discussion before GA. However, this PR is truly meant to be an iteration off of the last PR. It's unfortunate that these reservations were not discussed more thoroughly during the Index API PR, where I had introduced this model and was hoping to address all concerns at that time in order to shelter this PR from those discussions.

As mentioned before, this modeling for "assets" was already GA'd and published in ARM as an accepted REST API model for versioning resources: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/mfe.json - for example resource ..data/{name}/versions Although there is always room for improvement, we already have experience working with customers actively on this versioning model and have a proof point of it working for our purposes. The reason we strongly prefer to adhere to this model is for two reasons

  1. We want to interop with our existing GA'd ARM asset set as much as possible
  2. It's an ideal model for creating lineage because we can keep "copies" of each version. This not only allows us to reference them uniquely, but also make select updates to them individually. In this sense we are treating them as separate resources.

If you still require a deeper review, then can we please address in our next API version? At least going into that API we will be aware of the pre-existing review requirement. Thank you for your understanding in this matter.

kseager avatar May 03 '24 17:05 kseager

I really think you need to fix this PR to not break or even change released API versions.

It didn't at the time I asked you to review - the only new change was removing the 2.0 from the route (which was an approved breaking change in another PR that I simply added here). After addressing some of the comments from the first round, I'm seeing tests failures, so I'll get things back green.

diondrapeck avatar May 15 '24 22:05 diondrapeck

@mikekistler regarding then nextVersion logic. I've updated the descriptions to lay it out, but I'll make sure to explain here.

Index uses the Data team's backend for service calls. This is not something our team controls and this pattern has been GA for years. Their nextVersion logic is configured as follows

  • Any string is allowed to be set as a version (e.g. your example of "one" or "my-favorite")
  • At creation time, Data service screens all the version strings to see if any are integer representations
  • If so and if that value is greater than the last seen integer value, nextVersion becomes that value + 1. If there has never been any integer value supplied, the default nextVersion is 1.

In sum, nextVersion = max(lastIntegerVersion + 1, 1)

diondrapeck avatar May 22 '24 16:05 diondrapeck