文章标题:Gemini Decision 1 现已在 AI Gateway 上线
正文: Google 的 Gemini Decision 1 现已在 AI Gateway 上线。该多模态决策模型可处理文本、图像、音频、视频和 PDF 文档,返回布尔概率、选项和分数。用它来路由请求、检查策略、筛选 agent 工具或对结果排序,而无需生成输出 token。
可通过 AI SDK、TypeSafe 兼容 API 或 Decisions API 使用 google/gemini-decision-1。
PDF、音频和视频输入通过 AI SDK 7 支持。TypeSafe 兼容 API 和 Decisions API 支持文本和图像输入。
import { experimental_decide as decide } from 'ai';
const result = await decide({ model: 'google/gemini-decision-1', state: 'I was charged twice. Please refund the duplicate charge.', questions: { requestsRefund: { type: 'boolean', instructions: 'Does the customer request a refund?', }, },});
console.log(result.answers.requestsRefund);
AI Gateway 提供统一的方式来访问模型并跟踪用量和成本。决策调用会出现在日志中,并与其他模型请求一同计入预算。
有关 Choice、Score 和 Boolean 问题,请参阅决策文档。要选择决策模型,请浏览可用模型或阅读我们的决策模型指南。