inline -> sync

This commit is contained in:
Xi Yan 2025-03-16 20:46:07 -07:00
parent 1860751655
commit cb492eba37
3 changed files with 121 additions and 121 deletions

View file

@ -1999,7 +1999,7 @@
} }
} }
}, },
"/v1/evaluation/grade_inline": { "/v1/evaluation/grade_sync": {
"post": { "post": {
"responses": { "responses": {
"200": { "200": {
@ -2034,7 +2034,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GradeInlineRequest" "$ref": "#/components/schemas/GradeSyncRequest"
} }
} }
}, },
@ -3451,49 +3451,6 @@
} }
} }
}, },
"/v1/evaluation/run_inline": {
"post": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EvaluationResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest400"
},
"429": {
"$ref": "#/components/responses/TooManyRequests429"
},
"500": {
"$ref": "#/components/responses/InternalServerError500"
},
"default": {
"$ref": "#/components/responses/DefaultError"
}
},
"tags": [
"Evaluation"
],
"description": "Run an evaluation job inline.",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunInlineRequest"
}
}
},
"required": true
}
}
},
"/v1/safety/run-shield": { "/v1/safety/run-shield": {
"post": { "post": {
"responses": { "responses": {
@ -3537,6 +3494,49 @@
} }
} }
}, },
"/v1/evaluation/run_sync": {
"post": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EvaluationResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest400"
},
"429": {
"$ref": "#/components/responses/TooManyRequests429"
},
"500": {
"$ref": "#/components/responses/InternalServerError500"
},
"default": {
"$ref": "#/components/responses/DefaultError"
}
},
"tags": [
"Evaluation"
],
"description": "Run an evaluation job inline.",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunSyncRequest"
}
}
},
"required": true
}
}
},
"/v1/telemetry/spans/export": { "/v1/telemetry/spans/export": {
"post": { "post": {
"responses": { "responses": {
@ -7682,7 +7682,7 @@
"title": "ModelCandidate", "title": "ModelCandidate",
"description": "A model candidate for evaluation." "description": "A model candidate for evaluation."
}, },
"GradeInlineRequest": { "GradeSyncRequest": {
"type": "object", "type": "object",
"properties": { "properties": {
"task": { "task": {
@ -7694,7 +7694,7 @@
"required": [ "required": [
"task" "task"
], ],
"title": "GradeInlineRequest" "title": "GradeSyncRequest"
}, },
"EvaluationResponse": { "EvaluationResponse": {
"type": "object", "type": "object",
@ -9726,25 +9726,6 @@
], ],
"title": "RunRequest" "title": "RunRequest"
}, },
"RunInlineRequest": {
"type": "object",
"properties": {
"task": {
"$ref": "#/components/schemas/EvaluationTask",
"description": "The task to evaluate. One of: - BenchmarkTask: Run evaluation task against a benchmark_id - DatasetGraderTask: Run evaluation task against a dataset_id and a list of grader_ids - DataSourceGraderTask: Run evaluation task against a data source (e.g. rows, uri, etc.) and a list of grader_ids"
},
"candidate": {
"$ref": "#/components/schemas/EvaluationCandidate",
"description": "The candidate to evaluate."
}
},
"additionalProperties": false,
"required": [
"task",
"candidate"
],
"title": "RunInlineRequest"
},
"RunShieldRequest": { "RunShieldRequest": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -9801,6 +9782,25 @@
"additionalProperties": false, "additionalProperties": false,
"title": "RunShieldResponse" "title": "RunShieldResponse"
}, },
"RunSyncRequest": {
"type": "object",
"properties": {
"task": {
"$ref": "#/components/schemas/EvaluationTask",
"description": "The task to evaluate. One of: - BenchmarkTask: Run evaluation task against a benchmark_id - DatasetGraderTask: Run evaluation task against a dataset_id and a list of grader_ids - DataSourceGraderTask: Run evaluation task against a data source (e.g. rows, uri, etc.) and a list of grader_ids"
},
"candidate": {
"$ref": "#/components/schemas/EvaluationCandidate",
"description": "The candidate to evaluate."
}
},
"additionalProperties": false,
"required": [
"task",
"candidate"
],
"title": "RunSyncRequest"
},
"SaveSpansToDatasetRequest": { "SaveSpansToDatasetRequest": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -1343,7 +1343,7 @@ paths:
schema: schema:
$ref: '#/components/schemas/GradeRequest' $ref: '#/components/schemas/GradeRequest'
required: true required: true
/v1/evaluation/grade_inline: /v1/evaluation/grade_sync:
post: post:
responses: responses:
'200': '200':
@ -1373,7 +1373,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/GradeInlineRequest' $ref: '#/components/schemas/GradeSyncRequest'
required: true required: true
/v1/health: /v1/health:
get: get:
@ -2350,35 +2350,6 @@ paths:
schema: schema:
$ref: '#/components/schemas/RunRequest' $ref: '#/components/schemas/RunRequest'
required: true required: true
/v1/evaluation/run_inline:
post:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluationResponse'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
$ref: >-
#/components/responses/TooManyRequests429
'500':
$ref: >-
#/components/responses/InternalServerError500
default:
$ref: '#/components/responses/DefaultError'
tags:
- Evaluation
description: Run an evaluation job inline.
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RunInlineRequest'
required: true
/v1/safety/run-shield: /v1/safety/run-shield:
post: post:
responses: responses:
@ -2408,6 +2379,35 @@ paths:
schema: schema:
$ref: '#/components/schemas/RunShieldRequest' $ref: '#/components/schemas/RunShieldRequest'
required: true required: true
/v1/evaluation/run_sync:
post:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluationResponse'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
$ref: >-
#/components/responses/TooManyRequests429
'500':
$ref: >-
#/components/responses/InternalServerError500
default:
$ref: '#/components/responses/DefaultError'
tags:
- Evaluation
description: Run an evaluation job inline.
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RunSyncRequest'
required: true
/v1/telemetry/spans/export: /v1/telemetry/spans/export:
post: post:
responses: responses:
@ -5326,7 +5326,7 @@ components:
- sampling_params - sampling_params
title: ModelCandidate title: ModelCandidate
description: A model candidate for evaluation. description: A model candidate for evaluation.
GradeInlineRequest: GradeSyncRequest:
type: object type: object
properties: properties:
task: task:
@ -5339,7 +5339,7 @@ components:
additionalProperties: false additionalProperties: false
required: required:
- task - task
title: GradeInlineRequest title: GradeSyncRequest
EvaluationResponse: EvaluationResponse:
type: object type: object
properties: properties:
@ -6643,24 +6643,6 @@ components:
- task - task
- candidate - candidate
title: RunRequest title: RunRequest
RunInlineRequest:
type: object
properties:
task:
$ref: '#/components/schemas/EvaluationTask'
description: >-
The task to evaluate. One of: - BenchmarkTask: Run evaluation task against
a benchmark_id - DatasetGraderTask: Run evaluation task against a dataset_id
and a list of grader_ids - DataSourceGraderTask: Run evaluation task against
a data source (e.g. rows, uri, etc.) and a list of grader_ids
candidate:
$ref: '#/components/schemas/EvaluationCandidate'
description: The candidate to evaluate.
additionalProperties: false
required:
- task
- candidate
title: RunInlineRequest
RunShieldRequest: RunShieldRequest:
type: object type: object
properties: properties:
@ -6693,6 +6675,24 @@ components:
$ref: '#/components/schemas/SafetyViolation' $ref: '#/components/schemas/SafetyViolation'
additionalProperties: false additionalProperties: false
title: RunShieldResponse title: RunShieldResponse
RunSyncRequest:
type: object
properties:
task:
$ref: '#/components/schemas/EvaluationTask'
description: >-
The task to evaluate. One of: - BenchmarkTask: Run evaluation task against
a benchmark_id - DatasetGraderTask: Run evaluation task against a dataset_id
and a list of grader_ids - DataSourceGraderTask: Run evaluation task against
a data source (e.g. rows, uri, etc.) and a list of grader_ids
candidate:
$ref: '#/components/schemas/EvaluationCandidate'
description: The candidate to evaluate.
additionalProperties: false
required:
- task
- candidate
title: RunSyncRequest
SaveSpansToDatasetRequest: SaveSpansToDatasetRequest:
type: object type: object
properties: properties:

View file

@ -129,8 +129,8 @@ class Evaluation(Protocol):
""" """
... ...
@webmethod(route="/evaluation/run_inline", method="POST") @webmethod(route="/evaluation/run_sync", method="POST")
async def run_inline( async def run_sync(
self, self,
task: EvaluationTask, task: EvaluationTask,
candidate: EvaluationCandidate, candidate: EvaluationCandidate,
@ -160,8 +160,8 @@ class Evaluation(Protocol):
""" """
... ...
@webmethod(route="/evaluation/grade_inline", method="POST") @webmethod(route="/evaluation/grade_sync", method="POST")
async def grade_inline(self, task: EvaluationTask) -> EvaluationResponse: async def grade_sync(self, task: EvaluationTask) -> EvaluationResponse:
""" """
Run an grading job with generated results inline. Run an grading job with generated results inline.