跳转到主要内容
专项模型 API

决策模型 API 参考

调用 POST /compatible-mode/v1/systemone 接口使用千问AI平台决策模型(decision-model-preview),一次前向返回分类、评分、是非判断及其概率分布与置信度,不生成文本。

POST
/compatible-mode/v1/systemone
cURL
curl -sS -X POST https://trial.cn-beijing.maas.aliyuncs.com/compatible-mode/v1/systemone \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "decision-model-preview",
    "state": {"ticket_id": "T-1001", "content": "订单支付后超过 24 小时仍未到账,用户无法继续使用核心服务,要求立即处理。"},
    "questions": {
      "department": {"type": "choice", "instructions": "应该由哪个团队处理?",
                     "criteria": {"billing": "支付、退款和账单问题", "technical": "产品故障和集成问题"}},
      "escalate":   {"type": "noul",  "instructions": "是否需要立即通知值班人员?"},
      "severity":   {"type": "score", "instructions": "这个问题有多严重?",
                     "criteria": ["轻微问题,不影响功能", "部分功能受影响,但存在替代方案",
                                  "核心功能不可用,没有替代方案", "造成严重业务或安全影响"]}
    }
  }'
{
  "model": "decision-model-preview",
  "request_id": "7b986c65-b223-9341-b5f0-b988e27ecaac",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "billing",
      "confidence": 0.88,
      "probabilities": {
        "billing": 0.94,
        "technical": 0.06
      }
    },
    "escalate": {
      "type": "noul",
      "noul": 0.99
    },
    "severity": {
      "type": "score",
      "score": 2.25,
      "confidence": 0.91,
      "legend": {
        "0": "轻微问题,不影响功能",
        "1": "部分功能受影响,但存在替代方案",
        "2": "核心功能不可用,没有替代方案",
        "3": "造成严重业务或安全影响"
      },
      "probabilities": {
        "0": 0,
        "1": 0.01,
        "2": 0.73,
        "3": 0.26
      }
    }
  },
  "usage": {
    "input_tokens": 125
  },
  "latency_ms": 52.9
}

前提条件

已创建 API Key 并配置为环境变量 DASHSCOPE_API_KEY。配置方法请参见配置 API Key 到环境变量。

请求说明

协议:TypeSafe System One(POST /compatible-mode/v1/systemone) 一次请求携带业务 state 与若干 typed 问题(choice / noul / score),模型一次前向返回每个问题的判定结果与概率分布,其中 choice 与 score 额外返回置信度,不生成文本,因此延迟与成本与输出长度无关。
decision-model-preview 不支持流式输出、Function Calling、联网搜索和结构化输出。模型输出为结构化决策结果(概率分布与置信度),不生成文本。

鉴权

string
header
必填

请求体

application/json
enum<string>
必填

模型名,取值 decision-model-preview。

decision-model-preview
string
必填

待决策的业务状态:工单文本、对话或结构化对象(对象会被序列化后送模型)。

object
必填

问题表。key 为调用方自定义的问题 id;value 为问题对象。

响应

200-application/json
string

模型名回显。

string

请求 ID,用于问题排查。

object

答案表,key 与请求中的问题 id 一一对应。

object

计量信息。

number

服务端耗时(毫秒)。