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
Remove credentials folder and fix some route names
  • Loading branch information
Neehar Duvvuri authored and Neehar Duvvuri committed Mar 31, 2025
commit 9d1230bc699358a0ba2f4c8674fd3cc8dffa7e85
12 changes: 11 additions & 1 deletion specification/ai/Azure.AI.Projects/common/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion specification/ai/Azure.AI.Projects/connections/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<string>;
}

Expand Down
50 changes: 0 additions & 50 deletions specification/ai/Azure.AI.Projects/credentials/models.tsp

This file was deleted.

10 changes: 5 additions & 5 deletions specification/ai/Azure.AI.Projects/evaluation-results/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ interface EvaluationResults
PendingUploadRequest,
PendingUploadResponse
>;
}
}
94 changes: 47 additions & 47 deletions specification/ai/Azure.AI.Projects/red-teams/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand All @@ -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<string>;
@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<string>;

@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<string>;
@doc("Red team's tags. Unlike properties, tags are fully mutable.")
tags?: Record<string>;

@doc("Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.")
properties?: Record<string>;
@doc("Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.")
properties?: Record<string>;

@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;
}
2 changes: 1 addition & 1 deletion specification/ai/Azure.AI.Projects/red-teams/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ alias RedTeamServiceTraits = SupportsClientRequestId &

alias RedTeamOperations = Azure.Core.ResourceOperations<RedTeamServiceTraits>;

@route("red-teams")
@route("redTeams")
interface RedTeams {
@doc("Get a redteam by name.")
get is RedTeamOperations.ResourceRead<RedTeam>;
Expand Down
Loading
Loading