From a739f2d9c2a3716a6ee01912cfca03b925596cca Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Mon, 17 Mar 2025 15:24:07 -0400 Subject: [PATCH 1/8] Update dataset with extra fields --- .../ai/Azure.AI.Projects/datasets/models.tsp | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index 8c84463130ca..28714abf129b 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") +@discriminator("type") model DatasetVersion { @doc("[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330") @visibility("read", "create") @@ -33,12 +34,28 @@ model DatasetVersion { @pattern("[a-zA-Z0-9_]") datasetUri: string; - @doc("Data type") - datasetType: DatasetType; + @doc("Dataset type") + type: DatasetType; ...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 fields") + openAIPurpose: string; +} + +@doc("FileDatasetVersion Definition") +model FolderDatasetVersion extends DatasetVersion { + @doc("Dataset type") + type: DatasetType.uri_folder; +} + + @doc("PagedDataVersionBase Definition") @pagedResult model PagedDatasetVersion { From 24b7ba6d66f534941b80612d5ea68ecec7af8188 Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Mon, 17 Mar 2025 15:28:45 -0400 Subject: [PATCH 2/8] update a docstring --- specification/ai/Azure.AI.Projects/datasets/models.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index 28714abf129b..d26fa1b2861a 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -45,7 +45,7 @@ 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 fields") + @doc("Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features") openAIPurpose: string; } From 2738956db4f9b3b878731bc970b658ab367be0c6 Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Tue, 18 Mar 2025 15:59:03 -0400 Subject: [PATCH 3/8] add optional version in pendingupload response, and isReference to dataset version --- specification/ai/Azure.AI.Projects/common/models.tsp | 3 +++ specification/ai/Azure.AI.Projects/datasets/models.tsp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index d81f5f0f85bf..9fa74d66894d 100644 --- a/specification/ai/Azure.AI.Projects/common/models.tsp +++ b/specification/ai/Azure.AI.Projects/common/models.tsp @@ -323,6 +323,9 @@ model PendingUploadResponse { @doc("ID for this upload request.") pendingUploadId: string; + @doc("Version of dataset to be created if user did not specify version when initially creating upload") + dataset_version?: string; + @doc("TemporaryBlobReference is the only supported type") pendingUploadType: PendingUploadType.temporaryBlobReference; } diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index d26fa1b2861a..76d5d04fef25 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -37,6 +37,9 @@ model DatasetVersion { @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") + isReference?: boolean; + ...AssetBase; } @@ -55,7 +58,6 @@ model FolderDatasetVersion extends DatasetVersion { type: DatasetType.uri_folder; } - @doc("PagedDataVersionBase Definition") @pagedResult model PagedDatasetVersion { From 842841cc44b12c77642df7fa8a7bb770322873a1 Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Tue, 18 Mar 2025 15:59:20 -0400 Subject: [PATCH 4/8] make isreference readonly --- specification/ai/Azure.AI.Projects/datasets/models.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index 76d5d04fef25..b5843846561d 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -38,6 +38,7 @@ model DatasetVersion { 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; From edda02550c920e908b48ad502f4f0cc76ad40cae Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri <40341266+needuv@users.noreply.github.com> Date: Tue, 18 Mar 2025 16:17:19 -0400 Subject: [PATCH 5/8] add connection name to pendinguploadrequest --- specification/ai/Azure.AI.Projects/common/models.tsp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index 9fa74d66894d..5b9c8f7e116e 100644 --- a/specification/ai/Azure.AI.Projects/common/models.tsp +++ b/specification/ai/Azure.AI.Projects/common/models.tsp @@ -311,6 +311,9 @@ model PendingUploadRequest { @doc("If PendingUploadId is not provided, a random GUID will be used.") pendingUploadId?: string; + @doc("Name of Azure blob storage connection to use for generating temporary SAS token") + connectionName?: string; + @doc("TemporaryBlobReference is the only supported type.") pendingUploadType: PendingUploadType.temporaryBlobReference; } @@ -324,7 +327,7 @@ model PendingUploadResponse { pendingUploadId: string; @doc("Version of dataset to be created if user did not specify version when initially creating upload") - dataset_version?: string; + datasetVersion?: string; @doc("TemporaryBlobReference is the only supported type") pendingUploadType: PendingUploadType.temporaryBlobReference; From c161ea7f5753dadd33b06620001821927e6809e6 Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Wed, 19 Mar 2025 11:45:33 -0400 Subject: [PATCH 6/8] add uri_folder --- specification/ai/Azure.AI.Projects/datasets/models.tsp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index b5843846561d..de8f60574886 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -22,6 +22,9 @@ union DatasetType { @doc("URI file.") uri_file: "uri_file", + + @doc("URI folder.") + uri_file: "uri_folder", } #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" From 7b66e2108b3253e63212bffffeb041afeaa4fa34 Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Wed, 19 Mar 2025 11:47:58 -0400 Subject: [PATCH 7/8] add uri_folder --- specification/ai/Azure.AI.Projects/datasets/models.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index de8f60574886..8a5ad927dba5 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -24,7 +24,7 @@ union DatasetType { uri_file: "uri_file", @doc("URI folder.") - uri_file: "uri_folder", + uri_folder: "uri_folder", } #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" From 3758f1b44fa5674c3696443f8e84445d0e0eb123 Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Wed, 19 Mar 2025 11:48:47 -0400 Subject: [PATCH 8/8] update swagger file --- .../azure-ai-projects-1dp.json | 57 +++++++++++++++++-- 1 file changed, 53 insertions(+), 4 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 67a5d1fcee02..e02d6a2a20b5 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 @@ -9480,7 +9480,8 @@ "type": "string", "description": "Enum to determine the type of data.", "enum": [ - "uri_file" + "uri_file", + "uri_folder" ], "x-ms-enum": { "name": "DatasetType", @@ -9490,6 +9491,11 @@ "name": "uri_file", "value": "uri_file", "description": "URI file." + }, + { + "name": "uri_folder", + "value": "uri_folder", + "description": "URI folder." } ] } @@ -9508,9 +9514,14 @@ "create" ] }, - "datasetType": { + "type": { "$ref": "#/definitions/DatasetType", - "description": "Data type" + "description": "Dataset type" + }, + "isReference": { + "type": "boolean", + "description": "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", + "readOnly": true }, "stage": { "type": "string", @@ -9553,9 +9564,10 @@ "readOnly": true } }, + "discriminator": "type", "required": [ "datasetUri", - "datasetType" + "type" ] }, "Deployment": { @@ -9746,6 +9758,35 @@ ] } }, + "FileDatasetVersion": { + "type": "object", + "description": "FileDatasetVersion Definition", + "properties": { + "openAIPurpose": { + "type": "string", + "description": "Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features" + } + }, + "required": [ + "openAIPurpose" + ], + "allOf": [ + { + "$ref": "#/definitions/DatasetVersion" + } + ], + "x-ms-discriminator-value": "uri_file" + }, + "FolderDatasetVersion": { + "type": "object", + "description": "FileDatasetVersion Definition", + "allOf": [ + { + "$ref": "#/definitions/DatasetVersion" + } + ], + "x-ms-discriminator-value": "uri_folder" + }, "IdAssetReference": { "type": "object", "description": "Reference to an asset via its ARM resource ID.", @@ -10134,6 +10175,10 @@ "type": "string", "description": "If PendingUploadId is not provided, a random GUID will be used." }, + "connectionName": { + "type": "string", + "description": "Name of Azure blob storage connection to use for generating temporary SAS token" + }, "pendingUploadType": { "type": "string", "description": "TemporaryBlobReference is the only supported type.", @@ -10161,6 +10206,10 @@ "type": "string", "description": "ID for this upload request." }, + "datasetVersion": { + "type": "string", + "description": "Version of dataset to be created if user did not specify version when initially creating upload" + }, "pendingUploadType": { "type": "string", "description": "TemporaryBlobReference is the only supported type",