From ea5af3c2e23bd7b2be8cdb34281895c57d37d8ce Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Sat, 15 Mar 2025 14:37:29 -0700 Subject: [PATCH 01/11] Update generated azure-ai-project-1dp.json to match TSP sources (recompiled) --- .../azure-ai-projects-1dp.json | 99 +++++++++++-------- 1 file changed, 59 insertions(+), 40 deletions(-) diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index 18011e292e3c..50ab6453daab 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -914,10 +914,10 @@ } } }, - "/evaluations": { + "/evaluations/runs": { "get": { "operationId": "Evaluations_List", - "description": "List evaluations", + "description": "List evaluation runs", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -930,6 +930,9 @@ }, { "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" } ], "responses": { @@ -937,6 +940,13 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PagedEvaluation" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } } }, "default": { @@ -957,22 +967,23 @@ } } }, - "/evaluations/{id}": { + "/evaluations/runs/{name}": { "get": { "operationId": "Evaluations_Get", - "description": "Get an evaluation.", + "description": "Get an evaluation run by name.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "name", "in": "path", "description": "Identifier of the evaluation.", "required": true, - "type": "string", - "maxLength": 254, - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" } ], "responses": { @@ -980,6 +991,13 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/Evaluation" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } } }, "default": { @@ -997,18 +1015,18 @@ } } }, - "/evaluations:create": { + "/evaluations/runs:run": { "post": { - "operationId": "Evaluations_Create", - "description": "Creates an evaluation.", + "operationId": "Evaluations_CreateRun", + "description": "Creates an evaluation run.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "body", + "name": "evaluation", "in": "body", - "description": "Properties of Evaluation.", + "description": "Evalution to be run", "required": true, "schema": { "$ref": "#/definitions/Evaluation" @@ -1016,8 +1034,8 @@ } ], "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", + "200": { + "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/Evaluation" } @@ -9472,25 +9490,6 @@ ], "x-ms-discriminator-value": "DataPath" }, - "Dataset": { - "type": "object", - "description": "Dataset as source for evaluation.", - "properties": { - "id": { - "type": "string", - "description": "Evaluation input data" - } - }, - "required": [ - "id" - ], - "allOf": [ - { - "$ref": "#/definitions/InputData" - } - ], - "x-ms-discriminator-value": "dataset" - }, "DatasetType": { "type": "string", "description": "Enum to determine the type of data.", @@ -9665,7 +9664,8 @@ "properties": { "id": { "type": "string", - "description": "Identifier of the evaluation." + "description": "Identifier of the evaluation.", + "readOnly": true }, "data": { "$ref": "#/definitions/InputData", @@ -9673,7 +9673,7 @@ }, "displayName": { "type": "string", - "description": "Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development." + "description": "Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique." }, "description": { "type": "string", @@ -9712,6 +9712,7 @@ } }, "required": [ + "id", "data", "evaluators" ] @@ -9889,6 +9890,25 @@ "type" ] }, + "InputDataset": { + "type": "object", + "description": "Dataset as source for evaluation.", + "properties": { + "id": { + "type": "string", + "description": "Evaluation input data" + } + }, + "required": [ + "id" + ], + "allOf": [ + { + "$ref": "#/definitions/InputData" + } + ], + "x-ms-discriminator-value": "dataset" + }, "ListSortOrder": { "type": "string", "description": "The available sorting options when requesting a list of response objects.", @@ -10072,15 +10092,14 @@ }, "PagedEvaluation": { "type": "object", - "description": "Paged evaluation items", + "description": "Paged collection of Evaluation items", "properties": { "value": { "type": "array", - "description": "The list of Evaluations.", + "description": "The Evaluation items on this page", "items": { "$ref": "#/definitions/Evaluation" - }, - "x-ms-identifiers": [] + } }, "nextLink": { "type": "string", From 323651ec35c8a6768d42b6beb744ddf5d4f252de Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Sat, 15 Mar 2025 15:58:06 -0700 Subject: [PATCH 02/11] Updated azure ai projects datasets to use common entity templates --- .../ai/Azure.AI.Projects/common/models.tsp | 5 +- .../ai/Azure.AI.Projects/datasets/models.tsp | 14 +- .../ai/Azure.AI.Projects/datasets/routes.tsp | 162 +++++----------- .../ai/Azure.AI.Projects/indexes/routes.tsp | 2 +- .../ai/Azure.AI.Projects/servicepatterns.tsp | 86 +++++++++ .../azure-ai-projects-1dp.json | 178 +++++++++++++----- 6 files changed, 264 insertions(+), 183 deletions(-) create mode 100644 specification/ai/Azure.AI.Projects/servicepatterns.tsp diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index d81f5f0f85bf..bdb8e43d8921 100644 --- a/specification/ai/Azure.AI.Projects/common/models.tsp +++ b/specification/ai/Azure.AI.Projects/common/models.tsp @@ -233,11 +233,12 @@ alias AssetBase = { @doc("The name of the resource") @visibility("read") - name?: string; + @key + name: string; @doc("The version of the resource") @visibility("read") - version?: string; + version: string; @doc("The asset description text.") description?: string; diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index 8c84463130ca..351452d4b6a9 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -26,6 +26,7 @@ union DatasetType { #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" @doc("DatasetVersion Definition") +@Rest.resource("datasets") model DatasetVersion { @doc("[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330") @visibility("read", "create") @@ -38,16 +39,3 @@ model DatasetVersion { ...AssetBase; } - -@doc("PagedDataVersionBase Definition") -@pagedResult -model PagedDatasetVersion { - @doc("The list of DatasetVersions.") - @extension("x-ms-identifiers", []) - @items - value: DatasetVersion[]; - - @doc("The link to the next page of results, if any.") - @nextLink - nextLink?: string; -} diff --git a/specification/ai/Azure.AI.Projects/datasets/routes.tsp b/specification/ai/Azure.AI.Projects/datasets/routes.tsp index 7ae21d773909..843f0c306f65 100644 --- a/specification/ai/Azure.AI.Projects/datasets/routes.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/routes.tsp @@ -4,6 +4,7 @@ import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "../common/models.tsp"; import "./models.tsp"; +import "../servicepatterns.tsp"; using TypeSpec.Http; using TypeSpec.Rest; @@ -14,123 +15,46 @@ using Azure.Core.Foundations; namespace Azure.AI.Projects; -interface Datasets { - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("List latest version of each dataset in a project.") - @route("/datasets") - @get - listLatestDatasets( - @doc("Continuation token for pagination. This is the nextLink from the previous response.") - @query("$continuationToken") - $continuationToken?: string, - - @doc("View type for including/excluding (for example) archived entities.") - @query("listViewType") - listViewType?: ListViewType, - ): PagedDatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("List dataset versions of a specific dataset") - @route("/datasets/{name}/versions") - @get - listDatasetVersions( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Please choose OrderBy value from ['createdtime', 'modifiedtime']") - @query("$orderBy") - $orderBy?: string, - - @doc("Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned") - @query("$top") - $top?: int32, - - @doc("Continuation token for pagination.") - @query("$skip") - $skip?: string, - - @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2") - @query("$tags") - $tags?: string, - - @doc("[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities.") - @query("listViewType") - listViewType?: ListViewType, - ): PagedDatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Delete version.") - @route("/datasets/{name}/versions/{version}") - @delete - deleteVersion( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - ): void; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Get dataset version.") - @route("/datasets/{name}/versions/{version}") - @get - getVersion( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - ): DatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Create or update version.") - @route("/datasets/{name}/versions/{version}") - @put - createOrUpdate( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - - @doc("Version entity to create or update.") - @body - datasetVersion: DatasetVersion, - ): DatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Start pending upload.") - @post - @route("/datasets/{name}/versions/{version}/startPendingUpload") - createOrGetStartPendingUpload( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - - @doc("Pensing upload request.") - @body - pendingUploadRequest: PendingUploadRequest, - ): PendingUploadResponse; +alias ListDatasetVersionsParameters = { + @doc("Please choose OrderBy value from ['createdtime', 'modifiedtime']") + @query("$orderBy") + $orderBy?: string; + + @doc("Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned") + @query("$top") + $top?: int32; + + @doc("Continuation token for pagination.") + @query("$skip") + $skip?: string; + + @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2") + @query("$tags") + $tags?: string; + + @doc("[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities.") + @query("listViewType") + listViewType?: ListViewType; +}; + +alias ListLatestDataSetVersionParameters = { + @doc("View type for including/excluding (for example) archived entities.") + @query("listViewType") + listViewType?: ListViewType; +}; + +interface Datasets + extends ServicePatterns.VersionedOperations< + DatasetVersion, + ListLatestDataSetVersionParameters, + ListDatasetVersionsParameters + > { + /** + * Create or start a pending upload of a dataset + */ + startPendingUpload is ServicePatterns.VersionedResourceAction< + DatasetVersion, + PendingUploadRequest, + PendingUploadResponse + >; } diff --git a/specification/ai/Azure.AI.Projects/indexes/routes.tsp b/specification/ai/Azure.AI.Projects/indexes/routes.tsp index 021729279788..9e6e2769befb 100644 --- a/specification/ai/Azure.AI.Projects/indexes/routes.tsp +++ b/specification/ai/Azure.AI.Projects/indexes/routes.tsp @@ -27,7 +27,7 @@ interface Indexes { @doc("View type for including/excluding (for example) archived entities.") @query("listViewType") listViewType?: ListViewType, - ): PagedDatasetVersion; + ): PagedIndex; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Waiting for bug fix: https://github.com/Azure/typespec-azure-pr/issues/3739." @doc("Get a specific version of an Index.") diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp new file mode 100644 index 000000000000..7a1004ac135f --- /dev/null +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -0,0 +1,86 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; + +namespace Azure.AI.Projects.ServicePatterns { + model VersionedPage + is Azure.Core.Page; + + @Rest.autoRoute + interface VersionedOperations< + TEntityType extends Reflection.Model, + TListLatestParameters extends Reflection.Model = {}, + TListVersionsParameters extends Reflection.Model = {} + > { + @Rest.action("versions") + @Rest.actionSeparator("/") + @Http.get + listVersions is BuildingBlocks.CoreOps.ResourceAction< + TEntityType, + TListVersionsParameters, + Azure.Core.Page + >; + + @Rest.listsResource(TEntityType) + listLatest is Azure.Core.Foundations.ResourceList< + TEntityType, + TListLatestParameters, + Azure.Core.Page + >; + + getVersion is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @Rest.segment("versions") + @Http.path + version: string; + }, + Azure.Core.Foundations.ResourceOkResponse + >; + + @Http.delete + deleteVersion is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @Rest.segment("versions") + @Http.path + version: string; + }, + Http.NoContentResponse + >; + + @Http.put + createVersion is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @Rest.segment("versions") + @Http.path + version: string; + + @Http.bodyRoot body: TEntityType; + }, + Azure.Core.Foundations.ResourceCreatedOrOkResponse + >; + } + + @Rest.action + op VersionedResourceAction< + TEntityType extends Reflection.Model, + TParams, + TResponse + > is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @Rest.segment("versions") + @Http.path + version: string; + + @Http.bodyRoot body: TEntityType; + }, + TResponse + >; + + namespace BuildingBlocks { + alias CoreOps = Azure.Core.StandardResourceOperations; + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index 50ab6453daab..165d7a7cda93 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -492,15 +492,11 @@ }, "/datasets": { "get": { - "operationId": "Datasets_ListLatestDatasets", - "description": "List latest version of each dataset in a project.", + "operationId": "Datasets_ListLatest", + "description": "Operation that lists resources in a paginated way.", "parameters": [ { - "name": "$continuationToken", - "in": "query", - "description": "Continuation token for pagination. This is the nextLink from the previous response.", - "required": false, - "type": "string" + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "listViewType", @@ -542,6 +538,18 @@ "schema": { "$ref": "#/definitions/PagedDatasetVersion" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } }, "x-ms-pageable": { @@ -551,16 +559,18 @@ }, "/datasets/{name}/versions": { "get": { - "operationId": "Datasets_ListDatasetVersions", - "description": "List dataset versions of a specific dataset", + "operationId": "Datasets_ListVersions", + "description": "Resource action operation template.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "$orderBy", @@ -631,6 +641,18 @@ "schema": { "$ref": "#/definitions/PagedDatasetVersion" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } }, "x-ms-pageable": { @@ -641,20 +663,21 @@ "/datasets/{name}/versions/{version}": { "get": { "operationId": "Datasets_GetVersion", - "description": "Get dataset version.", + "description": "The most basic operation that applies to a resource.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", "required": true, "type": "string" } @@ -665,32 +688,44 @@ "schema": { "$ref": "#/definitions/DatasetVersion" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } }, "put": { - "operationId": "Datasets_CreateOrUpdate", - "description": "Create or update version.", + "operationId": "Datasets_CreateVersion", + "description": "The most basic operation that applies to a resource.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", "required": true, "type": "string" }, { - "name": "datasetVersion", + "name": "body", "in": "body", - "description": "Version entity to create or update.", "required": true, "schema": { "$ref": "#/definitions/DatasetVersion" @@ -703,63 +738,94 @@ "schema": { "$ref": "#/definitions/DatasetVersion" } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/DatasetVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } }, "delete": { "operationId": "Datasets_DeleteVersion", - "description": "Delete version.", + "description": "The most basic operation that applies to a resource.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", "required": true, "type": "string" } ], "responses": { "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "description": "There is no content to send for this request, but the headers may be useful." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } } }, "/datasets/{name}/versions/{version}/startPendingUpload": { "post": { - "operationId": "Datasets_CreateOrGetStartPendingUpload", - "description": "Start pending upload.", + "operationId": "Datasets_StartPendingUpload", + "description": "Create or start a pending upload of a dataset", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", "required": true, "type": "string" }, { - "name": "pendingUploadRequest", + "name": "body", "in": "body", - "description": "Pensing upload request.", "required": true, "schema": { - "$ref": "#/definitions/PendingUploadRequest" + "$ref": "#/definitions/DatasetVersion" } } ], @@ -769,6 +835,18 @@ "schema": { "$ref": "#/definitions/PendingUploadResponse" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } } @@ -1409,7 +1487,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedDatasetVersion" + "$ref": "#/definitions/PagedIndex" } } }, @@ -9569,7 +9647,9 @@ }, "required": [ "datasetUri", - "datasetType" + "datasetType", + "name", + "version" ] }, "Deployment": { @@ -9844,7 +9924,9 @@ }, "discriminator": "indexType", "required": [ - "indexType" + "indexType", + "name", + "version" ] }, "IndexType": { @@ -10049,19 +10131,19 @@ }, "PagedDatasetVersion": { "type": "object", - "description": "PagedDataVersionBase Definition", + "description": "Paged collection of DatasetVersion items", "properties": { "value": { "type": "array", - "description": "The list of DatasetVersions.", + "description": "The DatasetVersion items on this page", "items": { "$ref": "#/definitions/DatasetVersion" - }, - "x-ms-identifiers": [] + } }, "nextLink": { "type": "string", - "description": "The link to the next page of results, if any." + "format": "uri", + "description": "The link to the next page of items" } }, "required": [ From 4151d7bda5707b9f0a28b3171feb954591dfd293 Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Sat, 15 Mar 2025 16:24:23 -0700 Subject: [PATCH 03/11] Updated indexes to use versioned entity operations for azure ai projects. --- .../ai/Azure.AI.Projects/indexes/models.tsp | 14 +- .../ai/Azure.AI.Projects/indexes/routes.tsp | 135 ++------- .../ai/Azure.AI.Projects/servicepatterns.tsp | 6 +- .../azure-ai-projects-1dp.json | 283 ++++++++++++++---- 4 files changed, 267 insertions(+), 171 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/indexes/models.tsp b/specification/ai/Azure.AI.Projects/indexes/models.tsp index 7e192328b51f..a4f289fd4a44 100644 --- a/specification/ai/Azure.AI.Projects/indexes/models.tsp +++ b/specification/ai/Azure.AI.Projects/indexes/models.tsp @@ -16,6 +16,7 @@ namespace Azure.AI.Projects; @doc("Index resource Definition") @discriminator("indexType") +@Rest.resource("indexes") model Index { @doc("Type of index") indexType: IndexType; @@ -23,19 +24,6 @@ model Index { ...AssetBase; } -@doc("Paged collection of Index items.") -@pagedResult -model PagedIndex { - @doc("The list of Indexes.") - @extension("x-ms-identifiers", []) - @items - value: Index[]; - - @doc("The link to the next page of items") - @nextLink - nextLink?: ResourceLocation; -} - @doc("Azure AI Search Index Definition") model AzureAISearchIndex extends Index { @doc("Type of index") diff --git a/specification/ai/Azure.AI.Projects/indexes/routes.tsp b/specification/ai/Azure.AI.Projects/indexes/routes.tsp index 9e6e2769befb..fe8e35128233 100644 --- a/specification/ai/Azure.AI.Projects/indexes/routes.tsp +++ b/specification/ai/Azure.AI.Projects/indexes/routes.tsp @@ -3,6 +3,7 @@ import "@azure-tools/typespec-autorest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "./models.tsp"; +import "../servicepatterns.tsp"; using TypeSpec.Http; using TypeSpec.Rest; @@ -13,106 +14,34 @@ using Azure.Core.Foundations; namespace Azure.AI.Projects; -interface Indexes { - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("List latest version of each dataset in a project.") - @route("/indexes") - @get - listLatestIndexes( - @doc("Continuation token for pagination. This is the nextLink from the previous response.") - @query("$continuationToken") - $continuationToken?: string, - - @doc("View type for including/excluding (for example) archived entities.") - @query("listViewType") - listViewType?: ListViewType, - ): PagedIndex; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Waiting for bug fix: https://github.com/Azure/typespec-azure-pr/issues/3739." - @doc("Get a specific version of an Index.") - @route("/indexes/{name}/versions/{version}") - @get - get is Azure.Core.Foundations.Operation< - { - @doc("Name of the index.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]*$") - @maxLength(254) - @path - name: string; - - @doc("Version of the index.") - @path - version: string; - }, - Index - >; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Waiting for bug fix: https://github.com/Azure/typespec-azure-pr/issues/3739." - @doc("Creates or updates a IndexVersion.") - @route("/indexes/{name}:create") - @post - createIndex is Azure.Core.Foundations.Operation< - { - @doc("Name of the index.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]*$") - @maxLength(254) - @path - name: string; - - @doc("Properties of an Index Version.") - @bodyRoot - body: Index; - }, - ResourceCreatedOrOkResponse - >; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to use same model in both list calls." - @doc("List the versions of an Index given the name.") - @route("/indexes/{name}/versions") - @get - listIndexVersions is Azure.Core.Foundations.Operation< - { - @doc("Name of the index.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]*$") - @maxLength(254) - @path - name: string; - - @doc("View type for including/excluding (for example) archived entities.") - @query - listViewType: string = "ActiveOnly"; - - @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") - @query - orderBy?: string; - - @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") - @query - orderby?: string; - - @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2.") - @query - tags?: string; - - ...StandardListQueryParameters; - }, - PagedIndex - >; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Delete version.") - @route("/indexes/{name}/versions/{version}") - @delete - deleteVersion( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - ): void; -} +alias ListIndexVersionParameters = { + @doc("View type for including/excluding (for example) archived entities.") + @query + listViewType: string = "ActiveOnly"; + + @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") + @query + orderBy?: string; + + @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") + @query + orderby?: string; + + @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2.") + @query + tags?: string; + + ...StandardListQueryParameters; +}; + +alias ListLatestIndexParameters = { + @doc("View type for including/excluding (for example) archived entities.") + @query("listViewType") + listViewType?: ListViewType; +}; +interface Indexes + extends ServicePatterns.VersionedOperations< + Index, + ListLatestIndexParameters, + ListIndexVersionParameters + > {} diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp index 7a1004ac135f..9f6c6cbc7460 100644 --- a/specification/ai/Azure.AI.Projects/servicepatterns.tsp +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -3,9 +3,6 @@ import "@typespec/rest"; import "@azure-tools/typespec-azure-core"; namespace Azure.AI.Projects.ServicePatterns { - model VersionedPage - is Azure.Core.Page; - @Rest.autoRoute interface VersionedOperations< TEntityType extends Reflection.Model, @@ -49,6 +46,8 @@ namespace Azure.AI.Projects.ServicePatterns { Http.NoContentResponse >; + create is BuildingBlocks.RepeatableCoreOps.ResourceCreateWithServiceProvidedName; + @Http.put createVersion is Azure.Core.Foundations.ResourceOperation< TEntityType, @@ -82,5 +81,6 @@ namespace Azure.AI.Projects.ServicePatterns { namespace BuildingBlocks { alias CoreOps = Azure.Core.StandardResourceOperations; + alias RepeatableCoreOps = Azure.Core.ResourceOperations; } } diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index 165d7a7cda93..88f1b54d3f4d 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -555,6 +555,78 @@ "x-ms-pageable": { "nextLinkName": "nextLink" } + }, + "post": { + "operationId": "Datasets_Create", + "description": "Resource create with service-provided name operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/DatasetVersion" + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "headers": { + "Location": { + "type": "string", + "format": "uri", + "description": "The location of an instance of DatasetVersion" + }, + "Repeatability-Result": { + "type": "string", + "description": "Indicates whether the repeatable request was accepted or rejected.", + "enum": [ + "accepted", + "rejected" + ], + "x-ms-enum": { + "name": "RepeatabilityResult", + "modelAsString": false, + "values": [ + { + "name": "accepted", + "value": "accepted", + "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." + }, + { + "name": "rejected", + "value": "rejected", + "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." + } + ] + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } } }, "/datasets/{name}/versions": { @@ -1439,15 +1511,11 @@ }, "/indexes": { "get": { - "operationId": "Indexes_ListLatestIndexes", - "description": "List latest version of each dataset in a project.", + "operationId": "Indexes_ListLatest", + "description": "Operation that lists resources in a paginated way.", "parameters": [ { - "name": "$continuationToken", - "in": "query", - "description": "Continuation token for pagination. This is the nextLink from the previous response.", - "required": false, - "type": "string" + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "listViewType", @@ -1489,34 +1557,41 @@ "schema": { "$ref": "#/definitions/PagedIndex" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } - } - }, - "/indexes/{name}:create": { + }, "post": { - "operationId": "Indexes_CreateIndex", - "description": "Creates or updates a IndexVersion.", + "operationId": "Indexes_Create", + "description": "Resource create with service-provided name operation template.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "name", - "in": "path", - "description": "Name of the index.", - "required": true, - "type": "string", - "maxLength": 254, - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" }, { - "name": "body", + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" + }, + { + "name": "resource", "in": "body", - "description": "Properties of an Index Version.", + "description": "The resource instance.", "required": true, "schema": { "$ref": "#/definitions/Index" @@ -1524,16 +1599,38 @@ } ], "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Index" - } - }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/Index" + "headers": { + "Location": { + "type": "string", + "format": "uri", + "description": "The location of an instance of Index" + }, + "Repeatability-Result": { + "type": "string", + "description": "Indicates whether the repeatable request was accepted or rejected.", + "enum": [ + "accepted", + "rejected" + ], + "x-ms-enum": { + "name": "RepeatabilityResult", + "modelAsString": false, + "values": [ + { + "name": "accepted", + "value": "accepted", + "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." + }, + { + "name": "rejected", + "value": "rejected", + "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." + } + ] + } + } } }, "default": { @@ -1553,8 +1650,8 @@ }, "/indexes/{name}/versions": { "get": { - "operationId": "Indexes_ListIndexVersions", - "description": "List the versions of an Index given the name.", + "operationId": "Indexes_ListVersions", + "description": "Resource action operation template.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1562,11 +1659,9 @@ { "name": "name", "in": "path", - "description": "Name of the index.", + "description": "The name of the resource", "required": true, - "type": "string", - "maxLength": 254, - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + "type": "string" }, { "name": "listViewType", @@ -1634,8 +1729,8 @@ }, "/indexes/{name}/versions/{version}": { "get": { - "operationId": "Indexes_Get", - "description": "Get a specific version of an Index.", + "operationId": "Indexes_GetVersion", + "description": "The most basic operation that applies to a resource.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1643,16 +1738,13 @@ { "name": "name", "in": "path", - "description": "Name of the index.", + "description": "The name of the resource", "required": true, - "type": "string", - "maxLength": 254, - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version of the index.", "required": true, "type": "string" } @@ -1678,29 +1770,98 @@ } } }, + "put": { + "operationId": "Indexes_CreateVersion", + "description": "The most basic operation that applies to a resource.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Index" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, "delete": { "operationId": "Indexes_DeleteVersion", - "description": "Delete version.", + "description": "The most basic operation that applies to a resource.", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", "required": true, "type": "string" } ], "responses": { "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "description": "There is no content to send for this request, but the headers may be useful." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } } @@ -10195,15 +10356,14 @@ }, "PagedIndex": { "type": "object", - "description": "Paged collection of Index items.", + "description": "Paged collection of Index items", "properties": { "value": { "type": "array", - "description": "The list of Indexes.", + "description": "The Index items on this page", "items": { "$ref": "#/definitions/Index" - }, - "x-ms-identifiers": [] + } }, "nextLink": { "type": "string", @@ -10506,6 +10666,25 @@ "format": "int32", "x-ms-parameter-location": "method" }, + "Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent": { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "Specifies the date and time at which the request was first created.", + "required": false, + "type": "string", + "format": "date-time", + "x-ms-parameter-location": "method", + "x-ms-client-name": "repeatabilityFirstSent" + }, + "Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId": { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "An opaque, globally-unique, client-generated string identifier for the request.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-client-name": "repeatabilityRequestId" + }, "Azure.Core.SkipQueryParameter": { "name": "skip", "in": "query", From 4e8e1dd85688ca5657226b23af5030849c47f81e Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Mon, 17 Mar 2025 16:41:24 -0700 Subject: [PATCH 04/11] Address review feedback/azure ai projects 1dp service patterns --- .../ai/Azure.AI.Projects/servicepatterns.tsp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp index 9f6c6cbc7460..fc0b3e47dea1 100644 --- a/specification/ai/Azure.AI.Projects/servicepatterns.tsp +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -46,7 +46,14 @@ namespace Azure.AI.Projects.ServicePatterns { Http.NoContentResponse >; - create is BuildingBlocks.RepeatableCoreOps.ResourceCreateWithServiceProvidedName; + @Rest.actionSeparator("/") + versions is BuildingBlocks.RepeatableCoreOps.ResourceAction< + TEntityType, + { + @Http.bodyRoot body: TEntityType; + }, + TEntityType + >; @Http.put createVersion is Azure.Core.Foundations.ResourceOperation< @@ -74,7 +81,7 @@ namespace Azure.AI.Projects.ServicePatterns { @Http.path version: string; - @Http.bodyRoot body: TEntityType; + @Http.bodyRoot body: TParams; }, TResponse >; From 26f7f3193e29be9956fbb7b7a8c46a35ff279940 Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Mon, 17 Mar 2025 16:42:08 -0700 Subject: [PATCH 05/11] Updated generated azure ai projects 1dp openapi description --- .../azure-ai-projects-1dp.json | 298 +++++++++--------- 1 file changed, 153 insertions(+), 145 deletions(-) diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index 88f1b54d3f4d..2ae7f407946f 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -555,78 +555,6 @@ "x-ms-pageable": { "nextLinkName": "nextLink" } - }, - "post": { - "operationId": "Datasets_Create", - "description": "Resource create with service-provided name operation template.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" - }, - { - "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" - }, - { - "name": "resource", - "in": "body", - "description": "The resource instance.", - "required": true, - "schema": { - "$ref": "#/definitions/DatasetVersion" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "Location": { - "type": "string", - "format": "uri", - "description": "The location of an instance of DatasetVersion" - }, - "Repeatability-Result": { - "type": "string", - "description": "Indicates whether the repeatable request was accepted or rejected.", - "enum": [ - "accepted", - "rejected" - ], - "x-ms-enum": { - "name": "RepeatabilityResult", - "modelAsString": false, - "values": [ - { - "name": "accepted", - "value": "accepted", - "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." - }, - { - "name": "rejected", - "value": "rejected", - "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." - } - ] - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } } }, "/datasets/{name}/versions": { @@ -730,6 +658,82 @@ "x-ms-pageable": { "nextLinkName": "nextLink" } + }, + "post": { + "operationId": "Datasets_Versions", + "description": "Resource action operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DatasetVersion" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DatasetVersion" + }, + "headers": { + "Repeatability-Result": { + "type": "string", + "description": "Indicates whether the repeatable request was accepted or rejected.", + "enum": [ + "accepted", + "rejected" + ], + "x-ms-enum": { + "name": "RepeatabilityResult", + "modelAsString": false, + "values": [ + { + "name": "accepted", + "value": "accepted", + "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." + }, + { + "name": "rejected", + "value": "rejected", + "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." + } + ] + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } } }, "/datasets/{name}/versions/{version}": { @@ -897,7 +901,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DatasetVersion" + "$ref": "#/definitions/PendingUploadRequest" } } ], @@ -1574,78 +1578,6 @@ "x-ms-pageable": { "nextLinkName": "nextLink" } - }, - "post": { - "operationId": "Indexes_Create", - "description": "Resource create with service-provided name operation template.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" - }, - { - "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" - }, - { - "name": "resource", - "in": "body", - "description": "The resource instance.", - "required": true, - "schema": { - "$ref": "#/definitions/Index" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "Location": { - "type": "string", - "format": "uri", - "description": "The location of an instance of Index" - }, - "Repeatability-Result": { - "type": "string", - "description": "Indicates whether the repeatable request was accepted or rejected.", - "enum": [ - "accepted", - "rejected" - ], - "x-ms-enum": { - "name": "RepeatabilityResult", - "modelAsString": false, - "values": [ - { - "name": "accepted", - "value": "accepted", - "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." - }, - { - "name": "rejected", - "value": "rejected", - "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." - } - ] - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" - }, - "headers": { - "x-ms-error-code": { - "type": "string", - "description": "String error code indicating what went wrong." - } - } - } - } } }, "/indexes/{name}/versions": { @@ -1725,6 +1657,82 @@ "x-ms-pageable": { "nextLinkName": "nextLink" } + }, + "post": { + "operationId": "Indexes_Versions", + "description": "Resource action operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Index" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + }, + "headers": { + "Repeatability-Result": { + "type": "string", + "description": "Indicates whether the repeatable request was accepted or rejected.", + "enum": [ + "accepted", + "rejected" + ], + "x-ms-enum": { + "name": "RepeatabilityResult", + "modelAsString": false, + "values": [ + { + "name": "accepted", + "value": "accepted", + "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." + }, + { + "name": "rejected", + "value": "rejected", + "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." + } + ] + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } } }, "/indexes/{name}/versions/{version}": { From 85afb495d2dac859cd4034b74e80586ff3d9e741 Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Mon, 17 Mar 2025 17:05:37 -0700 Subject: [PATCH 06/11] Added support for client request id for repeatable creates --- .../ai/Azure.AI.Projects/servicepatterns.tsp | 3 ++- .../azure-ai-projects-1dp.json | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp index fc0b3e47dea1..808df796bf69 100644 --- a/specification/ai/Azure.AI.Projects/servicepatterns.tsp +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -88,6 +88,7 @@ namespace Azure.AI.Projects.ServicePatterns { namespace BuildingBlocks { alias CoreOps = Azure.Core.StandardResourceOperations; - alias RepeatableCoreOps = Azure.Core.ResourceOperations; + alias RepeatableCoreOps = Azure.Core.ResourceOperations; } } diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index 2ae7f407946f..3d6cdfc93942 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -679,6 +679,9 @@ { "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, { "name": "body", "in": "body", @@ -718,6 +721,11 @@ } ] } + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, @@ -1678,6 +1686,9 @@ { "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, { "name": "body", "in": "body", @@ -1717,6 +1728,11 @@ } ] } + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." } } }, From b629a98c3d9f10d2cd1b89f7dab06c34b8de0f0e Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Tue, 18 Mar 2025 10:13:50 -0700 Subject: [PATCH 07/11] Added documentation and appropriate suppressions for operation templates for azure ai 1dp --- .../ai/Azure.AI.Projects/datasets/routes.tsp | 1 + .../ai/Azure.AI.Projects/indexes/routes.tsp | 2 ++ .../ai/Azure.AI.Projects/servicepatterns.tsp | 17 ++++++++- .../azure-ai-projects-1dp.json | 36 ++++++++++++------- 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/datasets/routes.tsp b/specification/ai/Azure.AI.Projects/datasets/routes.tsp index 843f0c306f65..3570aeaf96ed 100644 --- a/specification/ai/Azure.AI.Projects/datasets/routes.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/routes.tsp @@ -43,6 +43,7 @@ alias ListLatestDataSetVersionParameters = { listViewType?: ListViewType; }; +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "We are using service specific operation templates" interface Datasets extends ServicePatterns.VersionedOperations< DatasetVersion, diff --git a/specification/ai/Azure.AI.Projects/indexes/routes.tsp b/specification/ai/Azure.AI.Projects/indexes/routes.tsp index fe8e35128233..e3119bf35698 100644 --- a/specification/ai/Azure.AI.Projects/indexes/routes.tsp +++ b/specification/ai/Azure.AI.Projects/indexes/routes.tsp @@ -39,6 +39,8 @@ alias ListLatestIndexParameters = { @query("listViewType") listViewType?: ListViewType; }; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "We are using service specific operation templates" interface Indexes extends ServicePatterns.VersionedOperations< Index, diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp index 808df796bf69..3d2c08cb91c6 100644 --- a/specification/ai/Azure.AI.Projects/servicepatterns.tsp +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -9,15 +9,19 @@ namespace Azure.AI.Projects.ServicePatterns { TListLatestParameters extends Reflection.Model = {}, TListVersionsParameters extends Reflection.Model = {} > { + + @doc("List all versions of the given {name}", TEntityType) @Rest.action("versions") @Rest.actionSeparator("/") @Http.get + #suppress "@azure-tools/typespec-azure-core/verb-conflict" "We are using the resource action as a building block." listVersions is BuildingBlocks.CoreOps.ResourceAction< TEntityType, TListVersionsParameters, Azure.Core.Page >; + @doc("List the latest version of each {name}", TEntityType) @Rest.listsResource(TEntityType) listLatest is Azure.Core.Foundations.ResourceList< TEntityType, @@ -25,9 +29,11 @@ namespace Azure.AI.Projects.ServicePatterns { Azure.Core.Page >; + @doc("Get the specific version of the {name}", TEntityType) getVersion is Azure.Core.Foundations.ResourceOperation< TEntityType, { + @doc("The specific version id of the {name} to retrieve.", TEntityType) @Rest.segment("versions") @Http.path version: string; @@ -35,10 +41,12 @@ namespace Azure.AI.Projects.ServicePatterns { Azure.Core.Foundations.ResourceOkResponse >; + @doc("Delete the specific version of the {name}", TEntityType) @Http.delete deleteVersion is Azure.Core.Foundations.ResourceOperation< TEntityType, { + @doc("The version of the {name} to delete.", TEntityType) @Rest.segment("versions") @Http.path version: string; @@ -46,23 +54,28 @@ namespace Azure.AI.Projects.ServicePatterns { Http.NoContentResponse >; + @doc("Create a new {name}. The version id will be generated by the service.", TEntityType) @Rest.actionSeparator("/") versions is BuildingBlocks.RepeatableCoreOps.ResourceAction< TEntityType, { + @doc("The definition of the {name} to create", TEntityType) @Http.bodyRoot body: TEntityType; }, TEntityType >; + @doc("Create a new or replace an existing {name} with the given version id", TEntityType) @Http.put createVersion is Azure.Core.Foundations.ResourceOperation< TEntityType, { + @doc("The specific version id of the {name} to create or replace.", TEntityType) @Rest.segment("versions") @Http.path version: string; + @doc("The definition of the {name} to create", TEntityType) @Http.bodyRoot body: TEntityType; }, Azure.Core.Foundations.ResourceCreatedOrOkResponse @@ -77,10 +90,12 @@ namespace Azure.AI.Projects.ServicePatterns { > is Azure.Core.Foundations.ResourceOperation< TEntityType, { + @doc("The specific version id of the {name} to operate on.", TEntityType) @Rest.segment("versions") @Http.path version: string; + @doc("Parameters for the action") @Http.bodyRoot body: TParams; }, TResponse @@ -89,6 +104,6 @@ namespace Azure.AI.Projects.ServicePatterns { namespace BuildingBlocks { alias CoreOps = Azure.Core.StandardResourceOperations; alias RepeatableCoreOps = Azure.Core.ResourceOperations; + Azure.Core.Traits.SupportsClientRequestId & Azure.Core.Traits.NoConditionalRequests>; } } diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index 3d6cdfc93942..931c7c3fd4a1 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -493,7 +493,7 @@ "/datasets": { "get": { "operationId": "Datasets_ListLatest", - "description": "Operation that lists resources in a paginated way.", + "description": "List the latest version of each DatasetVersion", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -560,7 +560,7 @@ "/datasets/{name}/versions": { "get": { "operationId": "Datasets_ListVersions", - "description": "Resource action operation template.", + "description": "List all versions of the given DatasetVersion", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -661,7 +661,7 @@ }, "post": { "operationId": "Datasets_Versions", - "description": "Resource action operation template.", + "description": "Create a new DatasetVersion. The version id will be generated by the service.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -685,6 +685,7 @@ { "name": "body", "in": "body", + "description": "The definition of the DatasetVersion to create", "required": true, "schema": { "$ref": "#/definitions/DatasetVersion" @@ -747,7 +748,7 @@ "/datasets/{name}/versions/{version}": { "get": { "operationId": "Datasets_GetVersion", - "description": "The most basic operation that applies to a resource.", + "description": "Get the specific version of the DatasetVersion", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -762,6 +763,7 @@ { "name": "version", "in": "path", + "description": "The specific version id of the DatasetVersion to retrieve.", "required": true, "type": "string" } @@ -789,7 +791,7 @@ }, "put": { "operationId": "Datasets_CreateVersion", - "description": "The most basic operation that applies to a resource.", + "description": "Create a new or replace an existing DatasetVersion with the given version id", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -804,12 +806,14 @@ { "name": "version", "in": "path", + "description": "The specific version id of the DatasetVersion to create or replace.", "required": true, "type": "string" }, { "name": "body", "in": "body", + "description": "The definition of the DatasetVersion to create", "required": true, "schema": { "$ref": "#/definitions/DatasetVersion" @@ -845,7 +849,7 @@ }, "delete": { "operationId": "Datasets_DeleteVersion", - "description": "The most basic operation that applies to a resource.", + "description": "Delete the specific version of the DatasetVersion", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -860,6 +864,7 @@ { "name": "version", "in": "path", + "description": "The version of the DatasetVersion to delete.", "required": true, "type": "string" } @@ -901,12 +906,14 @@ { "name": "version", "in": "path", + "description": "The specific version id of the DatasetVersion to operate on.", "required": true, "type": "string" }, { "name": "body", "in": "body", + "description": "Parameters for the action", "required": true, "schema": { "$ref": "#/definitions/PendingUploadRequest" @@ -1524,7 +1531,7 @@ "/indexes": { "get": { "operationId": "Indexes_ListLatest", - "description": "Operation that lists resources in a paginated way.", + "description": "List the latest version of each Index", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1591,7 +1598,7 @@ "/indexes/{name}/versions": { "get": { "operationId": "Indexes_ListVersions", - "description": "Resource action operation template.", + "description": "List all versions of the given Index", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1668,7 +1675,7 @@ }, "post": { "operationId": "Indexes_Versions", - "description": "Resource action operation template.", + "description": "Create a new Index. The version id will be generated by the service.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1692,6 +1699,7 @@ { "name": "body", "in": "body", + "description": "The definition of the Index to create", "required": true, "schema": { "$ref": "#/definitions/Index" @@ -1754,7 +1762,7 @@ "/indexes/{name}/versions/{version}": { "get": { "operationId": "Indexes_GetVersion", - "description": "The most basic operation that applies to a resource.", + "description": "Get the specific version of the Index", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1769,6 +1777,7 @@ { "name": "version", "in": "path", + "description": "The specific version id of the Index to retrieve.", "required": true, "type": "string" } @@ -1796,7 +1805,7 @@ }, "put": { "operationId": "Indexes_CreateVersion", - "description": "The most basic operation that applies to a resource.", + "description": "Create a new or replace an existing Index with the given version id", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1811,12 +1820,14 @@ { "name": "version", "in": "path", + "description": "The specific version id of the Index to create or replace.", "required": true, "type": "string" }, { "name": "body", "in": "body", + "description": "The definition of the Index to create", "required": true, "schema": { "$ref": "#/definitions/Index" @@ -1852,7 +1863,7 @@ }, "delete": { "operationId": "Indexes_DeleteVersion", - "description": "The most basic operation that applies to a resource.", + "description": "Delete the specific version of the Index", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1867,6 +1878,7 @@ { "name": "version", "in": "path", + "description": "The version of the Index to delete.", "required": true, "type": "string" } From bda7d578b14ac0f6605be2b56db8ee99e65bff6e Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Tue, 18 Mar 2025 10:18:55 -0700 Subject: [PATCH 08/11] cspell fixes azure ai projects 1dp --- specification/ai/Azure.AI.Projects/common/models.tsp | 4 ++-- specification/ai/Azure.AI.Projects/evaluations/routes.tsp | 2 +- .../preview/2025-05-01-preview/azure-ai-projects-1dp.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index bdb8e43d8921..6b0a4dd3e503 100644 --- a/specification/ai/Azure.AI.Projects/common/models.tsp +++ b/specification/ai/Azure.AI.Projects/common/models.tsp @@ -251,11 +251,11 @@ alias AssetBase = { systemData?: SystemData; }; -#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create reponses correctly" +#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create responses correctly" alias ResourceCreatedResponse = TypeSpec.Http.Response<201> & T; -#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create reponses correctly" +#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create responses correctly" alias OkResponse = TypeSpec.Http.Response<200> & T; diff --git a/specification/ai/Azure.AI.Projects/evaluations/routes.tsp b/specification/ai/Azure.AI.Projects/evaluations/routes.tsp index 149e390f1d38..d56315a30c94 100644 --- a/specification/ai/Azure.AI.Projects/evaluations/routes.tsp +++ b/specification/ai/Azure.AI.Projects/evaluations/routes.tsp @@ -36,7 +36,7 @@ interface Evaluations { @post createRun is Azure.Core.Foundations.Operation< { - @doc("Evalution to be run") + @doc("Evaluation to be run") @body evaluation: Evaluation; }, diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index 931c7c3fd4a1..cb5f08cdcb66 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -1195,7 +1195,7 @@ { "name": "evaluation", "in": "body", - "description": "Evalution to be run", + "description": "Evaluation to be run", "required": true, "schema": { "$ref": "#/definitions/Evaluation" From 9dd5c92e9a656a125d074750979658330b0c39cc Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Tue, 18 Mar 2025 11:55:55 -0700 Subject: [PATCH 09/11] Formatting update --- .../ai/Azure.AI.Projects/servicepatterns.tsp | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp index 3d2c08cb91c6..a873b0f9d3c2 100644 --- a/specification/ai/Azure.AI.Projects/servicepatterns.tsp +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -9,12 +9,11 @@ namespace Azure.AI.Projects.ServicePatterns { TListLatestParameters extends Reflection.Model = {}, TListVersionsParameters extends Reflection.Model = {} > { - + #suppress "@azure-tools/typespec-azure-core/verb-conflict" "We are using the resource action as a building block." @doc("List all versions of the given {name}", TEntityType) @Rest.action("versions") @Rest.actionSeparator("/") @Http.get - #suppress "@azure-tools/typespec-azure-core/verb-conflict" "We are using the resource action as a building block." listVersions is BuildingBlocks.CoreOps.ResourceAction< TEntityType, TListVersionsParameters, @@ -54,29 +53,40 @@ namespace Azure.AI.Projects.ServicePatterns { Http.NoContentResponse >; - @doc("Create a new {name}. The version id will be generated by the service.", TEntityType) + @doc( + "Create a new {name}. The version id will be generated by the service.", + TEntityType + ) @Rest.actionSeparator("/") versions is BuildingBlocks.RepeatableCoreOps.ResourceAction< TEntityType, { @doc("The definition of the {name} to create", TEntityType) - @Http.bodyRoot body: TEntityType; + @Http.bodyRoot + body: TEntityType; }, TEntityType >; - @doc("Create a new or replace an existing {name} with the given version id", TEntityType) + @doc( + "Create a new or replace an existing {name} with the given version id", + TEntityType + ) @Http.put createVersion is Azure.Core.Foundations.ResourceOperation< TEntityType, { - @doc("The specific version id of the {name} to create or replace.", TEntityType) + @doc( + "The specific version id of the {name} to create or replace.", + TEntityType + ) @Rest.segment("versions") @Http.path version: string; @doc("The definition of the {name} to create", TEntityType) - @Http.bodyRoot body: TEntityType; + @Http.bodyRoot + body: TEntityType; }, Azure.Core.Foundations.ResourceCreatedOrOkResponse >; @@ -96,7 +106,8 @@ namespace Azure.AI.Projects.ServicePatterns { version: string; @doc("Parameters for the action") - @Http.bodyRoot body: TParams; + @Http.bodyRoot + body: TParams; }, TResponse >; @@ -104,6 +115,7 @@ namespace Azure.AI.Projects.ServicePatterns { namespace BuildingBlocks { alias CoreOps = Azure.Core.StandardResourceOperations; alias RepeatableCoreOps = Azure.Core.ResourceOperations; + Azure.Core.Traits.SupportsClientRequestId & + Azure.Core.Traits.NoConditionalRequests>; } } From 3b40f45066d0b2d3314204da3e4e14e082bc44d1 Mon Sep 17 00:00:00 2001 From: Johan Stenberg Date: Tue, 18 Mar 2025 13:33:53 -0700 Subject: [PATCH 10/11] Fix broken merge --- .../preview/2025-05-01-preview/azure-ai-projects-1dp.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index a270a3b0213c..836f80f60459 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -1176,7 +1176,6 @@ "name": "evaluation", "in": "body", "description": "Evaluation to be run", - "description": "Evalution to be run", "required": true, "schema": { "$ref": "#/definitions/Evaluation" From df759296f03d9626739f5c869832d55bc83abba1 Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri <40341266+needuv@users.noreply.github.com> Date: Wed, 19 Mar 2025 16:28:11 -0400 Subject: [PATCH 11/11] fix merge conflicts with datasets/models.tsp --- .../ai/Azure.AI.Projects/datasets/models.tsp | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index 351452d4b6a9..12bae6a70631 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -22,11 +22,15 @@ union DatasetType { @doc("URI file.") uri_file: "uri_file", + + @doc("URI folder.") + uri_folder: "uri_folder", } #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" @doc("DatasetVersion Definition") @Rest.resource("datasets") +@discriminator("type") model DatasetVersion { @doc("[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330") @visibility("read", "create") @@ -34,8 +38,27 @@ model DatasetVersion { @pattern("[a-zA-Z0-9_]") datasetUri: string; - @doc("Data type") - datasetType: DatasetType; + @doc("Dataset type") + type: DatasetType; + + @doc("Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted") + @visibility("read") + isReference?: boolean; ...AssetBase; } + +@doc("FileDatasetVersion Definition") +model FileDatasetVersion extends DatasetVersion { + @doc("Dataset type") + type: DatasetType.uri_file; + + @doc("Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features") + openAIPurpose: string; +} + +@doc("FileDatasetVersion Definition") +model FolderDatasetVersion extends DatasetVersion { + @doc("Dataset type") + type: DatasetType.uri_folder; +}