TypeSafe Jev 决策模型
将待评估的内容与一组问题一并提交,模型返回结构化的概率、选项或评分,适用于意图识别、工单分流、内容审核与质量打分等场景。同一次请求中的多个问题共享
state。
接口地址
| 方法 | 端点 |
|---|---|
| POST | https://neolink.com/api/v1/decisions |
兼容路径:https://neolink.com/api/v1/systemone,请求与响应格式相同。新接入建议使用 /v1/decisions。
认证
| 方式 | 说明 |
|---|---|
| Bearer Token | 在请求头中携带 Authorization: Bearer <API Key>,使用本平台创建的 API Key。 |
请求头
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
Content-Type | string | 是 | 固定为 application/json |
Authorization | string | 是 | Bearer <API Key>,用于验证账户信息 |
模型能力
- 支持
noul(二元判断)、choice(选择)和score(评分)三种问题类型,可在同一请求中组合使用。 - 返回完整 JSON 响应,不支持流式输出,请勿设置
stream: true。 - 当前接口不支持图片输入(
assets)及box定位问题。
模型 ID: 示例使用 jev-latest;具体可用模型及调用权限以平台为准。
请求体
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
model | string | 是 | - | 模型 ID,例如 jev-latest |
state | string/object/array | 是 | - | 待评估的文本、对话记录、数据记录或应用状态,由所有问题共享 |
questions | object | 是 | - | 非空问题集合。键名由调用方定义,用于对应响应中的 answers,不参与模型推理 |
questions.<key>.type | string | 是 | - | 问题类型:noul、choice 或 score |
questions.<key>.instructions | string/object/array | 是 | - | 问题描述。可用对象或数组组织问题与参考数据,并在文字中以反引号引用字段 |
questions.<key>.criteria | object/array | 条件必填 | - | 评判标准,格式与限制见下表 |
stream | boolean | 否 | false | 仅支持省略或 false |
criteria 参数
| 问题类型 | 类型 | 必填 | 说明 |
|---|---|---|---|
noul | object | 否 | 使用 true、false 键说明两种判断的含义,说明值支持字符串、对象或数组。如 {"true": "Explicitly time-sensitive", "false": "No urgency expressed"} |
choice | object | 是 | 1~255 个选项,键名为返回的选项值,说明支持字符串、对象、数组或 null。如 {"billing": "Payments and refunds", "technical": null} |
score | array[string] | 是 | 2~10 个评分档位,从低到高排列,索引从 0 开始。如 ["Calm", "Frustrated", "Very angry"] |
请求示例
以下示例对同一条客户消息同时判断紧急程度、分派部门并评估情绪,也可以只提交其中一个问题。
bash
curl --location --request POST 'https://neolink.com/api/v1/decisions' \
--header 'Authorization: Bearer <API Key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "jev-latest",
"state": "Help! My payouts have been failing for 3 days.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this convey urgency?",
"criteria": {
"true": "Explicitly time-sensitive",
"false": "No urgency expressed"
}
},
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoicing, refunds",
"technical": "Bugs, outages, integrations",
"sales": "Pricing, upgrades, new accounts"
}
},
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": [
"Calm",
"Frustrated",
"Very angry"
]
}
}
}'python
import requests
url = "https://neolink.com/api/v1/decisions"
headers = {
"Authorization": "Bearer <API Key>",
"Content-Type": "application/json",
}
payload = {
"model": "jev-latest",
"state": "Help! My payouts have been failing for 3 days.",
"questions": {
"is_urgent": {
"type": "noul",
"instructions": "Does this convey urgency?",
"criteria": {
"true": "Explicitly time-sensitive",
"false": "No urgency expressed"
}
},
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoicing, refunds",
"technical": "Bugs, outages, integrations",
"sales": "Pricing, upgrades, new accounts"
}
},
"frustration": {
"type": "score",
"instructions": "How frustrated is the customer?",
"criteria": [
"Calm",
"Frustrated",
"Very angry"
]
}
}
}
response = requests.post(url, headers=headers, json=payload, timeout=60)
response.raise_for_status()
print(response.json())响应参数
| 参数名 | 类型 | 说明 |
|---|---|---|
model | string | 响应中的模型 ID |
answers | object | 问题答案集合,键名对应请求中的 questions |
answers.<key>.type | string | 答案类型:noul、choice 或 score |
answers.<key>.noul | number | noul 的“是”的可能性,范围为 0~1,不是布尔值 |
answers.<key>.choice | string | choice 选中的选项键名 |
answers.<key>.score | number | score 的评分,可为小数,范围为 0~档位数量减 1 |
answers.<key>.legend | object | score 的档位索引与说明映射 |
answers.<key>.probabilities | object | choice 或 score 各选项或档位的概率 |
answers.<key>.confidence | number | choice 或 score 的置信度,值越大表示模型越确信 |
usage.input_tokens | integer | 本次请求的输入 Token 数 |
usage.output_tokens | integer | 本次请求的输出 Token 数 |
响应示例
以下为结构示例,实际判断结果与 Token 用量以接口返回为准。
json
{
"model": "jev-latest",
"answers": {
"is_urgent": {
"type": "noul",
"noul": 0.95
},
"department": {
"type": "choice",
"choice": "billing",
"probabilities": {
"billing": 0.88,
"technical": 0.12,
"sales": 0
},
"confidence": 0.81
},
"frustration": {
"type": "score",
"score": 1.05,
"legend": {
"0": "Calm",
"1": "Frustrated",
"2": "Very angry"
},
"probabilities": {
"0": 0,
"1": 0.95,
"2": 0.05
},
"confidence": 0.92
}
},
"usage": {
"input_tokens": 450,
"output_tokens": 72
}
}使用说明
- 根据业务需求为
noul设置判断阈值,例如noul >= 0.8时标记为紧急;阈值由调用方自行决定。 score示例中0、1、2分别对应三个情绪档位,1.05是评分值,并非百分比。- 计费依据返回的 Token 用量及平台配置价格,具体价格以平台显示为准。
- 请求失败时,请参考错误码指南。
