Gemini Decision 1
↓ 下载 MarkdownInteractions API
Gemini Decision 1 是专为 Decisions API。它可以在一次预填充过程中评估文本、图像、视频、音频和 PDF 中键入的问题,并返回零输出 token 的校准结果概率。
使用 Gemini Decision 1 进行请求路由、同时跨多个规则进行策略检查、根据评分标准对候选人进行评分、工具选择以及实时媒体流上的低延迟分类。单个请求可以通过共享输入评估最多 1,000 个独立问题,最多 262,144 token:
- 是/否: 返回从 0.01 到 0.99 的校准概率以及置信度分数。
- 单选: 评估 2 到 255 选项并返回顶级选项、每个选项的概率和置信度。
- 评分标准: 评估 2 到 255 有序评分标准级别并返回概率加权预期分数、每级别概率和置信度。
快速入门 #
在一次通话中针对同一客户消息评估是/否问题和路由选择:
from google import genai
client = genai.Client(http_options={"api_version": "v1beta"})
result = client.decisions.create(
model="gemini-decision-1",
input="The blue mug I ordered on Monday arrived cracked on Wednesday.",
questions={
"is_damaged": {
"type": "noul",
"instructions": "Did the item arrive damaged?",
},
"queue": {
"type": "choice",
"instructions": "Which support queue should handle this message?",
"criteria": {
"billing": "Payment, invoice, or refund questions.",
"replacements": "Damaged, missing, or wrong items.",
"general": "Product questions and account updates.",
},
},
},
)
damaged = result.answers["is_damaged"]
queue = result.answers["queue"]
print(f"P(damaged)={damaged.noul:.2f} queue={queue.choice}")
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({ apiVersion: "v1beta" });
const result = await ai.decisions.create({
model: "gemini-decision-1",
input: "The blue mug I ordered on Monday arrived cracked on Wednesday.",
questions: {
is_damaged: {
type: "noul",
instructions: "Did the item arrive damaged?",
},
queue: {
type: "choice",
instructions: "Which support queue should handle this message?",
criteria: {
billing: "Payment, invoice, or refund questions.",
replacements: "Damaged, missing, or wrong items.",
general: "Product questions and account updates.",
},
},
},
});
const damaged = result.answers?.is_damaged;
const queue = result.answers?.queue;
if (damaged?.type === "noul" && queue?.type === "choice") {
console.log(`P(damaged)=${damaged.noul} queue=${queue.choice}`);
}
curl -X POST "https://generativelanguage.googleapis.com/v1beta/decisions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-decision-1",
"input": "The blue mug I ordered on Monday arrived cracked on Wednesday.",
"questions": {
"is_damaged": {
"type": "noul",
"instructions": "Did the item arrive damaged?"
},
"queue": {
"type": "choice",
"instructions": "Which support queue should handle this message?",
"criteria": {
"billing": "Payment, invoice, or refund questions.",
"replacements": "Damaged, missing, or wrong items.",
"general": "Product questions and account updates."
}
}
}
}'
文档 #
参观 Decisions API 请求模式、标准设计、多模态输入和校准详细信息的指南。看 价格 和 速率限制 用于计费和配额层。
示例应用程序 #
探索使用 Gemini Decision 1 构建的 Google AI Studio 中的交互式示例应用程序:
gemini-decision-1 #
属性 | 说明 |
|---|---|
模型代码 |
|
支持的数据类型 | 输入 文本、图像、视频、音频和 PDF 输出 校准概率(是/否、选择和分数,0 输出 token) |
token 限制[*] | 输入token限制 262,144 输出 token 限制 0(每个请求最多 1,000 问题) |
功能 | ✓ 支持 音频生成 − 不支持Batch API − 不支持缓存 − 不支持代码执行 − 不支持计算机使用 − 不支持文件搜索 − 不支持弹性推理 − 不支持函数调用 − 不支持使用 Google 地图提供事实依据 − 不支持图像生成 − 不支持Live API − 不支持优先推理 − 不支持搜索事实依据 − 不支持结构化输出 − 不支持文本生成 − 不支持思考 − 不支持URL 上下文 − 不支持 |
版本 | 阅读 模型版本模式 了解更多详情。
|
最新更新 | 十一月 2026 |
速率限制 | |
价格 |