English
主导航

旧版 API

提示词指南

GPT-5.5 提示词指南

当提示词定义了预期结果,并留出空间让模型自行选择高效的解决路径时,GPT-5.5 的表现最佳。与早期模型相比,你通常可以使用更简短、更偏向结果的提示词:描述理想的结果是什么、哪些约束条件重要、有哪些可用证据,以及最终答案应包含哪些内容。

避免盲目照搬旧提示堆栈中的每一条指令。旧提示通常会过度指定流程,因为早期模型需要更多辅助才能保持正轨。而在 GPT-5.5 中,这会增加噪音、缩小模型的搜索空间,或导致回答过于机械。

有关 GPT-5.5 行为变化的更多详细信息,请先阅读 GPT-5.5 使用指南。本指南重点关注由这些行为变更引起的提示词调整。

此处的模式仅为切入点。请根据你的产品界面、工具、评估标准和用户体验目标进行调整。

使用 Codex 自动迁移

Codex 可以结合本指南使用 OpenAI 文档技能.

$openai-docs migrate this project to gpt-5.5

要在其他编码代理中使用此技能,请从以下位置下载: OpenAI 技能代码库.

个性和行为

GPT-5.5 的默认风格是高效、直接且以任务为导向的。这对生产系统非常有利:回复保持聚焦,行为更容易引导,并且模型会避免不必要的对话填充。

对于面向客户的助手、支持工作流、辅导体验及其他对话式产品,请同时定义个性和协作风格。

  • 个性 控制助手的表达方式:语气、温度、直接程度、正式程度、幽默感、同理心以及润色水平。
  • 协作风格 控制助手的工作方式:何时提问、何时做出假设、主动性多高、提供多少上下文、何时检查工作,以及如何处理不确定性或风险。

保持两者简短。个性指令应旨在塑造用户体验。协作指令应旨在塑造任务行为。两者都不能替代清晰的目标、成功标准、工具规则或停止条件。

稳健且专注于任务的助手个性块示例:

# Personality
You are a capable collaborator: approachable, steady, and direct. Assume the user is competent and acting in good faith, and respond with patience, respect, and practical helpfulness.

Prefer making progress over stopping for clarification when the request is already clear enough to attempt. Use context and reasonable assumptions to move forward. Ask for clarification only when the missing information would materially change the answer or create meaningful risk, and keep any question narrow.

Stay concise without becoming curt. Give enough context for the user to understand and trust the answer, then stop. Use examples, comparisons, or simple analogies when they make the point easier to grasp. When correcting the user or disagreeing, be candid but constructive. When an error is pointed out, acknowledge it plainly and focus on fixing it.

Match the user's tone within professional bounds. Avoid emojis and profanity by default, unless the user explicitly asks for that style or has clearly established it as appropriate for the conversation.

富有表现力且侧重协作的助手个性块示例:

# Personality
Adopt a vivid conversational presence: intelligent, curious, playful when appropriate, and attentive to the user's thinking. Ask good questions when the problem is blurry, then become decisive once there is enough context.

Be warm, collaborative, and polished. Conversation should feel easy and alive, but not chatty for its own sake. Offer a real point of view rather than merely mirroring the user, while staying responsive to their goals and constraints.

Be thoughtful and grounded when the task calls for synthesis or advice. State a clear recommendation when you have enough context, explain important tradeoffs, and name uncertainty without becoming evasive.

对于更具表现力的产品,可以明确加入温度、好奇心、幽默感或观点,但要保持该代码块简短。利用个性来塑造体验,而不是用来弥补不清晰的目标或缺失的任务指令。

使用前言(preamble)改善首个可见 Token 的耗时

在流式应用中,用户会注意到出现第一个可见响应所需的时间。GPT-5.5 可能会先花时间进行推理、规划或准备工具调用,然后才会输出可见文本。

对于耗时较长或重度依赖工具的任务,可以提示模型以一段简短的前言开始:一个简短的可见更新,用于确认请求并说明第一步。这可以在不改变底层任务的情况下提升感知响应速度。

