文本
评估决策
使用原生决策模型评估命名的概率、选择和评分问题。
向决策模型发送 state 和命名的 questions。通过 GET /v1/models?category=decision 查询当前可用模型,通过 GET /v1/models/{model} 核对模型详情和支持字段。
state 和每个问题的 instructions 均支持字符串、JSON 对象或 JSON 数组。端点同步返回 JSON。
| 问题类型 | 判定标准 | 结果 |
|---|---|---|
noul | 可选对象,同时提供 true 和 false 的判定说明 | noul,取值为 0 到 1 的概率 |
choice | 对象,包含 1–255 个选项名,每个选项映射到判定说明或 null | choice,可附带 probabilities 和 confidence |
score | 有序数组,包含 2–10 条评分说明 | score,取值从 0 到最后一个下标;可以是小数,可附带 legend、probabilities 和 confidence |
响应在 answers 下保留你的问题名称。usage.input_tokens 和 usage.output_tokens 在用量可用时报告实际用量。计费以模型当前价格为准;输出免费不代表输出 token 数为零。
此端点不支持聊天消息、工具调用、流式响应或 Batch。
curl https://api.tokenlab.sh/v1/systemone \
-H "Authorization: Bearer $TOKENLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "jev-1.13",
"state": "I was charged twice. Please refund the duplicate payment.",
"questions": {
"refund_requested": {"type": "noul", "instructions": "Is a refund requested?"},
"department": {
"type": "choice", "instructions": "Which team should handle this?",
"criteria": {"billing": "Charges and refunds", "technical": "Software bugs"}
},
"urgency": {
"type": "score", "instructions": "Rate urgency",
"criteria": ["Routine enquiry", "Money affected", "Safety emergency"]
}
}
}'也可以使用标准 fetch 或 requests 客户端发送请求。决策响应是结构化数据,不是生成的文本解释。
curl -X POST "https://example.com/v1/systemone" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "state": "string", "questions": { "property1": { "type": "noul", "instructions": "string" }, "property2": { "type": "noul", "instructions": "string" } } }'{ "id": "string", "model": "string", "answers": { "property1": { "type": "noul", "noul": 0 }, "property2": { "type": "noul", "noul": 0 } }, "usage": { "input_tokens": 0, "output_tokens": 0 }}授权
BearerAuth AuthorizationBearer <token>
API Key 身份验证。在 Dashboard > API > API Keys 中创建或管理 API Key。
位置: header
请求头
X-TokenLab-Delivery-Policy?string
单次请求的交付策略。覆盖 API 密钥和 Workspace 的默认设置。自动优先尝试 TokenLab Verified,并在输出、请求接受或持久资源创建之前,可能会切换一次至仅限 Official。
可选值
- "auto"
- "verified"
- "official"
请求体
application/json
响应
application/json
application/json
application/json
application/json