curl --request POST \
--url https://api.tikway.ai/v1/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-6-luna",
"input": "我被重复扣款了两次,请今天帮我处理退款,其他功能还能正常使用。",
"questions": [
{
"name": "urgent",
"type": "predicate",
"instructions": "用户是否需要尽快处理?"
},
{
"name": "department",
"type": "choice",
"instructions": "应该交给哪个部门?",
"choices": [
{
"value": "billing",
"description": "账单、扣款和退款问题"
},
{
"value": "technical",
"description": "产品功能和技术故障"
}
]
},
{
"name": "severity",
"type": "score",
"instructions": "问题有多严重?",
"levels": [
{
"label": "Minor"
},
{
"label": "Workaround available"
},
{
"label": "Fully blocked"
}
]
}
]
}
'{
"model": "typesafe/jev-latest",
"answers": [
{
"name": "urgent",
"probability": 0.82,
"type": "predicate"
},
{
"choice": "billing",
"confidence": 1,
"name": "department",
"probabilities": [
{
"probability": 1,
"value": "billing"
},
{
"probability": 0,
"value": "technical"
}
],
"type": "choice"
},
{
"confidence": 0.58,
"legend": {
"0": "Minor",
"1": "Workaround available",
"2": "Fully blocked"
},
"name": "severity",
"probabilities": [
{
"label": "Minor",
"probability": 0.74,
"value": 0
},
{
"label": "Workaround available",
"probability": 0.24,
"value": 1
},
{
"label": "Fully blocked",
"probability": 0.02,
"value": 2
}
],
"score": 0.28,
"type": "score"
}
],
"usage": {
"completion_tokens": 61,
"prompt_tokens": 375,
"total_tokens": 436
}
}OpenAI
OpenAI - 决策评估
OpenAI Decisions 格式:input + questions 数组;answers 顺序与问题一致,支持 predicate、choice、score 及 refusal。支持通过端点配置调用 TypeSafe Jev。跨协议时问题 name 必须唯一;字符串和布尔选项转换成同一个键时返回参数错误。
示例模型 ID 必须已在目标环境配置,并关联可用账号和端点。
POST
https://api.tikway.ai
/
v1
/
decisions
curl --request POST \
--url https://api.tikway.ai/v1/decisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-6-luna",
"input": "我被重复扣款了两次,请今天帮我处理退款,其他功能还能正常使用。",
"questions": [
{
"name": "urgent",
"type": "predicate",
"instructions": "用户是否需要尽快处理?"
},
{
"name": "department",
"type": "choice",
"instructions": "应该交给哪个部门?",
"choices": [
{
"value": "billing",
"description": "账单、扣款和退款问题"
},
{
"value": "technical",
"description": "产品功能和技术故障"
}
]
},
{
"name": "severity",
"type": "score",
"instructions": "问题有多严重?",
"levels": [
{
"label": "Minor"
},
{
"label": "Workaround available"
},
{
"label": "Fully blocked"
}
]
}
]
}
'{
"model": "typesafe/jev-latest",
"answers": [
{
"name": "urgent",
"probability": 0.82,
"type": "predicate"
},
{
"choice": "billing",
"confidence": 1,
"name": "department",
"probabilities": [
{
"probability": 1,
"value": "billing"
},
{
"probability": 0,
"value": "technical"
}
],
"type": "choice"
},
{
"confidence": 0.58,
"legend": {
"0": "Minor",
"1": "Workaround available",
"2": "Fully blocked"
},
"name": "severity",
"probabilities": [
{
"label": "Minor",
"probability": 0.74,
"value": 0
},
{
"label": "Workaround available",
"probability": 0.24,
"value": 1
},
{
"label": "Fully blocked",
"probability": 0.02,
"value": 2
}
],
"score": 0.28,
"type": "score"
}
],
"usage": {
"completion_tokens": 61,
"prompt_tokens": 375,
"total_tokens": 436
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
模型 ID,例如 openai/gpt-6-luna 或 typesafe/jev-latest;是否可调用取决于模型目录及账号配置。
Minimum string length:
1Maximum string length:
64Maximum string length:
128响应
类型化决策答案和用量。未返回输出 Token 的上游可省略 completion_tokens,转换为 TypeSafe 时补 0。