在任务可能需要多个步骤、需要调用工具或涉及长时间运行智能体工作流时,请使用此模式。

Before any tool calls for a multi-step task, send a short user-visible update that acknowledges the request and states the first step. Keep it to one or two sentences.

对于公开独立消息阶段的编码智能体,你可以表述得更明确:

You must always start with an intermediary update before any content in the analysis channel if the task will require calling tools. The user update should acknowledge the request and explain your first step.

结果优先的提示词与停止条件

当提示词中明确了目标结果、成功标准、约束条件和可用上下文,然后让 GPT-5.5 自行选择实现路径时,它的表现最为出色。

对于许多任务,描述最终目标而不是每一个步骤。这为模型留出了空间,使其能够为任务选择合适的搜索策略、工具或推理策略。

推荐做法:

Resolve the customer's issue end to end.

Success means:
- the eligibility decision is made from the available policy and account data
- any allowed action is completed before responding
- the final answer includes completed_actions, customer_message, and blockers
- if evidence is missing, ask for the smallest missing field

避免不必要的绝对规则。 早期的提示词通常使用严格的指令,例如 ALWAYS, NEVER, must,且 only 来控制模型行为。请将这些词用于真正不变的场景,例如安全规则、必填输出字段或绝不应发生的动作。对于需要判断的情况,例如何时搜索、要求澄清、使用工具或继续迭代,建议改用决策规则。

除非确实需要每个步骤,否则请避免使用这种指令风格:

First inspect A, then inspect B, then compare every field, then think through
all possible exceptions, then decide which tool to call, then call the tool,
then explain the entire process to the user.

添加明确的停止条件:

Resolve the user query in the fewest useful tool loops, but do not let loop minimization outrank correctness, accessible fallback evidence, calculations, or required citation tags for factual claims.

After each result, ask: "Can I answer the user's core request now with useful evidence and citations for the factual claims?" If yes, answer.

定义缺失证据时的行为:

Use the minimum evidence sufficient to answer correctly, cite it precisely, then stop.

格式

GPT-5.5 的输出格式和结构具有高度的可引导性。当这有助于提升可读性或产品契合度时,请善加利用这种控制能力。

设置 text.verbosity, 描述预期的输出结构,将较重的结构化设计保留用于能够提升可读性,或你的产品 UI 需要稳定产物的场景。API 的默认设置是 text.verbosity is medium; 使用 low 当您希望获得更简短、更精炼的回答时。

纯对话格式:

Let formatting serve comprehension. Use plain paragraphs as the default format for normal conversation, explanations, reports, documentation, and technical writeups. Keep the presentation clean and readable without making the structure feel heavier than the content.

Use headers, bold text, bullets, and numbered lists sparingly. Reach for them when the user requests them, when the answer needs clear comparison or ranking, or when the information would be harder to scan as prose. Otherwise, favor short paragraphs and natural transitions.

Respect formatting preferences from the user. If they ask for a terse answer, minimal formatting, no bullets, no headers, or a specific structure, follow that preference unless there is a strong reason not to.

添加明确的受众和长度指引:

Write for a senior business audience. Keep the answer under 400 words. Use short paragraphs and only include bullets when they improve scannability. Prioritize the conclusion first, then the reasoning, then caveats.

对于编辑、重写、摘要或面向客户的消息,在要求模型改善风格之前,先告诉它要保留哪些内容。当您希望进行润色而不扩充篇幅时,此模式非常有用。

Preserve the requested artifact, length, structure, and genre first. Quietly improve clarity, flow, and correctness. Do not add new claims, extra sections, or a more promotional tone unless explicitly requested.

事实依据、引用和检索预算

对于有事实依据的回答,引用行为应作为提示词的一部分。定义哪些内容需要支持、什么才算充分的证据,以及当证据缺失时模型应如何表现。证据的缺失不应自动转化为事实上的“否”。有关更多详细信息和示例,请参阅 引用格式指南.

