diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index c432a27cfe6a..95d6ed924801 100644 --- a/specification/ai/Azure.AI.Projects/common/models.tsp +++ b/specification/ai/Azure.AI.Projects/common/models.tsp @@ -2,7 +2,6 @@ import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; -import "../credentials/models.tsp"; using TypeSpec.Http; @@ -308,6 +307,17 @@ model PendingUploadResponse { pendingUploadType: PendingUploadType.temporaryBlobReference; } +@doc("SAS Credential definition") +model SasCredential { + @doc("SAS uri") + @visibility(Lifecycle.Read) + sasUri: string; + + @visibility(Lifecycle.Read) + @doc("Type of credential") + type: "SAS"; +} + @doc("Represents a reference to a blob for consumption") model BlobReferenceForConsumption { @doc("Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path") diff --git a/specification/ai/Azure.AI.Projects/connections/models.tsp b/specification/ai/Azure.AI.Projects/connections/models.tsp index d2119b8dbea0..2965a0018d47 100644 --- a/specification/ai/Azure.AI.Projects/connections/models.tsp +++ b/specification/ai/Azure.AI.Projects/connections/models.tsp @@ -4,7 +4,6 @@ import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "@typespec/openapi"; import "@typespec/versioning"; -import "../credentials/models.tsp"; using TypeSpec.Rest; @@ -27,9 +26,11 @@ model Connection { target: string; @doc("The authentication type used by the connection") + @visibility(Lifecycle.Read) authType: AuthenticationType; @doc("Metadata of the connection") + @visibility(Lifecycle.Read) metadata: Record; } diff --git a/specification/ai/Azure.AI.Projects/credentials/models.tsp b/specification/ai/Azure.AI.Projects/credentials/models.tsp deleted file mode 100644 index 69c8f8d8c056..000000000000 --- a/specification/ai/Azure.AI.Projects/credentials/models.tsp +++ /dev/null @@ -1,50 +0,0 @@ -import "@typespec/rest"; -import "@azure-tools/typespec-autorest"; -import "@typespec/versioning"; -import "@azure-tools/typespec-azure-core"; -import "@typespec/openapi"; - -namespace Azure.AI.Projects; - -@doc("The different Credential types") -union CredentialType { - string, - ApiKey: "ApiKey", - AAD: "AAD", - SAS: "SAS", -} - -@doc("Base Credential definition") -@discriminator("type") -model BaseCredential { - @doc("Type of credential. Possible values are: AAD, SAS, ApiKey") - @visibility(Lifecycle.Read) - type: CredentialType; -} - -@doc("ApiKey Credential definition") -model ApiKeyCredential extends BaseCredential { - @doc("API Key") - @visibility(Lifecycle.Read) - apiKey: string; - - @visibility(Lifecycle.Read) - type: CredentialType.ApiKey; -} - -@doc("AAD Credential definition") -model AadCredential extends BaseCredential { - // No properties need to be stored for this case - @visibility(Lifecycle.Read) - type: CredentialType.AAD; -} - -@doc("SAS Credential definition") -model SasCredential extends BaseCredential { - @doc("SAS Token") - @visibility(Lifecycle.Read) - sasToken: string; - - @visibility(Lifecycle.Read) - type: CredentialType.SAS; -} diff --git a/specification/ai/Azure.AI.Projects/evaluation-results/models.tsp b/specification/ai/Azure.AI.Projects/evaluation-results/models.tsp index c02c3d74cc70..1fd90b10ca87 100644 --- a/specification/ai/Azure.AI.Projects/evaluation-results/models.tsp +++ b/specification/ai/Azure.AI.Projects/evaluation-results/models.tsp @@ -15,7 +15,7 @@ using Azure.Core.Traits; namespace Azure.AI.Projects; @doc("Evaluation Result resource Definition") -@Rest.resource("evaluationResult") +@Rest.resource("evaluationResults") model EvaluationResult { @doc("Type of Evaluation result") ResultType?: ResultType; @@ -49,14 +49,14 @@ union ResultType { string, @doc("Benchmark result") - Benchmark: "Benchmark"; + Benchmark: "Benchmark", @doc("Evaluations Result") - Evaluation: "Evaluation"; + Evaluation: "Evaluation", @doc("Red Team Result") - Redteam: "Redteam"; + Redteam: "Redteam", @doc("Simulation Result") - Simulation: "Simulation"; + Simulation: "Simulation", } diff --git a/specification/ai/Azure.AI.Projects/evaluation-results/routes.tsp b/specification/ai/Azure.AI.Projects/evaluation-results/routes.tsp index 8b1a99de9de7..f20385bf34ff 100644 --- a/specification/ai/Azure.AI.Projects/evaluation-results/routes.tsp +++ b/specification/ai/Azure.AI.Projects/evaluation-results/routes.tsp @@ -42,4 +42,4 @@ interface EvaluationResults PendingUploadRequest, PendingUploadResponse >; -} \ No newline at end of file +} diff --git a/specification/ai/Azure.AI.Projects/red-teams/models.tsp b/specification/ai/Azure.AI.Projects/red-teams/models.tsp index 262ed4cc3b89..19b57119aec0 100644 --- a/specification/ai/Azure.AI.Projects/red-teams/models.tsp +++ b/specification/ai/Azure.AI.Projects/red-teams/models.tsp @@ -17,39 +17,40 @@ namespace Azure.AI.Projects; @doc("Strategies for attacks.") union AttackStrategy { - string, + string, - @doc("Represents a default set of easy complexity attacks. Easy complexity attack strategies are defined as attacks that do not require any Large Language Model to convert or orchestrate.") - Easy: "easy", + @doc("Represents a default set of easy complexity attacks. Easy complexity attack strategies are defined as attacks that do not require any Large Language Model to convert or orchestrate.") + Easy: "easy", - @doc("Represents ASCII art, a graphic design technique that uses printable characters.") - AsciiArt: "ascii_art", + @doc("Represents ASCII art, a graphic design technique that uses printable characters.") + AsciiArt: "ascii_art", - @doc("Represents ASCII smuggling, a technique for encoding or hiding data.") - AsciiSmuggler: "ascii_smuggler", + @doc("Represents ASCII smuggling, a technique for encoding or hiding data.") + AsciiSmuggler: "ascii_smuggler", - @doc("Represents the Atbash cipher, a substitution cipher that reverses the alphabet.") - Atbash: "atbash", + @doc("Represents the Atbash cipher, a substitution cipher that reverses the alphabet.") + Atbash: "atbash", - @doc("Represents Base64 encoding, a method for encoding binary data as text.") - Base64: "base64", + @doc("Represents Base64 encoding, a method for encoding binary data as text.") + Base64: "base64", - @doc("Represents binary encoding, a representation of data in binary format.") - Binary: "binary", + @doc("Represents binary encoding, a representation of data in binary format.") + Binary: "binary", - @doc("Represents the Caesar cipher, a substitution cipher that shifts characters.") - Caesar: "caesar", + @doc("Represents the Caesar cipher, a substitution cipher that shifts characters.") + Caesar: "caesar", - @doc("Represents character space manipulation, a technique involving spacing between characters.") - CharacterSpace: "character_space", + @doc("Represents character space manipulation, a technique involving spacing between characters.") + CharacterSpace: "character_space", - @doc("Represents character swapping, a technique for rearranging characters in text.") - Jailbreak: "jailbreak", + @doc("Represents character swapping, a technique for rearranging characters in text.") + Jailbreak: "jailbreak", } @doc("Risk category for the attack objective.") union RiskCategory { string, + @doc("Represents content related to hate or unfairness.") HateUnfairness: "HateUnfairness", @@ -69,47 +70,46 @@ union RiskCategory { CodeVulnerability: "CodeVulnerability", @doc("Represents content with ungrounded attributes.") - UngroundedAttributes: "UngroundedAttributes" + UngroundedAttributes: "UngroundedAttributes", } - @doc("Red team details.") @resource("runs") model RedTeam { - @doc("Identifier of the red team.") - @key("name") - @visibility(Lifecycle.Read) - id: string; + @doc("Identifier of the red team.") + @key("name") + @visibility(Lifecycle.Read) + id: string; - @doc("Name of the red-team scan.") - scanName: string; + @doc("Name of the red-team scan.") + scanName: string; - @doc("Number of simulation rounds.") - numTurns: int32; + @doc("Number of simulation rounds.") + numTurns: int32; - @doc("List of attack strategies or nested lists of attack strategies.") - attackStrategy: AttackStrategy[]; + @doc("List of attack strategies or nested lists of attack strategies.") + attackStrategy: AttackStrategy[]; - @doc("Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result.") - simulationOnly: boolean; + @doc("Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result.") + simulationOnly: boolean; - @doc("Read-only result outputs. Example: { 'redTeamResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/{dataset-version}' }") - @visibility(Lifecycle.Read) - outputs: Record; + @doc("Read-only result outputs. Example: { 'redTeamResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/{dataset-version}' }") + @visibility(Lifecycle.Read) + outputs: Record; - @doc("List of risk categories to generate attack objectives for.") - riskCategories: RiskCategory[]; + @doc("List of risk categories to generate attack objectives for.") + riskCategories: RiskCategory[]; - @doc("Application scenario for the red team operation, to generate scenario specific attacks.") - applicationScenario?: string; + @doc("Application scenario for the red team operation, to generate scenario specific attacks.") + applicationScenario?: string; - @doc("Red team's tags. Unlike properties, tags are fully mutable.") - tags?: Record; + @doc("Red team's tags. Unlike properties, tags are fully mutable.") + tags?: Record; - @doc("Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.") - properties?: Record; + @doc("Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.") + properties?: Record; - @doc("Status of the red-team. It is set by service and is read-only.") - @visibility(Lifecycle.Read) - status?: string; + @doc("Status of the red-team. It is set by service and is read-only.") + @visibility(Lifecycle.Read) + status?: string; } diff --git a/specification/ai/Azure.AI.Projects/red-teams/routes.tsp b/specification/ai/Azure.AI.Projects/red-teams/routes.tsp index 54a0834bc748..b3d9c62a3824 100644 --- a/specification/ai/Azure.AI.Projects/red-teams/routes.tsp +++ b/specification/ai/Azure.AI.Projects/red-teams/routes.tsp @@ -19,7 +19,7 @@ alias RedTeamServiceTraits = SupportsClientRequestId & alias RedTeamOperations = Azure.Core.ResourceOperations; -@route("red-teams") +@route("redTeams") interface RedTeams { @doc("Get a redteam by name.") get is RedTeamOperations.ResourceRead; 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 16c17db149ee..597f676bff4e 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 @@ -1106,7 +1106,7 @@ } } }, - "/evaluationResult": { + "/evaluationResults": { "get": { "operationId": "EvaluationResults_ListLatest", "description": "List the latest version of each EvaluationResult", @@ -1195,7 +1195,7 @@ } } }, - "/evaluationResult/{name}/versions": { + "/evaluationResults/{name}/versions": { "get": { "operationId": "EvaluationResults_ListVersions", "description": "List all versions of the given EvaluationResult", @@ -1376,7 +1376,7 @@ } } }, - "/evaluationResult/{name}/versions/{version}": { + "/evaluationResults/{name}/versions/{version}": { "get": { "operationId": "EvaluationResults_GetVersion", "description": "Get the specific version of the EvaluationResult", @@ -1519,7 +1519,7 @@ } } }, - "/evaluationResult/{name}/versions/{version}/startPendingUpload": { + "/evaluationResults/{name}/versions/{version}/startPendingUpload": { "post": { "operationId": "EvaluationResults_StartPendingUpload", "description": "Create or start a pending upload of a evaluation results for a specific version.", @@ -2432,7 +2432,7 @@ } } }, - "/red-teams/runs": { + "/redTeams/runs": { "get": { "operationId": "RedTeams_List", "description": "List a redteam by name.", @@ -2485,7 +2485,7 @@ } } }, - "/red-teams/runs/{name}": { + "/redTeams/runs/{name}": { "get": { "operationId": "RedTeams_Get", "description": "Get a redteam by name.", @@ -2533,7 +2533,7 @@ } } }, - "/red-teams/runs:run": { + "/redTeams/runs:run": { "post": { "operationId": "RedTeams_CreateRun", "description": "Creates a redteam run.", @@ -4660,36 +4660,6 @@ } }, "definitions": { - "AadCredential": { - "type": "object", - "description": "AAD Credential definition", - "allOf": [ - { - "$ref": "#/definitions/BaseCredential" - } - ], - "x-ms-discriminator-value": "AAD" - }, - "ApiKeyCredential": { - "type": "object", - "description": "ApiKey Credential definition", - "properties": { - "apiKey": { - "type": "string", - "description": "API Key", - "readOnly": true - } - }, - "required": [ - "apiKey" - ], - "allOf": [ - { - "$ref": "#/definitions/BaseCredential" - } - ], - "x-ms-discriminator-value": "ApiKey" - }, "ApiResponseFormat": { "type": "string", "description": "Possible API response formats.", @@ -10501,21 +10471,6 @@ ], "x-ms-discriminator-value": "AzureSearch" }, - "BaseCredential": { - "type": "object", - "description": "Base Credential definition", - "properties": { - "type": { - "$ref": "#/definitions/CredentialType", - "description": "Type of credential. Possible values are: AAD, SAS, ApiKey", - "readOnly": true - } - }, - "discriminator": "type", - "required": [ - "type" - ] - }, "BlobReferenceForConsumption": { "type": "object", "description": "Represents a reference to a blob for consumption", @@ -10560,14 +10515,16 @@ }, "authType": { "$ref": "#/definitions/AuthenticationType", - "description": "The authentication type used by the connection" + "description": "The authentication type used by the connection", + "readOnly": true }, "metadata": { "type": "object", "description": "Metadata of the connection", "additionalProperties": { "type": "string" - } + }, + "readOnly": true } }, "required": [ @@ -10666,33 +10623,6 @@ ], "x-ms-discriminator-value": "CosmosDBNoSqlVectorStore" }, - "CredentialType": { - "type": "string", - "description": "The different Credential types", - "enum": [ - "ApiKey", - "AAD", - "SAS" - ], - "x-ms-enum": { - "name": "CredentialType", - "modelAsString": true, - "values": [ - { - "name": "ApiKey", - "value": "ApiKey" - }, - { - "name": "AAD", - "value": "AAD" - }, - { - "name": "SAS", - "value": "SAS" - } - ] - } - }, "DataPathAssetReference": { "type": "object", "description": "Reference to an asset via its path in a datastore.", @@ -11843,21 +11773,27 @@ "type": "object", "description": "SAS Credential definition", "properties": { - "sasToken": { + "sasUri": { "type": "string", - "description": "SAS Token", + "description": "SAS uri", + "readOnly": true + }, + "type": { + "type": "string", + "description": "Type of credential", + "enum": [ + "SAS" + ], + "x-ms-enum": { + "modelAsString": false + }, "readOnly": true } }, "required": [ - "sasToken" - ], - "allOf": [ - { - "$ref": "#/definitions/BaseCredential" - } - ], - "x-ms-discriminator-value": "SAS" + "sasUri", + "type" + ] }, "Sku": { "type": "object",