deprecation

This commit is contained in:
Xi Yan 2025-02-10 11:35:21 -08:00
parent 79e7253625
commit 65ffcddd84
4 changed files with 221 additions and 5 deletions

View file

@ -40,6 +40,44 @@
}
],
"paths": {
"/v1/eval-tasks/{eval_task_id}": {
"get": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"$ref": "#/components/schemas/EvalTask"
},
{
"type": "null"
}
]
}
}
}
}
},
"tags": [
"EvalTasks"
],
"description": "",
"parameters": [
{
"name": "eval_task_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"deprecated": true
}
},
"/v1/eval-tasks": {
"get": {
"responses": {
@ -60,6 +98,29 @@
"description": "",
"parameters": [],
"deprecated": true
},
"post": {
"responses": {
"200": {
"description": "OK"
}
},
"tags": [
"EvalTasks"
],
"description": "",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeprecatedRegisterEvalTaskRequest"
}
}
},
"required": true
},
"deprecated": true
}
},
"/v1/datasetio/rows": {
@ -2465,6 +2526,60 @@
"data"
]
},
"DeprecatedRegisterEvalTaskRequest": {
"type": "object",
"properties": {
"eval_task_id": {
"type": "string"
},
"dataset_id": {
"type": "string"
},
"scoring_functions": {
"type": "array",
"items": {
"type": "string"
}
},
"provider_eval_task_id": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
}
}
},
"additionalProperties": false,
"required": [
"eval_task_id",
"dataset_id",
"scoring_functions"
]
},
"AppendRowsRequest": {
"type": "object",
"properties": {

View file

@ -10,6 +10,27 @@ info:
servers:
- url: http://any-hosted-llama-stack.com
paths:
/v1/eval-tasks/{eval_task_id}:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/EvalTask'
- type: 'null'
tags:
- EvalTasks
description: ''
parameters:
- name: eval_task_id
in: path
required: true
schema:
type: string
deprecated: true
/v1/eval-tasks:
get:
responses:
@ -24,6 +45,21 @@ paths:
description: ''
parameters: []
deprecated: true
post:
responses:
'200':
description: OK
tags:
- EvalTasks
description: ''
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DeprecatedRegisterEvalTaskRequest'
required: true
deprecated: true
/v1/datasetio/rows:
get:
responses:
@ -1491,6 +1527,36 @@ components:
additionalProperties: false
required:
- data
DeprecatedRegisterEvalTaskRequest:
type: object
properties:
eval_task_id:
type: string
dataset_id:
type: string
scoring_functions:
type: array
items:
type: string
provider_eval_task_id:
type: string
provider_id:
type: string
metadata:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
additionalProperties: false
required:
- eval_task_id
- dataset_id
- scoring_functions
AppendRowsRequest:
type: object
properties:

View file

@ -45,11 +45,6 @@ class ListEvalTasksResponse(BaseModel):
@runtime_checkable
class EvalTasks(Protocol):
@webmethod(route="/eval-tasks", method="GET")
async def DEPRECATED_list_eval_tasks_deprecated(
self,
) -> ListEvalTasksResponse: ...
@webmethod(route="/eval/tasks", method="GET")
async def list_eval_tasks(self) -> ListEvalTasksResponse: ...
@ -69,3 +64,23 @@ class EvalTasks(Protocol):
provider_id: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
) -> None: ...
@webmethod(route="/eval-tasks", method="GET")
async def DEPRECATED_list_eval_tasks(self) -> ListEvalTasksResponse: ...
@webmethod(route="/eval-tasks/{eval_task_id}", method="GET")
async def DEPRECATED_get_eval_task(
self,
eval_task_id: str,
) -> Optional[EvalTask]: ...
@webmethod(route="/eval-tasks", method="POST")
async def DEPRECATED_register_eval_task(
self,
eval_task_id: str,
dataset_id: str,
scoring_functions: List[str],
provider_eval_task_id: Optional[str] = None,
provider_id: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
) -> None: ...

View file

@ -465,6 +465,26 @@ class EvalTasksRoutingTable(CommonRoutingTableImpl, EvalTasks):
)
await self.register_object(eval_task)
async def DEPRECATED_list_eval_tasks(self) -> ListEvalTasksResponse:
raise DeprecationWarning("Use /eval/tasks instead")
async def DEPRECATED_get_eval_task(
self,
eval_task_id: str,
) -> Optional[EvalTask]:
raise DeprecationWarning("Use /eval/tasks instead")
async def DEPRECATED_register_eval_task(
self,
eval_task_id: str,
dataset_id: str,
scoring_functions: List[str],
provider_eval_task_id: Optional[str] = None,
provider_id: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
) -> None:
raise DeprecationWarning("Use /eval/tasks instead")
class ToolGroupsRoutingTable(CommonRoutingTableImpl, ToolGroups):
async def list_tools(self, toolgroup_id: Optional[str] = None) -> ListToolsResponse: