-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[AACS][GA] 2024-09-01 Azure AI Content Safety #29866
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
Conversation
Next Steps to Merge✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge. |
Swagger Generation Artifacts
|
Generated ApiView
|
|
If some commit is for testing, it is advised to be done in a different branch and on a draft PR (draft so it does not loop in reviewers, PR as the automation runs so you can see the result). We'd hope this PR to be clean for review. |
|
@mikekistler , can you help review and approve this PR? |
mikekistler
left a comment
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.
Some of these comments are minor but I think splitting the result schema is an important change.
You'll also need to take this through breaking change review.
| "description": "BlocklistItem content.", | ||
| "maxLength": 128 | ||
| "description": "BlocklistItem content. The length is counted using Unicode code point.", | ||
| "maxLength": 1000 |
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.
Should not change maxLength in released API definitions.
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.
How can we just apply the new maxLength for the new version and keep the original in released version?=
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.
Also I don't quite understand why a larger maxLength is considered as a breaking change. With a larger maxLength, the existing client implementation won't be affected.
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 think Mike's concern is that this change applies to 2023-10-01 api-version, not the new 2024-09-01. And the general rule is there should be no API change to existing api-version.
What is the maxLength for this API in 2023-10-01?
Currently I am not aware of a way to versioning the decorator in TypeSpec. Maybe you can check in TypeSpec Discussion channel.
An ugly fallback (if no other alternative) would be @remove then @add.
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.
maxLength in 2023-10-01 is 128, and we don't want to change it, but we're going to increase it to 1000 in 2024-09-01.
@mikekistler , can you help advise further?
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.
Please come to Breaking Change office hours today at 10AM PT so we can discuss.
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.
@weidongxu-microsoft , thank you for the suggestion. I tried below but both not work. Can you help advise further how to use the remove/add to do the fallback? I posted this question into the TypeSpec Discussion as well.
@removed(ContentSafety.Versions.v2024_09_01)
@doc("BlocklistItem content. The length is counted using Unicode code point.")
@maxlength(128)
text: string;
@added(ContentSafety.Versions.v2024_09_01)
@doc("BlocklistItem content. The length is counted using Unicode code point.")
@maxlength(1000)
text: string;
@removed(ContentSafety.Versions.v2024_09_01)
@added(ContentSafety.Versions.v2024_09_01)
@doc("BlocklistItem content. The length is counted using Unicode code point.")
@maxlength(1000)
text: string;
I think Mike's concern is that this change applies to 2023-10-01 api-version, not the new 2024-09-01. And the general rule is there should be no API change to existing api-version.
What is the maxLength for this API in 2023-10-01?
Currently I am not aware of a way to versioning the decorator in TypeSpec. Maybe you can check in TypeSpec Discussion channel. An ugly fallback (if no other alternative) would be
@removethen@add.
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 assume option1 would give you a "duplicate entity" error?
The answer from Timothee and Mark is better than mine (they are the expert on TypeSpec).
I guess you would have to discuss this with Mike on breaking change office hour. Do show this discussion in TypeSpec Discussion.
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.
Reverted it to 128.
specification/cognitiveservices/data-plane/ContentSafety/stable/2024-09-01/contentsafety.json
Outdated
Show resolved
Hide resolved
specification/cognitiveservices/data-plane/ContentSafety/stable/2024-09-01/contentsafety.json
Outdated
Show resolved
Hide resolved
| "type": "array", | ||
| "description": "The documents needs to be analyzed, which may contain direct or indirect injection attacks.", | ||
| "items": { | ||
| "type": "string" |
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.
Is there a maxLength for the documents?
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.
the maxItems is 5 currently, while we are going to increase it soon. I'm wondering if adding the limit here is the best practice, or we just do the validation at runtime and avoid changing the schema.
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.
My question was actually about the maxLength of individual documents -- not the number of elements in the array. You previously had maxLength: 10000 on userPrompt so I was suggesting something similar here. But I see that you have removed that. I'm not a fan of omitting information from a REST API definition so that it can be "silently" changed later, but that's maybe a discussion we can put off.
specification/cognitiveservices/data-plane/ContentSafety/stable/2024-09-01/contentsafety.json
Show resolved
Hide resolved
…e/2024-09-01/contentsafety.json Co-authored-by: Mike Kistler <[email protected]>
…e/2024-09-01/contentsafety.json Co-authored-by: Mike Kistler <[email protected]>
…esult and DocumentInjectionAnalysisResult
…re-rest-api-specs into aacs-stable-20240901
|
@mikekistler , given that we have decided to keep the maxLength in new API version, I think this PR is ready to merge. Can you help review again and sign-off? |
mikekistler
left a comment
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.
Looks good. 👍
| "type": "array", | ||
| "description": "The documents needs to be analyzed, which may contain direct or indirect injection attacks.", | ||
| "items": { | ||
| "type": "string" |
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.
My question was actually about the maxLength of individual documents -- not the number of elements in the array. You previously had maxLength: 10000 on userPrompt so I was suggesting something similar here. But I see that you have removed that. I'm not a fan of omitting information from a REST API definition so that it can be "silently" changed later, but that's maybe a discussion we can put off.
Data Plane API Specification Update Pull Request
Tip
Overwhelmed by all this guidance? See the
Getting helpsection at the bottom of this PR description.PR review workflow diagram
Please understand this diagram before proceeding. It explains how to get your PR approved & merged.
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.
Is this review for (select one):
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.
azure-rest-api-specs/specification/cognitiveservices/ContentSafety/models.tsp
Line 385 in 9280478
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 ApiViewcomment 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
Getting help
write accessper aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositoriesNext Steps to Mergecomment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.and https://aka.ms/ci-fix.
queuedstate, please add a comment with contents/azp run.This should result in a new comment denoting a
PR validation pipelinehas started and the checks should be updated after few minutes.fix #29891