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

Remove project related contract #20

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

129 changes: 0 additions & 129 deletions specification/cognitiveservices/ContentSafety/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ model AnalyzeTextOptions {

@doc("This refers to the type of text analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".")
outputType?: AnalyzeTextOutputType = AnalyzeTextOutputType.FourSeverityLevels;

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("Name of the project. When this field is provided, it means service will analyze the text with specified policy based on the given project name. If project name occurs with other configuration like categories, a bad request error will be returned.")
projectName?: string;
}

@doc("The text analysis response.")
Expand All @@ -70,10 +66,6 @@ model AnalyzeTextResult {

@doc("Analysis result for categories.")
categoriesAnalysis: TextCategoriesAnalysis[];

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("The accept decision made by service.")
accepted?: boolean;
}

@doc("The result of blocklist match.")
Expand All @@ -98,10 +90,6 @@ model TextCategoriesAnalysis {

@doc("The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7.")
severity?: int32;

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("The decision made by service.")
accepted?: boolean;
}

@doc("The image analysis request.")
Expand All @@ -114,10 +102,6 @@ model AnalyzeImageOptions {

@doc("This refers to the type of image analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".")
outputType?: AnalyzeImageOutputType = AnalyzeImageOutputType.FourSeverityLevels;

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("Name of the project. When this field is provided, it means service will analyze the text with specified policy based on the given project name. If project name occurs with other configuration like categories, a bad request error will be returned.")
projectName?: string;
}

@doc("The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels.")
Expand All @@ -134,10 +118,6 @@ model ImageData {
model AnalyzeImageResult {
@doc("Analysis result for categories.")
categoriesAnalysis: ImageCategoriesAnalysis[];

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("The decision made by service.")
accepted?: boolean;
}

@doc("Image analysis result.")
Expand All @@ -147,10 +127,6 @@ model ImageCategoriesAnalysis {

@doc("The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2, 4, 6.")
severity?: int32;

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("The decision made by service.")
accepted?: boolean;
}

@doc("Text Blocklist.")
Expand Down Expand Up @@ -205,111 +181,6 @@ model RemoveTextBlocklistItemsOptions {
blocklistItemIds: string[];
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("Project is an entity to manage deployment with specified policy.")
@resource("projects")
model Project {
@doc("Project name.")
@pattern("^[a-zA-Z][0-9A-Za-z-]*[0-9a-zA-Z]$")
@key("projectName")
@visibility("read", "query")
@maxLength(128)
@minLength(3)
projectName: string;

@doc("Project description.")
@maxLength(255)
description?: string;

@doc("Project modality.")
@visibility("read", "query", "create")
modality: ContentModality;

@doc("Project display name.")
@maxLength(128)
@minLength(3)
displayName?: string;

@doc("Project created time.")
@visibility("read", "query")
createdAt?: utcDateTime;

@doc("Project last modified time.")
@visibility("read", "query")
lastModifiedAt?: utcDateTime;

@doc("Deployed text policy. This value must be null if the modality is not Text.")
textPolicy?: TextPolicy;

@doc("Deployed image policy.This value must be null if the modality is not Image.")
imagePolicy?: ImagePolicy;
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("Modality type.")
enum ContentModality {
@doc("Text modality.")
Text,

@doc("Image modality.")
Image,
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("TextCategoryPolicy. Content which severity less than the acceptLessThan will be accepted.")
model TextCategoryPolicy {
@doc("Text category.")
category: TextCategory;

@doc("Severity less than the threshold will be treated as accepted for the category. The value can only be 2, 4, 6 for FourSeverityLevels. If the threshold is undefined, it means all content are accepted.")
acceptSeverityThreshold?: int32;
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("ImageCategoryPolicy. Content which severity less than the acceptLessThan will be accepted.")
model ImageCategoryPolicy {
@doc("Image category.")
category: ImageCategory;

@doc("Severity less than the threshold will be treated as accepted for the category. The value can only be 2, 4, 6 for FourSeverityLevels. If the threshold is undefined, it means all content are accepted.")
acceptSeverityThreshold?: int32;
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("Policy for the text.")
model TextPolicy {
@doc("The category policy. The length must be larger than 0.")
@minItems(1)
categoryPolicies: TextCategoryPolicy[];

@doc("The policy of blocklist.")
blocklistPolicy?: BlocklistPolicy;

@doc("The type of text analysis output. If not assigned, the default value is \"FourSeverityLevels\".")
outputType?: AnalyzeTextOutputType = AnalyzeTextOutputType.FourSeverityLevels;
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("Policy for the image.")
model ImagePolicy {
@doc("The category policy. The length must be larger than 0.")
@minItems(1)
categoryPolicies: ImageCategoryPolicy[];

@doc("The type of text analysis output. If not assigned, the default value is \"FourSeverityLevels\".")
outputType?: AnalyzeTextOutputType = AnalyzeTextOutputType.FourSeverityLevels;
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("Policy for blocklist.")
model BlocklistPolicy {
@doc("The names of blocklists.")
blocklistNames?: string[];

@doc("When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit.")
haltOnBlocklistHit?: boolean;
}

@added(ContentSafety.Versions.v2023_10_15_Preview)
@doc("The protected material analysis request.")
model AnalyzeTextProtectedMaterialOptions {
Expand Down
31 changes: 0 additions & 31 deletions specification/cognitiveservices/ContentSafety/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -118,34 +118,3 @@ interface TextBlocklists {
ListQueryParametersTrait<StandardListQueryParameters>
>;
}

interface ProjectOps
extends Azure.Core.ResourceOperations<NoRepeatableRequests &
NoConditionalRequests &
NoClientRequestId> {}

@added(ContentSafety.Versions.v2023_10_15_Preview)
interface Projects {
@summary("Create Or Update A Project.")
@doc("Update a project if project does exist, create a new project if not. Note that modality cannot be updated. The limitation is 10.")
createOrUpdateProject is ProjectOps.ResourceCreateOrUpdate<Project>;

@summary("Get Project Detailed Information By Project Name.")
@doc("Returns project details.")
getProject is ProjectOps.ResourceRead<Project>;

@summary("Delete A Project By Project Name.")
@doc("Delete a project by name.")
deleteProject is ProjectOps.ResourceDelete<Project>;

@summary("List Projects.")
@doc("List projects.")
listProjects is ProjectOps.ResourceList<
Project,
ListQueryParametersTrait<{
...TopQueryParameter;
...SkipQueryParameter;
...MaxPageSizeQueryParameter;
}>
>;
}
Loading