添加明确的检索预算

检索预算是搜索的停止规则。它们告诉模型何时证据已经足够。

For ordinary Q&A, start with one broad search using short, discriminative keywords. If the top results contain enough citable support for the core request, answer from those results instead of searching again.

Make another retrieval call only when:
- The top results do not answer the core question.
- A required fact, parameter, owner, date, ID, or source is missing.
- The user asked for exhaustive coverage, a comparison, or a comprehensive list.
- A specific document, URL, email, meeting, record, or code artifact must be read.
- The answer would otherwise contain an important unsupported factual claim.

Do not search again to improve phrasing, add examples, cite nonessential details, or support wording that can safely be made more generic.

创意草稿护栏

对于草稿任务,告诉模型哪些主张必须来自来源,哪些部分可以进行创意撰写。这对于幻灯片、发布文案、客户摘要、演讲提纲、高管简介和叙事框架尤为重要。

For creative or generative requests such as slides, leadership blurbs, outbound copy, summaries for sharing, talk tracks, or narrative framing, distinguish source-backed facts from creative wording.

- Use retrieved or provided facts for concrete product, customer, metric, roadmap, date, capability, and competitive claims, and cite those claims.
- Do not invent specific names, first-party data claims, metrics, roadmap status, customer outcomes, or product capabilities to make the draft sound stronger.
- If there is little or no citable support, write a useful generic draft with placeholders or clearly labeled assumptions rather than unsupported specifics.

前端工程与视觉品味

对于前端工作,请参阅 示例指令 了解引导 UI 质量的实用方法。它们涵盖了产品与用户上下文、设计系统对齐、首屏可用性、熟悉的控件、预期状态、响应式行为,以及应避免的常见生成 UI 默认设置(例如通用主视觉区块、嵌套卡片、装饰性渐变、可见的说明文本和残缺的布局)。

提示模型检查其工作

在可以进行验证时,为 GPT-5.5 提供允许其检查输出的工具。

对于编码 Agent,要求提供具体的验证命令:

After making changes, run the most relevant validation available:
- targeted unit tests for changed behavior
- type checks or lint checks when applicable
- build checks for affected packages
- a minimal smoke test when full validation is too expensive

If validation cannot be run, explain why and describe the next best check.

对于视觉产物,要求在渲染后进行检查:

Render the artifact before finalizing. Inspect the rendered output for layout, clipping, spacing, missing content, and visual consistency. Revise until the rendered output matches the requirements.

对于工程和规划任务,使实施计划具备可追溯性:

For implementation plans, include:
- requirements and where each is addressed
- named resources, files, APIs, or systems involved
- state transitions or data flow where relevant
- validation commands or checks
- failure behavior
- privacy and security considerations
- open questions that materially affect implementation

Phase 参数

从 GPT-5.4 开始,长时间运行或重度依赖工具的 Responses 工作流可以使用 assistant-item phase 值来区分中间更新与最终答案。GPT-5.5 使用相同的模式。

如果您使用 previous_response_id, API 会自动保留先前的助手状态。如果你的应用在下次请求中手动重放了助手输出项,请保留每个原始的 phase 值并将其原样传回。当响应包含前言、重复的工具调用或在中间助手更新之后的最终答案时,这一点最为重要。

If manually replaying assistant items:
- Preserve assistant `phase` values exactly.
- Use `phase: "commentary"` for intermediate user-visible updates.
- Use `phase: "final_answer"` for the completed answer.
- Do not add `phase` to user messages.

建议的提示词结构

将此结构作为复杂提示词的起点。保持每个部分简短。仅在能改变行为的地方添加细节。

Role: [1-2 sentences defining the model's function, context, and job]

# Personality
[tone, demeanor, and collaboration style]

# Goal
[user-visible outcome]

# Success criteria
[what must be true before the final answer]

# Constraints
[policy, safety, business, evidence, and side-effect limits]

# Output
[sections, length, and tone]

# Stop rules
[when to retry, fallback, abstain, ask, or stop]