文章标题:Decision-1.1 现已在 AI Gateway 上线
正文: 来自 Microsoft AI 的 Decision-1.1 现已在 AI Gateway 上线。
该决策模型针对路由支持请求、选择工作流中的下一步、或为 AI 回答打分等任务,返回结构化答案,而不是自由形式的文本。
- Boolean:某个条件为真的概率
- Choice:选定的类别以及每个选项的概率
- Score:按照你定义的量表给出的数值评分
多个问题可以在一次请求中共享同一份输入。
Decision-1.1 接受与 Decision-1 相同的请求格式。要切换,请将模型 ID 改为 microsoft/decision-1.1。
你可以通过 AI SDK、兼容 OpenAI 的 Decisions API 或 AI CLI 调用它。以下示例要求 TypeScript 使用 ai 7.0.128 或更高版本,Python 使用 OpenAI Python SDK 3.26.0 或更高版本。
import { experimental_decide as decide } from 'ai';
const { answers } = await decide({ model: 'microsoft/decision-1.1', state: 'I was charged twice for one order.', questions: { department: { type: 'choice', instructions: 'Which team should handle this?', criteria: { billing: 'Charges and refunds', technical: 'Bugs and outages', }, }, },});
console.log(answers.department.choice);
决策请求会出现在请求日志中,计入预算,并支持决策回退。
你可以在模型 playground 中试用 Decision-1.1,或查看决策模型文档,了解请求格式和问题类型。