This commit is contained in:
Xi Yan 2025-02-10 10:47:28 -08:00
parent b11c38ea55
commit e013b9066c
4 changed files with 44 additions and 47 deletions

View file

@ -1503,7 +1503,7 @@
}
}
},
"/v1/eval/tasks/": {
"/v1/eval/tasks": {
"get": {
"responses": {
"200": {
@ -1522,6 +1522,28 @@
],
"description": "",
"parameters": []
},
"post": {
"responses": {
"200": {
"description": "OK"
}
},
"tags": [
"EvalTasks"
],
"description": "",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegisterEvalTaskRequest"
}
}
},
"required": true
}
}
},
"/v1/models": {
@ -2099,30 +2121,6 @@
]
}
},
"/v1/eval/tasks": {
"post": {
"responses": {
"200": {
"description": "OK"
}
},
"tags": [
"EvalTasks"
],
"description": "",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RegisterEvalTaskRequest"
}
}
},
"required": true
}
}
},
"/v1/eval/tasks/{task_id}/jobs": {
"post": {
"responses": {

View file

@ -895,7 +895,7 @@ paths:
schema:
$ref: '#/components/schemas/RegisterDatasetRequest'
required: true
/v1/eval/tasks/:
/v1/eval/tasks:
get:
responses:
'200':
@ -908,6 +908,20 @@ paths:
- EvalTasks
description: ''
parameters: []
post:
responses:
'200':
description: OK
tags:
- EvalTasks
description: ''
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RegisterEvalTaskRequest'
required: true
/v1/models:
get:
responses:
@ -1264,21 +1278,6 @@ paths:
type: array
items:
type: string
/v1/eval/tasks:
post:
responses:
'200':
description: OK
tags:
- EvalTasks
description: ''
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RegisterEvalTaskRequest'
required: true
/v1/eval/tasks/{task_id}/jobs:
post:
responses:

View file

@ -25,7 +25,7 @@ class EvalTask(CommonEvalTaskFields, Resource):
type: Literal[ResourceType.eval_task.value] = ResourceType.eval_task.value
@property
def eval_task_id(self) -> str:
def task_id(self) -> str:
return self.identifier
@property
@ -34,7 +34,7 @@ class EvalTask(CommonEvalTaskFields, Resource):
class EvalTaskInput(CommonEvalTaskFields, BaseModel):
eval_task_id: str
task_id: str
provider_id: Optional[str] = None
provider_eval_task_id: Optional[str] = None
@ -45,7 +45,7 @@ class ListEvalTasksResponse(BaseModel):
@runtime_checkable
class EvalTasks(Protocol):
@webmethod(route="/eval/tasks/", method="GET")
@webmethod(route="/eval/tasks", method="GET")
async def list_eval_tasks(self) -> ListEvalTasksResponse: ...
@webmethod(route="/eval/tasks/{task_id}", method="GET")

View file

@ -437,7 +437,7 @@ class EvalTasksRoutingTable(CommonRoutingTableImpl, EvalTasks):
async def register_eval_task(
self,
eval_task_id: str,
task_id: str,
dataset_id: str,
scoring_functions: List[str],
metadata: Optional[Dict[str, Any]] = None,
@ -454,9 +454,9 @@ class EvalTasksRoutingTable(CommonRoutingTableImpl, EvalTasks):
"No provider specified and multiple providers available. Please specify a provider_id."
)
if provider_eval_task_id is None:
provider_eval_task_id = eval_task_id
provider_eval_task_id = task_id
eval_task = EvalTask(
identifier=eval_task_id,
identifier=task_id,
dataset_id=dataset_id,
scoring_functions=scoring_functions,
metadata=metadata,