Skip to content
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
6 changes: 6 additions & 0 deletions specification/ai/Azure.AI.Projects/common/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
27 changes: 25 additions & 2 deletions specification/ai/Azure.AI.Projects/datasets/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,46 @@ 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing the update of DatasetType Union to support uri_folder

@doc("DatasetVersion Definition")
@discriminator("type")
model DatasetVersion {
@doc("[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330")
@visibility("read", "create")
@minLength(1)
@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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -9490,6 +9491,11 @@
"name": "uri_file",
"value": "uri_file",
"description": "URI file."
},
{
"name": "uri_folder",
"value": "uri_folder",
"description": "URI folder."
}
]
}
Expand All @@ -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",
Expand Down Expand Up @@ -9553,9 +9564,10 @@
"readOnly": true
}
},
"discriminator": "type",
"required": [
"datasetUri",
"datasetType"
"type"
]
},
"Deployment": {
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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",
Expand Down
Loading