TypeSafe System One (Jev) 接口
TypeSafe System One 面向需要从应用状态和一组问题中得到结构化判断的场景。图灵平台提供原生协议透传:请求使用 state 与 questions,响应按问题 ID 返回 answers,不转换为 Chat Completions 的 messages / choices 格式。
完整 schema 与 Try-It
本页说明接入方式和模型版本约束。请求、响应字段和交互式 Try-It 见 API 参考 → Call TypeSafe System One with Jev。
接口概览
| 项目 | 说明 |
|---|---|
| 端点 | POST /api/v1/typesafe/v1/systemone |
| 协议 | TypeSafe 原生 System One |
| 模型 | 固定版本 jev-1.13.0 |
| 鉴权 | Authorization: Bearer $TURING_API_KEY |
| 响应 | JSON;当前接口不提供流式响应 |
发起请求
state 和 questions 的内容遵循 TypeSafe 的原生定义,图灵平台代理会原样保留未知字段。questions 是以问题 ID 为键的对象;下例询问客户维修请求是否紧急:
curl "https://live-turing.cn.llm.tcljd.com/api/v1/typesafe/v1/systemone" \
-H "Authorization: Bearer $TURING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "A customer asks for an urgent repair",
"model": "jev-1.13.0",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Is the request urgent?"
}
}
}'
当前只接受 jev-1.13.0 和 typesafe/jev-1.13.0。平台将两种写法都路由到固定 Jev 版本;jev-latest、jev-preview 和其他版本号会被拒绝。问题定义的类型和字段由 TypeSafe 协议决定,请按 TypeSafe 使用的定义构造 questions。
响应保留 TypeSafe 结构:answers 里的答案与请求的问题 ID 对应;上游提供用量时,还会返回 usage.input_tokens 和 usage.output_tokens。
{
"model": "jev-1.13.0",
"answers": {
"is_urgent": {
"type": "noul",
"noul": 0.9
}
},
"usage": {
"input_tokens": 12,
"output_tokens": 0
}
}
错误处理
平台会返回统一错误信封。常见状态码包括 400(请求或模型版本无效)、401(API Key 缺失或无效)、403(无访问权限)、404(上游资源不存在)、429(触发速率限制)和 502(上游返回无效响应或非预期模型版本)。错误响应中的 trace_id 可用于请求追踪。