From 5a2046e89b8013c3dcc7c3fe1427677ca5250a6d Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri Date: Thu, 17 Apr 2025 12:22:52 -0400 Subject: [PATCH 1/2] Add PATCH for asset create/update --- .../ai/Azure.AI.Projects/common/models.tsp | 2 + .../ai/Azure.AI.Projects/indexes/models.tsp | 9 + .../ai/Azure.AI.Projects/servicepatterns.tsp | 23 ++ .../azure-ai-projects-1dp.json | 325 +++++++++++++++++- .../2025-05-01/azure-ai-projects-1dp.json | 325 +++++++++++++++++- .../stable/latest/azure-ai-projects-1dp.json | 325 +++++++++++++++++- 6 files changed, 970 insertions(+), 39 deletions(-) diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index d7dc89981e25..8ed2b8786f34 100644 --- a/specification/ai/Azure.AI.Projects/common/models.tsp +++ b/specification/ai/Azure.AI.Projects/common/models.tsp @@ -51,9 +51,11 @@ alias AssetBase = { version: string; @doc("The asset description text.") + @visibility(Lifecycle.Create, Lifecycle.Update) description?: string; @doc("Tag dictionary. Tags can be added, removed, and updated.") + @visibility(Lifecycle.Create, Lifecycle.Update) tags?: Record; }; diff --git a/specification/ai/Azure.AI.Projects/indexes/models.tsp b/specification/ai/Azure.AI.Projects/indexes/models.tsp index ad27843bace9..4b43af09bb83 100644 --- a/specification/ai/Azure.AI.Projects/indexes/models.tsp +++ b/specification/ai/Azure.AI.Projects/indexes/models.tsp @@ -27,9 +27,11 @@ model AzureAISearchIndex extends Index { type: IndexType.azureSearch; @doc("Name of connection to Azure AI Search") + @visibility(Lifecycle.Create) connectionName: string; @doc("Name of index in Azure AI Search resource to attach") + @visibility(Lifecycle.Create) indexName: string; } @@ -40,6 +42,7 @@ model ManagedAzureAISearchIndex extends Index { type: IndexType.managedAzureSearch; @doc("Vector store id of managed index") + @visibility(Lifecycle.Create) vectorStoreId: string; } @@ -50,15 +53,19 @@ model CosmosDBIndex extends Index { type: IndexType.cosmosDB; @doc("Name of connection to CosmosDB") + @visibility(Lifecycle.Create) connectionName: string; @doc("Name of the CosmosDB Database") + @visibility(Lifecycle.Create) databaseName: string; @doc("Name of CosmosDB Container") + @visibility(Lifecycle.Create) containerName: string; @doc("Embedding model configuration") + @visibility(Lifecycle.Create) embeddingConfiguration: EmbeddingConfiguration; } @@ -66,9 +73,11 @@ model CosmosDBIndex extends Index { @added(Versions.v2025_05_01) model EmbeddingConfiguration { @doc("Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection.") + @visibility(Lifecycle.Create) modelDeploymentName: string; @doc("Embedding field") + @visibility(Lifecycle.Create) embeddingField: string; } diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp index 5ad032bfcd77..4cd44cdb6606 100644 --- a/specification/ai/Azure.AI.Projects/servicepatterns.tsp +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -94,6 +94,29 @@ namespace Azure.AI.Projects.ServicePatterns { }, Azure.Core.Foundations.ResourceCreatedOrOkResponse >; + + @doc( + "Create a new or update an existing {name} with the given version id", + TEntityType + ) + @Http.patch + createOrUpdateVersion 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 + >; } @Rest.action diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects-1dp.json index 62f2c639353c..e7235ed770b5 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-15-preview/azure-ai-projects-1dp.json @@ -693,6 +693,64 @@ } } }, + "patch": { + "operationId": "Datasets_CreateOrUpdateVersion", + "description": "Create a new or update an existing DatasetVersion with the given version id", + "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", + "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/DatasetVersionUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "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 the specific version of the DatasetVersion", @@ -1385,6 +1443,64 @@ } } }, + "patch": { + "operationId": "Indexes_CreateOrUpdateVersion", + "description": "Create a new or update an existing Index with the given version id", + "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", + "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/IndexUpdate" + } + } + ], + "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 the specific version of the Index", @@ -1732,11 +1848,17 @@ "properties": { "connectionName": { "type": "string", - "description": "Name of connection to Azure AI Search" + "description": "Name of connection to Azure AI Search", + "x-ms-mutability": [ + "create" + ] }, "indexName": { "type": "string", - "description": "Name of index in Azure AI Search resource to attach" + "description": "Name of index in Azure AI Search resource to attach", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1750,6 +1872,16 @@ ], "x-ms-discriminator-value": "AzureSearch" }, + "AzureAISearchIndexUpdate": { + "type": "object", + "description": "Azure AI Search Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "AzureSearch" + }, "BaseCredentials": { "type": "object", "description": "A base class for connection credentials", @@ -1913,19 +2045,31 @@ "properties": { "connectionName": { "type": "string", - "description": "Name of connection to CosmosDB" + "description": "Name of connection to CosmosDB", + "x-ms-mutability": [ + "create" + ] }, "databaseName": { "type": "string", - "description": "Name of the CosmosDB Database" + "description": "Name of the CosmosDB Database", + "x-ms-mutability": [ + "create" + ] }, "containerName": { "type": "string", - "description": "Name of CosmosDB Container" + "description": "Name of CosmosDB Container", + "x-ms-mutability": [ + "create" + ] }, "embeddingConfiguration": { "$ref": "#/definitions/EmbeddingConfiguration", - "description": "Embedding model configuration" + "description": "Embedding model configuration", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1941,6 +2085,16 @@ ], "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" }, + "CosmosDBIndexUpdate": { + "type": "object", + "description": "CosmosDB Vector Store Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" + }, "CredentialType": { "type": "string", "description": "The credential type used by the connection", @@ -2066,14 +2220,22 @@ }, "description": { "type": "string", - "description": "The asset description text." + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] }, "tags": { "type": "object", "description": "Tag dictionary. Tags can be added, removed, and updated.", "additionalProperties": { "type": "string" - } + }, + "x-ms-mutability": [ + "update", + "create" + ] } }, "discriminator": "type", @@ -2084,6 +2246,48 @@ "version" ] }, + "DatasetVersionUpdate": { + "type": "object", + "description": "DatasetVersion Definition", + "properties": { + "type": { + "$ref": "#/definitions/DatasetType", + "description": "Dataset type" + }, + "stage": { + "type": "string", + "description": "Asset stage", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + }, + "description": { + "type": "string", + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] + }, + "tags": { + "type": "object", + "description": "Tag dictionary. Tags can be added, removed, and updated.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "update", + "create" + ] + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, "Deployment": { "type": "object", "description": "Model Deployment Definition", @@ -2127,11 +2331,17 @@ "properties": { "modelDeploymentName": { "type": "string", - "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection." + "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection.", + "x-ms-mutability": [ + "create" + ] }, "embeddingField": { "type": "string", - "description": "Embedding field" + "description": "Embedding field", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -2247,6 +2457,22 @@ ], "x-ms-discriminator-value": "uri_file" }, + "FileDatasetVersionUpdate": { + "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" + } + }, + "allOf": [ + { + "$ref": "#/definitions/DatasetVersionUpdate" + } + ], + "x-ms-discriminator-value": "uri_file" + }, "FolderDatasetVersion": { "type": "object", "description": "FileDatasetVersion Definition", @@ -2257,6 +2483,16 @@ ], "x-ms-discriminator-value": "uri_folder" }, + "FolderDatasetVersionUpdate": { + "type": "object", + "description": "FileDatasetVersion Definition", + "allOf": [ + { + "$ref": "#/definitions/DatasetVersionUpdate" + } + ], + "x-ms-discriminator-value": "uri_folder" + }, "Index": { "type": "object", "description": "Index resource Definition", @@ -2291,14 +2527,22 @@ }, "description": { "type": "string", - "description": "The asset description text." + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] }, "tags": { "type": "object", "description": "Tag dictionary. Tags can be added, removed, and updated.", "additionalProperties": { "type": "string" - } + }, + "x-ms-mutability": [ + "update", + "create" + ] } }, "discriminator": "type", @@ -2337,6 +2581,48 @@ ] } }, + "IndexUpdate": { + "type": "object", + "description": "Index resource Definition", + "properties": { + "type": { + "$ref": "#/definitions/IndexType", + "description": "Type of index" + }, + "stage": { + "type": "string", + "description": "Asset stage", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + }, + "description": { + "type": "string", + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] + }, + "tags": { + "type": "object", + "description": "Tag dictionary. Tags can be added, removed, and updated.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "update", + "create" + ] + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, "InputData": { "type": "object", "description": "Abstract data class.", @@ -2452,7 +2738,10 @@ "properties": { "vectorStoreId": { "type": "string", - "description": "Vector store id of managed index" + "description": "Vector store id of managed index", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -2465,6 +2754,16 @@ ], "x-ms-discriminator-value": "ManagedAzureSearch" }, + "ManagedAzureAISearchIndexUpdate": { + "type": "object", + "description": "Managed Azure AI Search Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "ManagedAzureSearch" + }, "ModelDeployment": { "type": "object", "description": "Model Deployment Definition", diff --git a/specification/ai/data-plane/Azure.AI.Projects/stable/2025-05-01/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/stable/2025-05-01/azure-ai-projects-1dp.json index b55f77784708..ef090de6db30 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/stable/2025-05-01/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/stable/2025-05-01/azure-ai-projects-1dp.json @@ -693,6 +693,64 @@ } } }, + "patch": { + "operationId": "Datasets_CreateOrUpdateVersion", + "description": "Create a new or update an existing DatasetVersion with the given version id", + "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", + "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/DatasetVersionUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "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 the specific version of the DatasetVersion", @@ -1244,6 +1302,64 @@ } } }, + "patch": { + "operationId": "Indexes_CreateOrUpdateVersion", + "description": "Create a new or update an existing Index with the given version id", + "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", + "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/IndexUpdate" + } + } + ], + "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 the specific version of the Index", @@ -1384,11 +1500,17 @@ "properties": { "connectionName": { "type": "string", - "description": "Name of connection to Azure AI Search" + "description": "Name of connection to Azure AI Search", + "x-ms-mutability": [ + "create" + ] }, "indexName": { "type": "string", - "description": "Name of index in Azure AI Search resource to attach" + "description": "Name of index in Azure AI Search resource to attach", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1402,6 +1524,16 @@ ], "x-ms-discriminator-value": "AzureSearch" }, + "AzureAISearchIndexUpdate": { + "type": "object", + "description": "Azure AI Search Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "AzureSearch" + }, "BaseCredentials": { "type": "object", "description": "A base class for connection credentials", @@ -1565,19 +1697,31 @@ "properties": { "connectionName": { "type": "string", - "description": "Name of connection to CosmosDB" + "description": "Name of connection to CosmosDB", + "x-ms-mutability": [ + "create" + ] }, "databaseName": { "type": "string", - "description": "Name of the CosmosDB Database" + "description": "Name of the CosmosDB Database", + "x-ms-mutability": [ + "create" + ] }, "containerName": { "type": "string", - "description": "Name of CosmosDB Container" + "description": "Name of CosmosDB Container", + "x-ms-mutability": [ + "create" + ] }, "embeddingConfiguration": { "$ref": "#/definitions/EmbeddingConfiguration", - "description": "Embedding model configuration" + "description": "Embedding model configuration", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1593,6 +1737,16 @@ ], "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" }, + "CosmosDBIndexUpdate": { + "type": "object", + "description": "CosmosDB Vector Store Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" + }, "CredentialType": { "type": "string", "description": "The credential type used by the connection", @@ -1718,14 +1872,22 @@ }, "description": { "type": "string", - "description": "The asset description text." + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] }, "tags": { "type": "object", "description": "Tag dictionary. Tags can be added, removed, and updated.", "additionalProperties": { "type": "string" - } + }, + "x-ms-mutability": [ + "update", + "create" + ] } }, "discriminator": "type", @@ -1736,6 +1898,48 @@ "version" ] }, + "DatasetVersionUpdate": { + "type": "object", + "description": "DatasetVersion Definition", + "properties": { + "type": { + "$ref": "#/definitions/DatasetType", + "description": "Dataset type" + }, + "stage": { + "type": "string", + "description": "Asset stage", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + }, + "description": { + "type": "string", + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] + }, + "tags": { + "type": "object", + "description": "Tag dictionary. Tags can be added, removed, and updated.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "update", + "create" + ] + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, "Deployment": { "type": "object", "description": "Model Deployment Definition", @@ -1779,11 +1983,17 @@ "properties": { "modelDeploymentName": { "type": "string", - "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection." + "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection.", + "x-ms-mutability": [ + "create" + ] }, "embeddingField": { "type": "string", - "description": "Embedding field" + "description": "Embedding field", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1820,6 +2030,22 @@ ], "x-ms-discriminator-value": "uri_file" }, + "FileDatasetVersionUpdate": { + "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" + } + }, + "allOf": [ + { + "$ref": "#/definitions/DatasetVersionUpdate" + } + ], + "x-ms-discriminator-value": "uri_file" + }, "FolderDatasetVersion": { "type": "object", "description": "FileDatasetVersion Definition", @@ -1830,6 +2056,16 @@ ], "x-ms-discriminator-value": "uri_folder" }, + "FolderDatasetVersionUpdate": { + "type": "object", + "description": "FileDatasetVersion Definition", + "allOf": [ + { + "$ref": "#/definitions/DatasetVersionUpdate" + } + ], + "x-ms-discriminator-value": "uri_folder" + }, "Index": { "type": "object", "description": "Index resource Definition", @@ -1864,14 +2100,22 @@ }, "description": { "type": "string", - "description": "The asset description text." + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] }, "tags": { "type": "object", "description": "Tag dictionary. Tags can be added, removed, and updated.", "additionalProperties": { "type": "string" - } + }, + "x-ms-mutability": [ + "update", + "create" + ] } }, "discriminator": "type", @@ -1910,6 +2154,48 @@ ] } }, + "IndexUpdate": { + "type": "object", + "description": "Index resource Definition", + "properties": { + "type": { + "$ref": "#/definitions/IndexType", + "description": "Type of index" + }, + "stage": { + "type": "string", + "description": "Asset stage", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + }, + "description": { + "type": "string", + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] + }, + "tags": { + "type": "object", + "description": "Tag dictionary. Tags can be added, removed, and updated.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "update", + "create" + ] + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, "Internal.ConnectionPaged": { "type": "object", "description": "Paged collection of Connection items", @@ -1992,7 +2278,10 @@ "properties": { "vectorStoreId": { "type": "string", - "description": "Vector store id of managed index" + "description": "Vector store id of managed index", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -2005,6 +2294,16 @@ ], "x-ms-discriminator-value": "ManagedAzureSearch" }, + "ManagedAzureAISearchIndexUpdate": { + "type": "object", + "description": "Managed Azure AI Search Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "ManagedAzureSearch" + }, "ModelDeployment": { "type": "object", "description": "Model Deployment Definition", diff --git a/specification/ai/data-plane/Azure.AI.Projects/stable/latest/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/stable/latest/azure-ai-projects-1dp.json index 46b392b25d19..3b7b6180315b 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/stable/latest/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/stable/latest/azure-ai-projects-1dp.json @@ -693,6 +693,64 @@ } } }, + "patch": { + "operationId": "Datasets_CreateOrUpdateVersion", + "description": "Create a new or update an existing DatasetVersion with the given version id", + "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", + "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/DatasetVersionUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "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 the specific version of the DatasetVersion", @@ -1244,6 +1302,64 @@ } } }, + "patch": { + "operationId": "Indexes_CreateOrUpdateVersion", + "description": "Create a new or update an existing Index with the given version id", + "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", + "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/IndexUpdate" + } + } + ], + "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 the specific version of the Index", @@ -1384,11 +1500,17 @@ "properties": { "connectionName": { "type": "string", - "description": "Name of connection to Azure AI Search" + "description": "Name of connection to Azure AI Search", + "x-ms-mutability": [ + "create" + ] }, "indexName": { "type": "string", - "description": "Name of index in Azure AI Search resource to attach" + "description": "Name of index in Azure AI Search resource to attach", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1402,6 +1524,16 @@ ], "x-ms-discriminator-value": "AzureSearch" }, + "AzureAISearchIndexUpdate": { + "type": "object", + "description": "Azure AI Search Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "AzureSearch" + }, "BaseCredentials": { "type": "object", "description": "A base class for connection credentials", @@ -1565,19 +1697,31 @@ "properties": { "connectionName": { "type": "string", - "description": "Name of connection to CosmosDB" + "description": "Name of connection to CosmosDB", + "x-ms-mutability": [ + "create" + ] }, "databaseName": { "type": "string", - "description": "Name of the CosmosDB Database" + "description": "Name of the CosmosDB Database", + "x-ms-mutability": [ + "create" + ] }, "containerName": { "type": "string", - "description": "Name of CosmosDB Container" + "description": "Name of CosmosDB Container", + "x-ms-mutability": [ + "create" + ] }, "embeddingConfiguration": { "$ref": "#/definitions/EmbeddingConfiguration", - "description": "Embedding model configuration" + "description": "Embedding model configuration", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1593,6 +1737,16 @@ ], "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" }, + "CosmosDBIndexUpdate": { + "type": "object", + "description": "CosmosDB Vector Store Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" + }, "CredentialType": { "type": "string", "description": "The credential type used by the connection", @@ -1718,14 +1872,22 @@ }, "description": { "type": "string", - "description": "The asset description text." + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] }, "tags": { "type": "object", "description": "Tag dictionary. Tags can be added, removed, and updated.", "additionalProperties": { "type": "string" - } + }, + "x-ms-mutability": [ + "update", + "create" + ] } }, "discriminator": "type", @@ -1736,6 +1898,48 @@ "version" ] }, + "DatasetVersionUpdate": { + "type": "object", + "description": "DatasetVersion Definition", + "properties": { + "type": { + "$ref": "#/definitions/DatasetType", + "description": "Dataset type" + }, + "stage": { + "type": "string", + "description": "Asset stage", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + }, + "description": { + "type": "string", + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] + }, + "tags": { + "type": "object", + "description": "Tag dictionary. Tags can be added, removed, and updated.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "update", + "create" + ] + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, "Deployment": { "type": "object", "description": "Model Deployment Definition", @@ -1779,11 +1983,17 @@ "properties": { "modelDeploymentName": { "type": "string", - "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection." + "description": "Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection.", + "x-ms-mutability": [ + "create" + ] }, "embeddingField": { "type": "string", - "description": "Embedding field" + "description": "Embedding field", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -1820,6 +2030,22 @@ ], "x-ms-discriminator-value": "uri_file" }, + "FileDatasetVersionUpdate": { + "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" + } + }, + "allOf": [ + { + "$ref": "#/definitions/DatasetVersionUpdate" + } + ], + "x-ms-discriminator-value": "uri_file" + }, "FolderDatasetVersion": { "type": "object", "description": "FileDatasetVersion Definition", @@ -1830,6 +2056,16 @@ ], "x-ms-discriminator-value": "uri_folder" }, + "FolderDatasetVersionUpdate": { + "type": "object", + "description": "FileDatasetVersion Definition", + "allOf": [ + { + "$ref": "#/definitions/DatasetVersionUpdate" + } + ], + "x-ms-discriminator-value": "uri_folder" + }, "Index": { "type": "object", "description": "Index resource Definition", @@ -1864,14 +2100,22 @@ }, "description": { "type": "string", - "description": "The asset description text." + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] }, "tags": { "type": "object", "description": "Tag dictionary. Tags can be added, removed, and updated.", "additionalProperties": { "type": "string" - } + }, + "x-ms-mutability": [ + "update", + "create" + ] } }, "discriminator": "type", @@ -1910,6 +2154,48 @@ ] } }, + "IndexUpdate": { + "type": "object", + "description": "Index resource Definition", + "properties": { + "type": { + "$ref": "#/definitions/IndexType", + "description": "Type of index" + }, + "stage": { + "type": "string", + "description": "Asset stage", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + }, + "description": { + "type": "string", + "description": "The asset description text.", + "x-ms-mutability": [ + "update", + "create" + ] + }, + "tags": { + "type": "object", + "description": "Tag dictionary. Tags can be added, removed, and updated.", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "update", + "create" + ] + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, "Internal.ConnectionPaged": { "type": "object", "description": "Paged collection of Connection items", @@ -1992,7 +2278,10 @@ "properties": { "vectorStoreId": { "type": "string", - "description": "Vector store id of managed index" + "description": "Vector store id of managed index", + "x-ms-mutability": [ + "create" + ] } }, "required": [ @@ -2005,6 +2294,16 @@ ], "x-ms-discriminator-value": "ManagedAzureSearch" }, + "ManagedAzureAISearchIndexUpdate": { + "type": "object", + "description": "Managed Azure AI Search Index Definition", + "allOf": [ + { + "$ref": "#/definitions/IndexUpdate" + } + ], + "x-ms-discriminator-value": "ManagedAzureSearch" + }, "ModelDeployment": { "type": "object", "description": "Model Deployment Definition", From 05904d2596dab113437b3bf753ebdb8e988420ef Mon Sep 17 00:00:00 2001 From: Neehar Duvvuri <40341266+needuv@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:06:49 -0400 Subject: [PATCH 2/2] Update specification/ai/Azure.AI.Projects/servicepatterns.tsp Co-authored-by: Johan Stenberg (MSFT) --- specification/ai/Azure.AI.Projects/servicepatterns.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp index 4cd44cdb6606..8f7aeda4a975 100644 --- a/specification/ai/Azure.AI.Projects/servicepatterns.tsp +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -111,7 +111,7 @@ namespace Azure.AI.Projects.ServicePatterns { @Http.path version: string; - @doc("The definition of the {name} to create", TEntityType) + @doc("The definition of the {name} to create or update", TEntityType) @Http.bodyRoot body: TEntityType; },