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

fix explanation version #52

Merged
merged 2 commits into from
Jan 19, 2024
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
3 changes: 0 additions & 3 deletions specification/cognitiveservices/ContentSafety/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,4 @@ enum Versions {

@useDependency(Azure.Core.Versions.v1_0_Preview_2)
v2023_10_30_Preview: "2023-10-30-preview",

@useDependency(Azure.Core.Versions.v1_0_Preview_2)
v2024_01_30_Preview: "2024-01-30-preview",
}
44 changes: 22 additions & 22 deletions specification/cognitiveservices/ContentSafety/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ enum AnalyzeImageOutputType {
FourSeverityLevels,
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("The type of batch results storage mode.")
enum BatchResultsStorageMode {
@doc("Merge each result into one file.")
Expand All @@ -50,7 +50,7 @@ enum BatchResultsStorageMode {
IndividualResultFiles,
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("The type of batch analysis task status.")
enum BatchTaskStatus {
@doc("The task has not started yet.")
Expand All @@ -66,15 +66,15 @@ enum BatchTaskStatus {
Succeeded,
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
enum ModelStatus {
Created,
Training,
Ready,
Failed,
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
enum GeneratePromptStatus {
Running,
Ready,
Expand Down Expand Up @@ -103,12 +103,12 @@ model AnalyzeTextOptions {
@doc("The incidents to detect.")
incidents?: IncidentOptions;

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("The customized categories will be analyzed. If they are not assigned, the analysis results for all available customized categories will be returned.")
customizedCategories?: CustomizedCategory[];
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("Customized category for inference.")
model CustomizedCategory {
@doc("Category name")
Expand Down Expand Up @@ -140,16 +140,16 @@ model AnalyzeTextResult {
@doc("The incident match details.")
incidentMatches?: IncidentMatch[];

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("Chunks in the original text detected as harmful content. Analysis result and scores are caused by these.")
citation?: string[];

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("Analysis result for customized categories.")
customizedCategoriesAnalysis: TextCustomizedCategoryAnalysis[];
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("Text customized category analysis result.")
model TextCustomizedCategoryAnalysis {
@doc("Customized category name")
Expand All @@ -159,12 +159,12 @@ model TextCustomizedCategoryAnalysis {
customizedCategoriesAnalysis: TextCustomizedCategoryClassResult[];
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("customized category analysis result")
model TextCustomizedCategoryClassResult {
id: int32;

@renamedFrom(Versions.v2024_01_30_Preview, "name")
@renamedFrom(Versions.v2023_10_30_Preview, "name")
className: string;
}

Expand Down Expand Up @@ -247,7 +247,7 @@ model ImageCategoriesAnalysis {
severity?: int32;
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("The image batch analysis request.")
model BatchAnalyzeImagesOptions {
@doc("The URL of the Azure Storage Blob containing all the images to be analyzed in the batch task.")
Expand All @@ -269,7 +269,7 @@ model BatchAnalyzeImagesOptions {
incidents?: IncidentOptions;
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("Image batch analyze task.")
@resource("image/batchAnalyzeTasks")
model ImageBatchTaskDetail {
Expand Down Expand Up @@ -579,11 +579,11 @@ model PreDefinedConcept {

@added(Versions.v2023_10_30_Preview)
@doc("Label definition.")
@renamedFrom(Versions.v2024_01_30_Preview, "SubCategory")
@renamedFrom(Versions.v2023_10_30_Preview, "SubCategory")
model Class {
id: int32;

@renamedFrom(Versions.v2024_01_30_Preview, "name")
@renamedFrom(Versions.v2023_10_30_Preview, "name")
className: string;

statements: string[];
Expand All @@ -602,22 +602,22 @@ model TextCustomizedCategory {

@doc("A predefined concept with its definition can be used directly in the subcategories.")
@added(Versions.v2023_10_30_Preview)
@removed(Versions.v2024_01_30_Preview)
@removed(Versions.v2023_10_30_Preview)
preDefinedConcepts?: PreDefinedConcept[];

@doc("Subcategories are detailed classes of the category. It is required there is a class 'safe' with id=0.")
@renamedFrom(Versions.v2024_01_30_Preview, "subCategories")
@renamedFrom(Versions.v2023_10_30_Preview, "subCategories")
classes: Class[];

@added(Versions.v2023_10_30_Preview)
@removed(Versions.v2024_01_30_Preview)
@removed(Versions.v2023_10_30_Preview)
emphases?: string[];

@doc("Blob that stores the examples.")
exampleBlobUrl?: url;
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@doc("The response for async training triggering.")
model SubmitModelTrainingResponse {
...AcceptedResponse;
Expand All @@ -627,13 +627,13 @@ model SubmitModelTrainingResponse {
modelUrl: string;
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
model AsyncJobWarning {
code: string;
messgae: string;
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@resource("text/generatePromptTasks")
model GeneratePromptTaskDetail {
@doc("The id of image batch analysis task.")
Expand All @@ -659,7 +659,7 @@ enum ImageWithTextCategory {
Violence,
}

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@parentResource(TextCustomizedCategory)
@resource("models")
model TextTrainedModel {
Expand Down
12 changes: 6 additions & 6 deletions specification/cognitiveservices/ContentSafety/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ interface ImageOperations {
}

interface ImageBatchOperations {
@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@summary("Start Batch Analyze Images")
@doc("An asynchronous API for the batch analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.")
@route("/image:batchAnalyze")
Expand All @@ -95,7 +95,7 @@ interface ImageBatchOperations {
ImageBatchTaskDetail
>;

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@summary("Get Batch Analyze Status")
@doc("Check the status of a batch image analysis task.")
getBatchTaskStatus is Azure.Core.ResourceRead<ImageBatchTaskDetail>;
Expand Down Expand Up @@ -326,15 +326,15 @@ interface TextCategoryCustomization {
ListQueryParametersTrait<StandardListQueryParameters>
>;

@added(Versions.v2024_01_30_Preview)
@added(Versions.v2023_10_30_Preview)
@action("trainModel")
trainModel is CategoryOps.ResourceAction<
TextCustomizedCategory,
{},
SubmitModelTrainingResponse
>;

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@route("/text/categories/{categoryName}:generatePrompt")
@post
@summary("Trigger prompt generation")
Expand All @@ -348,7 +348,7 @@ interface TextCategoryCustomization {
GeneratePromptTaskDetail
>;

@added(ContentSafety.Versions.v2024_01_30_Preview)
@added(ContentSafety.Versions.v2023_10_30_Preview)
@summary("Get Generate Prompt Task Status")
@doc("Check the status of a generate prompt task.")
getGeneratePromptTaskStatus is Azure.Core.ResourceRead<GeneratePromptTaskDetail>;
Expand All @@ -359,7 +359,7 @@ interface TextCustomizedMdoelOps
NoConditionalRequests &
NoClientRequestId> {}

@added(Versions.v2024_01_30_Preview)
@added(Versions.v2023_10_30_Preview)
interface TextCustomizedModelOperations {
@summary("List all existing models")
@doc("List existing models.")
Expand Down
Loading