Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions specification/ai/Azure.AI.Projects/evaluators/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ model EvaluatorMetric {

@doc("Maximum value for the metric. If not specified, it is assumed to be unbounded.")
max_value?: float32;

@doc("Indicates if this metric is primary when there are multiple metrics.")
is_primary?: boolean;
}

@doc("The type of the evaluator")
Expand Down
55 changes: 29 additions & 26 deletions specification/ai/Azure.AI.Projects/evaluators/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,44 @@ import "../common/models.tsp";
import "./models.tsp";
import "../servicepatterns.tsp";

using TypeSpec.Http;
using TypeSpec.Versioning;

namespace Azure.AI.Projects;

alias ListEvaluatorVersionsParameters = {};
alias EvaluatorInputParameters = InputParameters<
EvaluatorVersion,
"evaluatorVersion"
>;
alias ListEvaluatorVersionsParameters = {
@doc("Filter evaluators by type. Possible values: 'all', 'custom', 'builtin'.")
@Http.query
type?: EvaluatorType | "all";

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

@added(Versions.v2025_10_15_preview)
interface Evaluators {
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
@get
@doc("List all versions of the given Evaluator name", EvaluatorVersion)
@route("/evaluators/{name}/versions")
op listEvaluatorVersions(
@doc("Name of the evaluator")
@path name: string,
...OpenAIListRequestOptions,
): OpenAIPageableListOf<EvaluatorVersion>;


// GET /evaluators/{name}/versions
#suppress "@azure-tools/typespec-azure-core/verb-conflict" "Resource action used as a building block."
@doc("List all versions of the given {name}", EvaluatorVersion)
@Rest.action("versions")
@Rest.actionSeparator("/")
@Http.get
@list
listEvaluatorVersions is Azure.Core.StandardResourceOperations.ResourceAction<
EvaluatorVersion,
ListEvaluatorVersionsParameters,
Azure.Core.Page<EvaluatorVersion>
>;

// GET /evaluators
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
#suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" "not yet versioned"
@get
@doc("List the latest version of each Evaluator", EvaluatorVersion)
@route("/evaluators")
op listVersions(
...OpenAIListRequestOptions,
): OpenAIPageableListOf<EvaluatorVersion>;

@doc("List the latest version of each {name}", EvaluatorVersion)
@Rest.listsResource(EvaluatorVersion)
listEvaluators is Azure.Core.Foundations.ResourceList<
EvaluatorVersion,
ListEvaluatorVersionsParameters,
Azure.Core.Page<EvaluatorVersion>
>;

// GET /evaluators/{name}/versions/{version}
#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
Expand Down
Loading
Loading