prompt-engineering
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrompt Engineering
提示工程
Universal techniques for crafting effective prompts across any LLM.
适用于所有LLM的通用高效提示词编写技术。
Core Principles
核心原则
1. Structure with XML Tags
1. 使用XML标签构建结构
Use XML tags to create clear, parseable prompts:
xml
<context>Background information here</context>
<instructions>
1. First step
2. Second step
</instructions>
<examples>Sample inputs/outputs</examples>
<output_format>Expected structure</output_format>Benefits:
- Clarity: Separates context, instructions, and examples
- Accuracy: Prevents model from mixing up sections
- Flexibility: Easy to modify individual parts
- Parseability: Enables structured output extraction
Best practices:
- Use consistent tag names throughout (, not sometimes
<instructions>)<steps> - Reference tags explicitly: "Using the data in tags..."
<context> - Nest tags for hierarchy:
<examples><example id="1">...</example></examples> - Combine with other techniques: for chain-of-thought,
<thinking>for final output<answer>
利用XML标签创建清晰、可解析的提示词:
xml
<context>背景信息在此</context>
<instructions>
1. 第一步
2. 第二步
</instructions>
<examples>输入/输出示例</examples>
<output_format>预期结构</output_format>优势:
- 清晰度:区分上下文、指令和示例
- 准确性:避免模型混淆不同模块
- 灵活性:便于单独修改各个部分
- 可解析性:支持结构化输出提取
最佳实践:
- 全程使用一致的标签名称(如,不要时而用
<instructions>)<steps> - 明确引用标签:“使用标签中的数据……”
<context> - 通过嵌套标签构建层级:
<examples><example id="1">...</example></examples> - 结合其他技术:用实现思维链,用
<thinking>输出最终结果<answer>
2. Control Output Shape
2. 控制输出形态
Specify explicit constraints on length, format, and structure:
xml
<output_spec>
- Default: 3-6 sentences or ≤5 bullets
- Simple yes/no questions: ≤2 sentences
- Complex multi-step tasks:
- 1 short overview paragraph
- ≤5 bullets: What changed, Where, Risks, Next steps, Open questions
- Use Markdown with headers, bullets, tables when helpful
- Avoid long narrative paragraphs; prefer compact structure
</output_spec>明确指定长度、格式和结构约束:
xml
<output_spec>
- 默认:3-6句话或≤5个项目符号
- 简单是/否问题:≤2句话
- 复杂多步骤任务:
- 1段简短概述
- ≤5个项目符号:变更内容、变更位置、风险、后续步骤、待解决问题
- 必要时使用Markdown标题、项目符号、表格
- 避免冗长叙述段落,优先紧凑结构
</output_spec>3. Prevent Scope Drift
3. 防止范围偏离
Explicitly constrain what the model should NOT do:
xml
<constraints>
- Implement EXACTLY and ONLY what is requested
- No extra features, components, or embellishments
- If ambiguous, choose the simplest valid interpretation
- Do NOT invent values, make assumptions, or add unrequested elements
</constraints>明确约束模型禁止执行的操作:
xml
<constraints>
- 严格且仅执行请求内容
- 不得添加额外功能、组件或修饰内容
- 若存在歧义,选择最简单的有效解读
- 不得编造数值、做出假设或添加未请求的元素
</constraints>4. Handle Ambiguity Explicitly
4. 明确处理歧义
Prevent hallucinations and overconfidence:
xml
<uncertainty_handling>
- If the question is ambiguous:
- Ask 1-3 precise clarifying questions, OR
- Present 2-3 plausible interpretations with labeled assumptions
- When facts may have changed: answer in general terms, state uncertainty
- Never fabricate exact figures or references when uncertain
- Prefer "Based on the provided context..." over absolute claims
</uncertainty_handling>防止幻觉和过度自信:
xml
<uncertainty_handling>
- 若问题存在歧义:
- 提出1-3个精准的澄清问题,或
- 给出2-3种合理解读并标注假设前提
- 若事实可能已发生变化:用通用表述回答,说明不确定性
- 不确定时切勿编造精确数据或参考资料
- 优先使用“基于提供的上下文……”而非绝对表述
</uncertainty_handling>5. Long-Context Grounding
5. 长上下文锚定
For inputs >10k tokens, add re-grounding instructions:
xml
<long_context_handling>
- First, produce a short internal outline of key sections relevant to the request
- Re-state user constraints explicitly before answering
- Anchor claims to sections ("In the 'Data Retention' section...")
- Quote or paraphrase fine details (dates, thresholds, clauses)
</long_context_handling>针对超过10k tokens的输入,添加重锚定指令:
xml
<long_context_handling>
- 首先,生成与请求相关的关键部分简短内部大纲
- 回答前明确重申用户约束
- 将主张锚定到具体章节(如“在‘数据保留’章节中……”)
- 引用或转述细节(日期、阈值、条款)
</long_context_handling>Agentic Prompts
Agentic提示词
Tool Usage Rules
工具使用规则
xml
<tool_usage>
- Prefer tools over internal knowledge for:
- Fresh or user-specific data (tickets, orders, configs)
- Specific IDs, URLs, or document references
- Parallelize independent reads when possible
- After write operations, restate: what changed, where, any validation performed
</tool_usage>xml
<tool_usage>
- 优先使用工具而非内部知识处理:
- 时效性数据或用户特定数据(工单、订单、配置)
- 特定ID、URL或文档引用
- 尽可能并行执行独立读取操作
- 写入操作完成后,重申:变更内容、变更位置、执行的验证操作
</tool_usage>User Updates
用户更新
xml
<user_updates>
- Send brief updates (1-2 sentences) only when:
- Starting a new major phase
- Discovering something that changes the plan
- Avoid narrating routine operations
- Each update must include a concrete outcome ("Found X", "Updated Y")
- Do not expand scope beyond what was asked
</user_updates>xml
<user_updates>
- 仅在以下情况发送简短更新(1-2句话):
- 启动新的主要阶段
- 发现会改变计划的内容
- 避免叙述常规操作
- 每次更新必须包含具体结果(如“找到X”“更新Y”)
- 不得超出请求范围
</user_updates>Self-Check for High-Risk Outputs
高风险输出自检
xml
<self_check>
Before finalizing answers in sensitive contexts (legal, financial, safety):
- Re-scan for unstated assumptions
- Check for ungrounded numbers or claims
- Soften overly strong language ("always", "guaranteed")
- Explicitly state assumptions
</self_check>xml
<self_check>
在敏感场景(法律、金融、安全)中完成最终回答前:
- 重新检查是否存在未说明的假设
- 检查是否存在无依据的数字或主张
- 弱化过于绝对的表述(如“总是”“保证”)
- 明确说明假设前提
</self_check>Structured Extraction
结构化提取
For data extraction tasks, always provide a schema:
xml
<extraction_spec>
Extract data into this exact schema (no extra fields):
{
"field_name": "string",
"optional_field": "string | null",
"numeric_field": "number | null"
}
- If a field is not present in source, set to null (don't guess)
- Re-scan source for missed fields before returning
</extraction_spec>针对数据提取任务,务必提供 schema:
xml
<extraction_spec>
将数据提取为以下精确schema(不得添加额外字段):
{
"field_name": "string",
"optional_field": "string | null",
"numeric_field": "number | null"
}
- 若源数据中不存在某字段,设为null(不得猜测)
- 返回前重新扫描源数据,避免遗漏字段
</extraction_spec>Web Research Prompts
网络研究提示词
xml
<research_guidelines>
- Browse the web for: time-sensitive topics, recommendations, navigational queries, ambiguous terms
- Include citations after paragraphs with web-derived claims
- Use multiple sources for key claims; prioritize primary sources
- Research until additional searching won't materially change the answer
- Structure output with Markdown: headers, bullets, tables for comparisons
</research_guidelines>xml
<research_guidelines>
- 针对以下内容进行网络浏览:时效性话题、推荐内容、导航查询、歧义术语
- 包含网络来源主张的段落需添加引用
- 关键主张使用多个来源,优先选择原始来源
- 持续研究直到进一步搜索不会实质性改变答案
- 使用Markdown结构输出:标题、项目符号、对比表格
</research_guidelines>Example: Before/After
示例:优化前后
Without structure:
You're a financial analyst. Generate a Q2 report for investors. Include Revenue, Margins, Cash Flow. Use this data: {{DATA}}. Make it professional and concise.With structure:
xml
You're a financial analyst at AcmeCorp generating a Q2 report for investors.
<context>
AcmeCorp is a B2B SaaS company. Investors value transparency and actionable insights.
</context>
<data>
{{DATA}}
</data>
<instructions>
1. Include sections: Revenue Growth, Profit Margins, Cash Flow
2. Highlight strengths and areas for improvement
3. Use concise, professional tone
</instructions>
<output_format>
- Use bullet points with metrics and YoY changes
- Include "Action:" items for areas needing improvement
- End with 2-3 bullet Outlook section
</output_format>无结构版本:
你是一名金融分析师。为投资者生成Q2报告。包含收入、利润率、现金流。使用以下数据:{{DATA}}。要求专业简洁。结构化版本:
xml
你是AcmeCorp的金融分析师,正在为投资者生成Q2报告。
<context>
AcmeCorp是一家B2B SaaS公司。投资者重视透明度和可执行见解。
</context>
<data>
{{DATA}}
</data>
<instructions>
1. 包含章节:收入增长、利润率、现金流
2. 突出优势与改进方向
3. 使用简洁专业的语气
</instructions>
<output_format>
- 使用包含指标和同比变化的项目符号
- 为改进方向添加“行动:”项
- 结尾添加2-3个项目符号的展望章节
</output_format>Prompt Migration Checklist
提示词迁移检查清单
When adapting prompts across models or versions:
- Switch model, keep prompt identical — isolate the variable
- Pin reasoning/thinking depth to match prior model's profile
- Run evals — if results are good, ship
- If regressions, tune prompt — adjust verbosity/format/scope constraints
- Re-eval after each small change — one change at a time
在不同模型或版本间适配提示词时:
- 切换模型,保持提示词不变 —— 隔离变量
- 固定推理/思考深度 —— 匹配原模型的特征
- 运行评估 —— 若结果良好则上线
- 若出现退化,调整提示词 —— 修改冗余度/格式/范围约束
- 每次小幅修改后重新评估 —— 一次只做一处修改
Quick Reference
快速参考
| Technique | Tag Pattern | Use Case |
|---|---|---|
| Separate sections | | Any complex prompt |
| Control length | | Prevent verbosity |
| Prevent drift | | Feature creep |
| Handle uncertainty | | Factual queries |
| Chain of thought | | Reasoning tasks |
| Extraction | | Data parsing |
| Research | | Web-enabled agents |
| Self-check | | High-risk domains |
| Tool usage | | Agentic systems |
| Eagerness control | | Agent autonomy |
| Persona | | Tone & style |
| 技术 | 标签模式 | 使用场景 |
|---|---|---|
| 模块分离 | | 任何复杂提示词 |
| 长度控制 | 带字数/项目符号限制的 | 避免冗余 |
| 防止偏离 | 包含明确“禁止”内容的 | 功能蔓延 |
| 歧义处理 | | 事实查询 |
| 思维链 | | 推理任务 |
| 提取 | 带JSON结构的 | 数据解析 |
| 研究 | | 支持网络的Agent |
| 自检 | | 高风险领域 |
| 工具使用 | | Agentic系统 |
| 积极性控制 | | Agent自主性 |
| 角色设定 | | 语气与风格 |
Prompting Techniques Catalog
提示工程技术目录
Comprehensive catalog of prompting techniques. Full details, examples, and academic references in references/prompting-techniques.md.
| Technique | Use Case |
|---|---|
| Zero-Shot Prompting | Direct task execution without examples; classification, translation, summarization |
| Few-Shot Prompting | In-context learning via exemplars; format control, label calibration, style matching |
| Chain-of-Thought (CoT) | Step-by-step reasoning; arithmetic, logic, commonsense reasoning tasks |
| Meta Prompting | LLM as orchestrator delegating to specialized expert prompts; complex multi-domain tasks |
| Self-Consistency | Sample multiple CoT paths, pick majority answer; boost accuracy on math & reasoning |
| Generated Knowledge | Generate relevant knowledge first, then answer; commonsense & factual QA |
| Prompt Chaining | Break complex tasks into sequential subtasks; document analysis, multi-step workflows |
| Tree of Thoughts (ToT) | Explore multiple reasoning branches with lookahead/backtracking; planning, puzzles |
| RAG | Retrieve external documents before generating; knowledge-intensive tasks, fresh data |
| ART (Auto Reasoning + Tools) | Auto-select and orchestrate tools with CoT; tasks requiring calculation, search, APIs |
| APE (Auto Prompt Engineer) | LLM generates and scores candidate prompts; prompt optimization at scale |
| Active-Prompt | Identify uncertain examples, annotate selectively for CoT; adaptive few-shot |
| Directional Stimulus | Add a hint/keyword to guide generation direction; summarization, dialogue |
| PAL (Program-Aided LM) | Generate code instead of text for reasoning; math, data manipulation, symbolic tasks |
| ReAct | Interleave reasoning traces with tool actions; search, QA, decision-making agents |
| Reflexion | Agent self-reflects on failures with verbal feedback; iterative improvement, debugging |
| Multimodal CoT | Two-stage: rationale generation then answer with text+image; visual reasoning tasks |
| Graph Prompting | Structured graph-based prompts; node classification, relation extraction, graph tasks |
全面的提示工程技术目录。详细内容、示例和学术参考文献见references/prompting-techniques.md。
| 技术 | 使用场景 |
|---|---|
| Zero-Shot Prompting | 无需示例直接执行任务;分类、翻译、摘要 |
| Few-Shot Prompting | 通过示例实现上下文学习;格式控制、标签校准、风格匹配 |
| Chain-of-Thought (CoT) | 分步推理;算术、逻辑、常识推理任务 |
| Meta Prompting | 将LLM作为协调者,委派给专业的专家提示词;复杂多领域任务 |
| Self-Consistency | 生成多个CoT路径,选择多数答案;提升数学与推理任务准确性 |
| Generated Knowledge | 先生成相关知识,再回答问题;常识与事实问答 |
| Prompt Chaining | 将复杂任务拆分为连续子任务;文档分析、多步骤工作流 |
| Tree of Thoughts (ToT) | 探索多个推理分支,支持前瞻/回溯;规划、谜题 |
| RAG | 生成内容前检索外部文档;知识密集型任务、新鲜数据 |
| ART (Auto Reasoning + Tools) | 自动选择并协调工具与CoT;需要计算、搜索、API的任务 |
| APE (Auto Prompt Engineer) | LLM生成并评分候选提示词;大规模提示词优化 |
| Active-Prompt | 识别不确定示例,选择性标注用于CoT;自适应少样本学习 |
| Directional Stimulus | 添加提示/关键词引导生成方向;摘要、对话 |
| PAL (Program-Aided LM) | 生成代码而非文本进行推理;数学、数据处理、符号任务 |
| ReAct | 交替推理轨迹与工具操作;搜索、问答、决策Agent |
| Reflexion | Agent通过语言反馈自我反思失败;迭代改进、调试 |
| Multimodal CoT | 两阶段:先生成理由,再用文本+图像回答;视觉推理任务 |
| Graph Prompting | 结构化基于图的提示词;节点分类、关系提取、图任务 |
Prompting Fundamentals
提示工程基础
LLM settings, prompt elements, formatting, and practical examples — see references/prompting-introduction.md. Covers:
- LLM Settings — temperature, top-p, max length, stop sequences, frequency/presence penalties
- Prompt Elements — instruction, context, input data, output indicator
- Design Tips — start simple, be specific, avoid impreciseness, say what TO do (not what NOT to do)
- Task Examples — summarization, extraction, QA, classification, conversation, code generation, reasoning
LLM设置、提示词元素、格式和实用示例 —— 见references/prompting-introduction.md。涵盖:
- LLM设置 —— temperature、top-p、最大长度、停止序列、频率/存在惩罚
- 提示词元素 —— 指令、上下文、输入数据、输出标识
- 设计技巧 —— 从简单开始、明确具体、避免模糊、说明要做什么(而非不要做什么)
- 任务示例 —— 摘要、提取、问答、分类、对话、代码生成、推理
Risks & Misuses
风险与误用
Adversarial attacks, factuality issues, and bias mitigation — see references/prompting-risks.md. Covers:
- Adversarial Prompting — prompt injection, prompt leaking, jailbreaking (DAN, Waluigi Effect), defense tactics
- Factuality — ground truth grounding, calibrated confidence, admit-ignorance patterns
- Biases — exemplar distribution skew, exemplar ordering effects, balanced few-shot design
对抗性攻击、事实性问题和偏见缓解 —— 见references/prompting-risks.md。涵盖:
- 对抗性提示词 —— 提示词注入、提示词泄露、越狱(DAN、Waluigi Effect)、防御策略
- 事实性 —— 真值锚定、校准置信度、承认无知模式
- 偏见 —— 示例分布偏差、示例顺序影响、均衡少样本设计
Prompt Audit / Review
提示词审核/评审
When asked to audit, review, or improve a prompt, follow this workflow. Full checklist with per-check references: prompt-audit-checklist.md.
当需要审核、评审或改进提示词时,遵循以下工作流。完整检查清单及各检查项参考文献:prompt-audit-checklist.md。
Workflow
工作流
- Read the prompt fully — identify its purpose, target model, and deployment context (interactive chat, agentic system, batch pipeline, RAG-augmented)
- Walk 8 dimensions — check each, note issues with severity (Critical / Warning / Suggestion):
| # | Dimension | What to Check |
|---|---|---|
| 1 | Clarity & Specificity | Task definition, success criteria, audience, output format, conflicting constraints |
| 2 | Structure & Formatting | Section separation (XML tags), prompt smells (monolithic, mixed layers, negative bias) |
| 3 | Safety & Security | Control/data separation, secrets in prompt, injection resilience, tool permissions |
| 4 | Hallucination & Factuality | Role framing, grounding, citation-without-sources, uncertainty handling |
| 5 | Context Management | Info placement (not buried in middle), context size, RAG doc count, re-grounding |
| 6 | Maintainability & Debt | Hardcoded values, regenerated logic, model pinning, testability |
| 7 | Model-Specific Fit | Model-specific params and gotchas (see Model-Specific Guides below) |
| 8 | Evaluation Readiness | Eval criteria, adversarial test cases, schema enforcement, monitoring |
- Produce a report — issues table (dimension, check, severity, issue, fix) + rewritten prompt or targeted fix suggestions. Use the report template from the checklist reference.
- For each issue, cite the relevant reference file so the user can dive deeper.
- 完整阅读提示词 —— 确定其用途、目标模型和部署场景(交互式聊天、Agentic系统、批量流水线、RAG增强)
- 检查8个维度 —— 逐一检查,标注问题严重程度(严重/警告/建议):
| # | 维度 | 检查内容 |
|---|---|---|
| 1 | 清晰度与明确性 | 任务定义、成功标准、受众、输出格式、冲突约束 |
| 2 | 结构与格式 | 模块分离(XML标签)、提示词问题(单一化、混合层级、负面偏见) |
| 3 | 安全与保障 | 控制/数据分离、提示词中的机密信息、注入抗性、工具权限 |
| 4 | 幻觉与事实性 | 角色设定、锚定、无来源引用、歧义处理 |
| 5 | 上下文管理 | 信息位置(不要埋在中间)、上下文大小、RAG文档数量、重锚定 |
| 6 | 可维护性与债务 | 硬编码值、再生逻辑、模型固定、可测试性 |
| 7 | 特定模型适配 | 模型特定参数与注意事项(见下文特定模型指南) |
| 8 | 评估就绪性 | 评估标准、对抗测试用例、schema强制执行、监控 |
- 生成报告 —— 问题表格(维度、检查项、严重程度、问题、修复方案) + 重写后的提示词或针对性修复建议。使用检查清单参考中的报告模板。
- 针对每个问题,引用相关参考文件,方便用户深入了解。
Quick Decision: Which Dimensions to Prioritize
快速决策:优先检查哪些维度
- User-facing chatbot → prioritize Safety (#3), Hallucination (#4), Clarity (#1)
- Agentic system with tools → prioritize Safety (#3), Context (#5), Maintainability (#6)
- Batch/pipeline → prioritize Structure (#2), Evaluation (#8), Maintainability (#6)
- RAG-augmented → prioritize Context (#5), Safety (#3), Hallucination (#4)
- 面向用户的聊天机器人 → 优先检查安全(#3)、幻觉(#4)、清晰度(#1)
- 带工具的Agentic系统 → 优先检查安全(#3)、上下文(#5)、可维护性(#6)
- 批量/流水线 → 优先检查结构(#2)、评估(#8)、可维护性(#6)
- RAG增强系统 → 优先检查上下文(#5)、安全(#3)、幻觉(#4)
Common Mistakes & Anti-Patterns
常见错误与反模式
Three complementary layers — use the one matching your need:
Deep-dives by category — root causes, mechanisms, prevention checklists (from "The Architecture of Instruction", 2026):
| Mistake Category | Key Issues | Reference |
|---|---|---|
| Hallucinations & Logic | Ambiguity-induced confabulation, automation bias, overloaded prompts, logical failures in verification tasks, no role framing | mistakes-hallucinations.md |
| Structural Fragility | Formatting sensitivity (up to 76pp variance), reproducibility crisis, prompt smells catalog (6 anti-patterns), deliberation ladder | mistakes-structure.md |
| Context Rot | "Lost in the middle" U-shaped attention, RAG over-retrieval, naive data loading, context engineering shift | mistakes-context.md |
| Prompt Debt | Token tax of regenerative code, debt taxonomy (prompt/hyperparameter/framework/cost), multi-agent solutions, automated repair | mistakes-debt.md |
| Security | Direct/indirect injection, jailbreaking, system prompt leakage (OWASP LLM07:2025), RAG poisoning, multimodal injection, adversarial suffixes | mistakes-security.md |
Quick reference — 18-category taxonomy with MRPs, risk scores, case studies, action items: failure-taxonomy.md. Start here for an overview or to prioritize which categories to address first. Covers: control-plane vs data-plane model, heuristic risk scoring, real-world incidents (EchoLeak CVE-2025-32711, Mata v. Avianca, Samsung shadow AI).
How to measure & test — eval metrics, CI gating, red-teaming, tooling: evaluation-redteaming.md. Covers: TruthfulQA, FActScore, SelfCheckGPT, PromptBench, AILuminate, LLM-as-judge pitfalls, guardrail libraries, open research questions.
三个互补层级 —— 选择符合需求的层级:
按类别深入分析 —— 根本原因、机制、预防检查清单(来自《指令架构》,2026):
| 错误类别 | 核心问题 | 参考文件 |
|---|---|---|
| 幻觉与逻辑 | 歧义导致的虚构、自动化偏见、过载提示词、验证任务中的逻辑错误、无角色设定 | mistakes-hallucinations.md |
| 结构脆弱性 | 格式敏感度(高达76pp差异)、可复现性危机、提示词问题目录(6种反模式)、思考阶梯 | mistakes-structure.md |
| 上下文衰减 | “中间迷失”U型注意力、RAG过度检索、朴素数据加载、上下文工程转变 | mistakes-context.md |
| 提示词债务 | 再生代码的Token成本、债务分类(提示词/超参数/框架/成本)、多Agent解决方案、自动修复 | mistakes-debt.md |
| 安全 | 直接/间接注入、越狱、系统提示词泄露(OWASP LLM07:2025)、RAG投毒、多模态注入、对抗性后缀 | mistakes-security.md |
快速参考 —— 18类分类体系,包含MRP、风险评分、案例研究、行动项:failure-taxonomy.md。从这里开始了解概述或优先处理哪些类别。涵盖:控制平面vs数据平面模型、启发式风险评分、真实事件(EchoLeak CVE-2025-32711、Mata v. Avianca、三星影子AI)。
如何衡量与测试 —— 评估指标、CI门控、红队测试、工具:evaluation-redteaming.md。涵盖:TruthfulQA、FActScore、SelfCheckGPT、PromptBench、AILuminate、LLM-as-judge缺陷、防护库、开放研究问题。
Model-Specific Guides
特定模型指南
Each model family has unique parameters, gotchas, and patterns. Consult the reference for your target model:
- Claude Family — Claude 4.x family defaults, parameters, tools, and migration patterns
- Claude Fable 5 — always-on adaptive thinking, effort calibration, lean instruction design, long-run progress grounding, action boundaries, subagents, memory, fresh-context verification, refusals, and Opus 4.8 fallback behavior
reasoning_extraction - GPT-5 Family — GPT-5 / 5.1 / 5.2 / 5.4 / 5.5: ,
reasoning_effort, named tools, agentic prompting, completeness/verification contracts, compaction, and migration pathstext.verbosity - GPT-5.6 Sol — lean outcome-first prompts, autonomy boundaries, effort and Pro mode, Programmatic Tool Calling, persisted reasoning, explicit caching, retrieval budgets, long-running state, frontend and visual verification, and migration workflow
max - Gemini 3 Family — Gemini 2.5/3/3.1: temperature MUST be 1.0, vs
thinking_budget, constraint placement (end of prompt), persona priority, function calling, structured output, multimodal, image generationthinking_level - GPT-5.2 Specifics — Compaction API code examples, web research agent prompt, full XML specification blocks
每个模型家族都有独特的参数、注意事项和模式。参考目标模型的指南:
- Claude家族 —— Claude 4.x家族默认设置、参数、工具和迁移模式
- Claude Fable 5 —— 始终开启的自适应思考、工作量校准、精简指令设计、长期进度锚定、行动边界、子Agent、记忆、新鲜上下文验证、拒绝行为,以及Opus 4.8 fallback行为
reasoning_extraction - GPT-5家族 —— GPT-5 / 5.1 / 5.2 / 5.4 / 5.5:、
reasoning_effort、命名工具、Agentic提示词、完整性/验证契约、压缩,以及迁移路径text.verbosity - GPT-5.6 Sol —— 精简的结果优先提示词、自主性边界、工作量和Pro模式、程序化工具调用、持久化推理、显式缓存、检索预算、长期运行状态、前端和视觉验证,以及迁移工作流
max - Gemini 3家族 —— Gemini 2.5/3/3.1:temperature必须设为1.0、vs
thinking_budget、约束位置(提示词末尾)、角色优先级、函数调用、结构化输出、多模态、图像生成thinking_level - GPT-5.2详情 —— Compaction API代码示例、网络研究Agent提示词、完整XML规范块