添加评测用例兼容接口
curl --request POST \
--url http://localhost:8000/dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"evalId": "case-001",
"sessionId": "session-001",
"userId": "user-001"
}
'import requests
url = "http://localhost:8000/dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session"
payload = {
"evalId": "case-001",
"sessionId": "session-001",
"userId": "user-001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({evalId: 'case-001', sessionId: 'session-001', userId: 'user-001'})
};
fetch('http://localhost:8000/dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));null{
"detail": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}兼容接口
添加评测用例兼容接口
与从会话添加评测用例的连字符路径行为一致
此接口由所核验的 SDK/ADK 版本提供,仅用于受信任的开发和调试。路径随安装的 ADK 版本变化,不应作为公共业务入口
POST
/
dev
/
apps
/
{app_name}
/
eval_sets
/
{eval_set_id}
/
add_session
添加评测用例兼容接口
curl --request POST \
--url http://localhost:8000/dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"evalId": "case-001",
"sessionId": "session-001",
"userId": "user-001"
}
'import requests
url = "http://localhost:8000/dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session"
payload = {
"evalId": "case-001",
"sessionId": "session-001",
"userId": "user-001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({evalId: 'case-001', sessionId: 'session-001', userId: 'user-001'})
};
fetch('http://localhost:8000/dev/apps/{app_name}/eval_sets/{eval_set_id}/add_session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));null{
"detail": "<string>"
}{
"error": "CONTENT_LENGTH_REQUIRED"
}{
"error": "REQUEST_TOO_LARGE"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}该下划线路径与对应连字符路径使用相同请求和响应,可供已有调用方继续使用。添加前确认会话与评测集存在,并检查会话中将保存为样本的数据
完整调用条件与新接口见对应评测接口
写入或删除评测样本会修改评测集中的实际数据
最后修改于 2026年9月19日