diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index d81f5f0f85bf..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; } @@ -323,6 +326,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") + datasetVersion?: 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 8c84463130ca..8a5ad927dba5 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -22,10 +22,14 @@ 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") +@discriminator("type") model DatasetVersion { @doc("[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330") @visibility("read", "create") @@ -33,12 +37,31 @@ 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; +} + @doc("PagedDataVersionBase Definition") @pagedResult model PagedDatasetVersion { 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",