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
191 changes: 0 additions & 191 deletions specification/ai/Azure.AI.Projects/common/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ using TypeSpec.Http;

namespace Azure.AI.Projects;

@doc("The possible values for roles attributed to messages in a thread.")
union MessageRole {
string,

@doc("The role representing the end-user.")
user: "user",

@doc("The role representing the assistant.")
assistant: "assistant",
}

@doc("The available sorting options when requesting a list of response objects.")
union ListSortOrder {
string,
Expand All @@ -29,106 +18,6 @@ union ListSortOrder {
descending: "desc",
}

alias OpenAIListRequestOptions = {
@doc("A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.")
@query
limit?: int32 = 20;

@doc("Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.")
@query
order?: ListSortOrder = ListSortOrder.descending;

@doc("A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.")
@query
after?: string;

@doc("A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.")
@query
before?: string;
};

#suppress "@azure-tools/typespec-azure-core/casing-style" "OpenAI is a case-sensitive name"
@doc("The response data for a requested list of items.")
model OpenAIPageableListOf<T> {
@doc("The object type, which is always list.")
object: "list";

@doc("The requested list of items.")
data: T[];

@encodedName("application/json", "first_id")
@doc("The first ID represented in this list.")
firstId: string;

@encodedName("application/json", "last_id")
@doc("The last ID represented in this list.")
lastId: string;

@encodedName("application/json", "has_more")
@doc("A value indicating whether there are additional values available not captured in this list.")
hasMore: boolean;
}

alias DeletionStatus = {
@doc("The ID of the resource specified for deletion.")
id: string;

@doc("A value indicating whether deletion was successful.")
deleted: boolean;
};

alias RequiredNullableMetadata = {
#suppress "@azure-tools/typespec-azure-core/no-nullable" "OpenAI uses explicit nullability, distinct from optionality"
@doc("A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.")
metadata: Record<string> | null;
};

alias OptionalNullableMetadata = {
#suppress "@azure-tools/typespec-azure-core/no-nullable" "OpenAI uses explicit nullability, distinct from optionality"
@doc("A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.")
metadata?: Record<string> | null;
};

#suppress "@azure-tools/typespec-autorest/union-unsupported" "This union is defined according to the OpenAI API"
@doc("Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. Setting to `{ \"type\": \"json_object\" }` enables JSON mode, which guarantees the message the model generates is valid JSON. **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.")
union AssistantsApiResponseFormatOption {
string,

@doc("The model will handle the return format.")
AssistantsApiResponseFormatMode,

@doc("Sets the format of the output of the model when a ToolCall is returned.")
AssistantsApiResponseFormat,
}

@doc("Represents the mode in which the model will handle the return format of a tool call.")
union AssistantsApiResponseFormatMode {
string,

@doc("Default value. Let the model handle the return format.")
"auto",

@doc("Setting the value to `none`, will result in a 400 Bad request.")
"none",
}

@doc("An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. If `text` the model can return text or any value needed.")
model AssistantsApiResponseFormat {
@doc("Must be one of `text` or `json_object`.")
type?: ApiResponseFormat = ApiResponseFormat.text;
}

@doc("Possible API response formats.")
union ApiResponseFormat {
string,

@doc("`text` format should be used for requests involving any sort of ToolCall.")
text: "text",

@doc("Using `json_object` format will limit the usage of ToolCall to only functions.")
jsonObject: "json_object",
}

@doc("List View Type Definition")
union ListViewType {
string,
Expand All @@ -143,62 +32,6 @@ union ListViewType {
All: "All",
}

@doc("Enum to determine which reference method to use for an asset.")
union ReferenceType {
string,

@doc("Id")
Id: "Id",

@doc("DataPath")
DataPath: "DataPath",

@doc("OutputPath")
OutputPath: "OutputPath",
}

@doc("Base definition for asset references.")
@discriminator("referenceType")
model AssetReferenceBase {
@doc("Asset reference type.")
referenceType: ReferenceType;
}

@doc("Reference to an asset via its ARM resource ID.")
model IdAssetReference extends AssetReferenceBase {
@doc("[Required] ARM resource ID of the asset.")
@minLength(1)
@pattern("[a-zA-Z0-9_]")
assetId: string;

@doc("[Required] Specifies the type of asset reference.")
referenceType: "Id";
}

@doc("Reference to an asset via its path in a datastore.")
model DataPathAssetReference extends AssetReferenceBase {
@doc("ARM resource ID of the datastore where the asset is located.")
datastoreId?: string;

@doc("The path of the file/directory in the datastore.")
path?: string;

@doc("[Required] Specifies the type of asset reference.")
referenceType: "DataPath";
}

@doc("Reference to an asset via its path in a job output.")
model OutputPathAssetReference extends AssetReferenceBase {
@doc("ARM resource ID of the job.")
jobId?: string;

@doc("The path of the file/directory in the job output.")
path?: string;

@doc("[Required] Specifies the type of asset reference.")
referenceType: "OutputPath";
}

alias AssetBase = {
@doc("Asset stage")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
Expand Down Expand Up @@ -232,30 +65,6 @@ alias ResourceCreatedResponse<T extends TypeSpec.Reflection.Model> = TypeSpec.Ht
alias OkResponse<T extends TypeSpec.Reflection.Model> = TypeSpec.Http.Response<200> &
T;

alias AdditionalInferenceRequestHeaders = {
@doc("""
Controls what happens if extra parameters, undefined by the REST API,
are passed in the JSON request payload.
This sets the HTTP request header `extra-parameters`.
""")
@header("extra-parameters")
extra_params?: ExtraParameters;
};

@doc("Controls what happens if extra parameters, undefined by the REST API, are passed in the JSON request payload.")
union ExtraParameters {
string,

@doc("The service will error if it detected extra parameters in the request payload. This is the service default.")
error: "error",

@doc("The service will ignore (drop) extra parameters in the request payload. It will only pass the known parameters to the back-end AI model.")
drop: "drop",

@doc("The service will pass extra parameters to the back-end AI model.")
pass_through: "pass-through",
}

// Pending upload spec

// Define a URI alias for clarity.
Expand Down
2 changes: 2 additions & 0 deletions specification/ai/Azure.AI.Projects/connections/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import "@typespec/openapi";
import "@typespec/versioning";

using TypeSpec.Rest;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

@doc("Response from the listSecrets operation")
@resource("connections")
@added(Versions.v2025_05_01)
model Connection {
@doc("The name of the resource")
@visibility(Lifecycle.Read)
Expand Down
2 changes: 2 additions & 0 deletions specification/ai/Azure.AI.Projects/connections/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "./models.tsp";
using TypeSpec.Http;
using Azure.Core;
using Azure.Core.Traits;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

Expand All @@ -16,6 +17,7 @@ alias ConnectionServiceTraits = SupportsClientRequestId &

alias ConnectionOperations = Azure.Core.ResourceOperations<ConnectionServiceTraits>;

@added(Versions.v2025_05_01)
interface Connections {
@doc("Get a connection by name.")
get is ConnectionOperations.ResourceRead<Connection>;
Expand Down
5 changes: 5 additions & 0 deletions specification/ai/Azure.AI.Projects/datasets/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "../main.tsp";
import "@typespec/openapi";
import "@typespec/versioning";

using TypeSpec.Versioning;

namespace Azure.AI.Projects;

@doc("Enum to determine the type of data.")
Expand All @@ -24,6 +26,7 @@ union DatasetType {
@doc("DatasetVersion Definition")
@Rest.resource("datasets")
@discriminator("type")
@added(Versions.v2025_05_01)
model DatasetVersion {
@doc("[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330")
@visibility(Lifecycle.Read, Lifecycle.Create)
Expand All @@ -42,6 +45,7 @@ model DatasetVersion {
}

@doc("FileDatasetVersion Definition")
@added(Versions.v2025_05_01)
model FileDatasetVersion extends DatasetVersion {
@doc("Dataset type")
type: DatasetType.uri_file;
Expand All @@ -51,6 +55,7 @@ model FileDatasetVersion extends DatasetVersion {
}

@doc("FileDatasetVersion Definition")
@added(Versions.v2025_05_01)
model FolderDatasetVersion extends DatasetVersion {
@doc("Dataset type")
type: DatasetType.uri_folder;
Expand Down
2 changes: 2 additions & 0 deletions specification/ai/Azure.AI.Projects/datasets/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "./models.tsp";
import "../servicepatterns.tsp";

using TypeSpec.Http;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

Expand All @@ -30,6 +31,7 @@ alias ListDatasetVersionsParameters = {
};

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "We are using service specific operation templates"
@added(Versions.v2025_05_01)
interface Datasets
extends ServicePatterns.VersionedOperations<
DatasetVersion,
Expand Down
5 changes: 5 additions & 0 deletions specification/ai/Azure.AI.Projects/deployments/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import "../common/models.tsp";
import "@typespec/openapi";

using TypeSpec.Rest;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

@doc("Model Deployment Definition")
@resource("deployments")
@discriminator("type")
@added(Versions.v2025_05_01)
model Deployment {
@doc("The type of the deployment")
type: DeploymentType;
Expand All @@ -24,6 +26,7 @@ model Deployment {
}

@doc("Model Deployment Definition")
@added(Versions.v2025_05_01)
model ModelDeployment extends Deployment {
@doc("The type of the deployment")
type: DeploymentType.ModelDeployment;
Expand Down Expand Up @@ -54,6 +57,7 @@ model ModelDeployment extends Deployment {
}

@doc("Sku information")
@added(Versions.v2025_05_01)
model Sku {
@doc("Sku capacity")
capacity: int64;
Expand All @@ -71,6 +75,7 @@ model Sku {
tier: string;
}

@added(Versions.v2025_05_01)
union DeploymentType {
string,

Expand Down
2 changes: 2 additions & 0 deletions specification/ai/Azure.AI.Projects/deployments/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "./models.tsp";
using TypeSpec.Http;
using Azure.Core;
using Azure.Core.Traits;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

Expand All @@ -16,6 +17,7 @@ alias DeploymentServiceTraits = SupportsClientRequestId &

alias DeploymentOperations = Azure.Core.ResourceOperations<DeploymentServiceTraits>;

@added(Versions.v2025_05_01)
interface Deployments {
@doc("Get a deployed model.")
get is DeploymentOperations.ResourceRead<Deployment>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace Azure.AI.Projects;

@doc("Evaluation Result resource Definition")
@Rest.resource("evaluationResults")
@added(Versions.v2025_05_15_preview)
@removed(Versions.v_latest)
model EvaluationResult {
@doc("Type of Evaluation result")
ResultType?: ResultType;
Expand Down Expand Up @@ -45,6 +47,8 @@ model EvaluationResult {
}

@doc("Type of Evaluation result")
@added(Versions.v2025_05_15_preview)
@removed(Versions.v_latest)
union ResultType {
string,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import "./models.tsp";
import "../servicepatterns.tsp";

using TypeSpec.Http;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

Expand All @@ -30,6 +31,8 @@ alias ListEvaluationResultsParameters = {
};

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "We are using service specific operation templates"
@added(Versions.v2025_05_15_preview)
@removed(Versions.v_latest)
interface EvaluationResults
extends ServicePatterns.VersionedOperations<
EvaluationResult,
Expand Down
Loading
Loading