Skip to content

TypeSafe Jev 决策模型 ​

将待评估的内容与一组问题一并提交,模型返回结构化的概率、选项或评分,适用于意图识别、工单分流、内容审核与质量打分等场景。同一次请求中的多个问题共享 state。

接口地址 ​

方法端点
POSThttps://neolink.com/api/v1/decisions

兼容路径:https://neolink.com/api/v1/systemone,请求与响应格式相同。新接入建议使用 /v1/decisions。

认证 ​

方式说明
Bearer Token在请求头中携带 Authorization: Bearer <API Key>,使用本平台创建的 API Key。

请求头 ​

参数名类型必填说明
Content-Typestring是固定为 application/json
Authorizationstring是Bearer <API Key>,用于验证账户信息

模型能力 ​

  • 支持 noul(二元判断)、choice(选择)和 score(评分)三种问题类型,可在同一请求中组合使用。
  • 返回完整 JSON 响应,不支持流式输出,请勿设置 stream: true。
  • 当前接口不支持图片输入(assets)及 box 定位问题。

模型 ID: 示例使用 jev-latest;具体可用模型及调用权限以平台为准。

请求体 ​

参数名类型必填默认值说明
modelstring是-模型 ID,例如 jev-latest
statestring/object/array是-待评估的文本、对话记录、数据记录或应用状态,由所有问题共享
questionsobject是-非空问题集合。键名由调用方定义,用于对应响应中的 answers,不参与模型推理
questions.<key>.typestring是-问题类型:noul、choice 或 score
questions.<key>.instructionsstring/object/array是-问题描述。可用对象或数组组织问题与参考数据,并在文字中以反引号引用字段
questions.<key>.criteriaobject/array条件必填-评判标准,格式与限制见下表
streamboolean否false仅支持省略或 false

criteria 参数 ​

问题类型类型必填说明
noulobject否使用 true、false 键说明两种判断的含义,说明值支持字符串、对象或数组。如 {"true": "Explicitly time-sensitive", "false": "No urgency expressed"}
choiceobject是1~255 个选项,键名为返回的选项值,说明支持字符串、对象、数组或 null。如 {"billing": "Payments and refunds", "technical": null}
scorearray[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())

响应参数 ​

参数名类型说明
modelstring响应中的模型 ID
answersobject问题答案集合,键名对应请求中的 questions
answers.<key>.typestring答案类型:noul、choice 或 score
answers.<key>.noulnumbernoul 的“是”的可能性,范围为 0~1,不是布尔值
answers.<key>.choicestringchoice 选中的选项键名
answers.<key>.scorenumberscore 的评分,可为小数,范围为 0~档位数量减 1
answers.<key>.legendobjectscore 的档位索引与说明映射
answers.<key>.probabilitiesobjectchoice 或 score 各选项或档位的概率
answers.<key>.confidencenumberchoice 或 score 的置信度,值越大表示模型越确信
usage.input_tokensinteger本次请求的输入 Token 数
usage.output_tokensinteger本次请求的输出 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 用量及平台配置价格,具体价格以平台显示为准。
  • 请求失败时,请参考错误码指南。