{"id":3011,"date":"2026-01-24T16:33:03","date_gmt":"2026-01-24T16:33:03","guid":{"rendered":"https:\/\/umaax.com\/openaituichugpt5guanfangtishigongchengcizhinan\/"},"modified":"2026-01-24T16:33:03","modified_gmt":"2026-01-24T16:33:03","slug":"openaituichugpt5guanfangtishigongchengcizhinan","status":"publish","type":"post","link":"https:\/\/umaax.com\/en\/openaituichugpt5guanfangtishigongchengcizhinan\/","title":{"rendered":"OpenAI\u63a8\u51faGPT-5\u5b98\u65b9\u63d0\u793a\u5de5\u7a0b\u8bcd\u6307\u5357"},"content":{"rendered":"<p>\u300aGPT-5\u5de5\u7a0b\u8bcd\u6307\u5357\u300b\u662fOpenAI\u9488\u5bf9\u6700\u65b0\u65d7\u8230\u6a21\u578b\u53d1\u5e03\u7684\u5b98\u65b9\u6280\u672f\u6587\u6863\uff0c\u4e3b\u8981\u9762\u5411\u5f00\u53d1\u8005\u548c\u6280\u672f\u56e2\u961f\u3002\u6307\u5357\u7cfb\u7edf\u6027\u5730\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u4f18\u5316\u63d0\u793a\u8bbe\u8ba1\u6765\u5145\u5206\u53d1\u6325GPT-5\u5728\u4ee3\u7406\u4efb\u52a1\u3001\u7f16\u7a0b\u548c\u667a\u80fd\u4ea4\u4e92\u65b9\u9762\u7684\u7a81\u7834\u6027\u80fd\u529b\u3002\u6838\u5fc3\u5185\u5bb9\u5305\u62ec\uff1a\u4ee3\u7406\u5de5\u4f5c\u6d41\u7684\u4e3b\u52a8\u6027\u63a7\u5236\u6280\u5de7\u3001Responses API\u7684\u9ad8\u6548\u4f7f\u7528\u65b9\u6cd5\u3001\u7f16\u7a0b\u4efb\u52a1\u7684\u6700\u4f73\u5b9e\u8df5\u6846\u67b6\uff08\u7279\u522b\u9488\u5bf9\u524d\u7aef\u5f00\u53d1\uff09\u3001\u53ca\u6a21\u578b\u53c2\u6570\uff08\u5982reasoning_effort\u548cverbosity\uff09\u7684\u8c03\u4f18\u7b56\u7565\u3002\u6587\u6863\u7ed3\u5408Cursor\u7b49\u5408\u4f5c\u4f19\u4f34\u7684\u5b9e\u9645\u6848\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u901a\u8fc7\u7ed3\u6784\u5316\u63d0\u793a\u63d0\u5347\u4ee3\u7801\u751f\u6210\u8d28\u91cf\uff0c\u5e76\u7279\u522b\u5f3a\u8c03\u907f\u514d\u6307\u4ee4\u51b2\u7a81\u7684\u91cd\u8981\u6027\u3002\u6700\u540e\u8fd8\u63d0\u4f9bSWE-Bench\u7b49\u4e13\u4e1a\u573a\u666f\u7684\u6807\u51c6\u5316\u63d0\u793a\u6a21\u677f\uff0c\u662f\u4e00\u4efd\u517c\u5177\u7406\u8bba\u6307\u5bfc\u548c\u5b9e\u8df5\u4ef7\u503c\u7684\u6280\u672f\u53c2\u8003\u624b\u518c\u3002<\/p>\n<p> <img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-59747\" src=\"https:\/\/ai-bot.cn\/wp-content\/uploads\/2025\/08\/\u672a\u547d\u540d_20250729153740-95.png\"  alt=\"GPT-5\u63d0\u793a\u6307\u5357\" width=\"1200\" height=\"675\" \/> <\/p>\n<p>GPT-5, our newest flagship model, represents a substantial leap forward in agentic task performance, coding, raw intelligence, and steerability.<\/p>\n<p>While we trust it will perform excellently \u201cout of the box\u201d across a wide range of domains, in this guide we\u2019ll cover prompting tips to maximize the quality of model outputs, derived from our experience training and applying the model to real-world tasks. We discuss concepts like improving agentic task performance, ensuring instruction adherence, making use of newly API features, and optimizing coding for frontend and software engineering tasks \u2013 with key insights into AI code editor Cursor\u2019s prompt tuning work with GPT-5.<\/p>\n<p>We\u2019ve seen significant gains from applying these best practices and adopting our canonical tools whenever possible, and we hope that this guide, along with the\u00a0prompt optimizer tool\u00a0we\u2019ve built, will serve as a launchpad for your use of GPT-5. But, as always, remember that prompting is not a one-size-fits-all exercise \u2013 we encourage you to run experiments and iterate on the foundation offered here to find the best solution for your problem.<\/p>\n<h2>Agentic workflow predictability<\/h2>\n<p>We trained GPT-5 with developers in mind: we\u2019ve focused on improving tool calling, instruction following, and long-context understanding to serve as the best foundation model for agentic applications. If adopting GPT-5 for agentic and tool calling flows, we recommend upgrading to the\u00a0Responses API, where reasoning is persisted between tool calls, leading to more efficient and intelligent outputs.<\/p>\n<p><strong>Controlling agentic eagerness<\/strong><\/p>\n<p>Agentic scaffolds can span a wide spectrum of control\u2014some systems delegate the vast majority of decision-making to the underlying model, while others keep the model on a tight leash with heavy programmatic logical branching. GPT-5 is trained to operate anywhere along this spectrum, from making high-level decisions under ambiguous circumstances to handling focused, well-defined tasks. In this section we cover how to best calibrate GPT-5\u2019s agentic eagerness: in other words, its balance between proactivity and awaiting explicit guidance.<\/p>\n<ul>\n<li><strong>Prompting for less eagerness<\/strong><\/li>\n<\/ul>\n<p>GPT-5 is, by default, thorough and comprehensive when trying to gather context in an agentic environment to ensure it will produce a correct answer. To reduce the scope of GPT-5\u2019s agentic behavior\u2014including limiting tangential tool-calling action and minimizing latency to reach a final answer\u2014try the following:<\/p>\n<ul>\n<li>Switch to a lower\u00a0<code>reasoning_effort<\/code>. This reduces exploration depth but improves efficiency and latency. Many workflows can be accomplished with consistent results at medium or even low\u00a0<code>reasoning_effort<\/code>.<\/li>\n<li>Define clear criteria in your prompt for how you want the model to explore the problem space. This reduces the model\u2019s need to explore and reason about too many ideas:<\/li>\n<\/ul>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><context_gathering>  \u76ee\u6807: \u5feb\u901f\u83b7\u53d6\u8db3\u591f\u7684\u4e0a\u4e0b\u6587\u3002\u5e76\u884c\u8fdb\u884c\u53d1\u73b0\uff0c\u5e76\u5c3d\u5feb\u505c\u6b62\u4ee5\u4fbf\u91c7\u53d6\u884c\u52a8\u3002    \u65b9\u6cd5:  - \u4ece\u5e7f\u5904\u7740\u624b\uff0c\u7136\u540e\u5206\u6563\u5230\u96c6\u4e2d\u7684\u5b50\u67e5\u8be2\u3002  - \u5e76\u884c\u542f\u52a8\u4e0d\u540c\u7684\u67e5\u8be2\uff1b\u9605\u8bfb\u6bcf\u4e2a\u67e5\u8be2\u7684\u6700\u4f73\u7ed3\u679c\u3002\u5bf9\u8def\u5f84\u8fdb\u884c\u53bb\u91cd\u548c\u7f13\u5b58\uff1b\u4e0d\u8981\u91cd\u590d\u67e5\u8be2\u3002  - \u907f\u514d\u8fc7\u5ea6\u641c\u7d22\u4e0a\u4e0b\u6587\u3002\u5982\u679c\u9700\u8981\uff0c\u53ef\u5728\u4e00\u6b21\u5e76\u884c\u6279\u5904\u7406\u4e2d\u8fd0\u884c\u6709\u9488\u5bf9\u6027\u7684\u641c\u7d22\u3002    \u63d0\u524d\u505c\u6b62\u6807\u51c6:  - \u4f60\u53ef\u4ee5\u660e\u786e\u6307\u51fa\u8981\u66f4\u6539\u7684\u5185\u5bb9\u3002  - \u6700\u4f73\u7ed3\u679c\u5728\u67d0\u4e2a\u9886\u57df\/\u8def\u5f84\u4e0a\u8d8b\u4e8e\u4e00\u81f4\uff08\u7ea670%\uff09\u3002    \u5347\u7ea7\u6761\u4ef6:  - \u5982\u679c\u4fe1\u53f7\u51b2\u7a81\u6216\u8303\u56f4\u6a21\u7cca\uff0c\u8fd0\u884c\u4e00\u6b21\u7cbe\u70bc\u7684\u5e76\u884c\u6279\u5904\u7406\uff0c\u7136\u540e\u7ee7\u7eed\u3002    \u6df1\u5ea6:  - \u53ea\u8ffd\u8e2a\u4f60\u5c06\u4fee\u6539\u6216\u5176\u5951\u7ea6\u6240\u4f9d\u8d56\u7684\u7b26\u53f7\uff1b\u9664\u975e\u5fc5\u8981\uff0c\u5426\u5219\u907f\u514d\u4f20\u9012\u6027\u6269\u5c55\u3002    \u5faa\u73af:  - \u6279\u91cf\u641c\u7d22 \u2192 \u6700\u5c0f\u5316\u8ba1\u5212 \u2192 \u5b8c\u6210\u4efb\u52a1\u3002  - \u4ec5\u5f53\u9a8c\u8bc1\u5931\u8d25\u6216\u51fa\u73b0\u65b0\u672a\u77e5\u65f6\u624d\u518d\u6b21\u641c\u7d22\u3002\u4f18\u5148\u91c7\u53d6\u884c\u52a8\uff0c\u800c\u4e0d\u662f\u8fdb\u884c\u66f4\u591a\u641c\u7d22\u3002  <\/context_gathering><\/code><\/pre>\n<p>If you\u2019re willing to be maximally prescriptive, you can even set fixed tool call budgets, like the one below. The budget can naturally vary based on your desired search depth.<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><span class=\"token tag\"><span class=\"token punctuation\"><<\/span>context_gathering<span class=\"token punctuation\">>  <\/span><\/span>- \u641c\u7d22\u6df1\u5ea6\uff1a\u6781\u4f4e   - \u5f3a\u70c8\u503e\u5411\u4e8e\u5c3d\u53ef\u80fd\u5feb\u5730\u63d0\u4f9b\u6b63\u786e\u7b54\u6848\uff0c\u5373\u4f7f\u53ef\u80fd\u4e0d\u5b8c\u5168\u6b63\u786e\u3002  - \u901a\u5e38\uff0c\u8fd9\u610f\u5473\u7740\u7edd\u5bf9\u6700\u591a2\u6b21\u5de5\u5177\u8c03\u7528\u3002   - \u82e5\u8ba4\u4e3a\u9700\u8981\u66f4\u591a\u65f6\u95f4\u8c03\u67e5\uff0c\u5411\u7528\u6237\u66f4\u65b0\u6700\u65b0\u53d1\u73b0\u548c\u672a\u51b3\u95ee\u9898\u3002\u7528\u6237\u786e\u8ba4\u540e\u53ef\u7ee7\u7eed\u3002  <span class=\"token tag\"><span class=\"token punctuation\"><\/<\/span>context_gathering<span class=\"token punctuation\">><\/span><\/span><\/code><\/pre>\n<p>When limiting core context gathering behavior, it\u2019s helpful to explicitly provide the model with an escape hatch that makes it easier to satisfy a shorter context gathering step. Usually this comes in the form of a clause that allows the model to proceed under uncertainty, like\u00a0<code>\u201ceven if it might not be fully correct\u201d<\/code>\u00a0in the above example.<\/p>\n<ul>\n<li><strong>Prompting for more eagerness<\/strong><\/li>\n<\/ul>\n<p>On the other hand, if you\u2019d like to encourage model autonomy, increase tool-calling persistence, and reduce occurrences of clarifying questions or otherwise handing back to the user, we recommend increasing\u00a0<code>reasoning_effort<\/code>, and using a prompt like the following to encourage persistence and thorough task completion:<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><span class=\"token tag\"><span class=\"token punctuation\"><<\/span>persistence<span class=\"token punctuation\">><\/span><\/span>   - \u4f60\u662f\u4e00\u4e2a\u4ee3\u7406\u2014\u2014\u8bf7\u6301\u7eed\u5de5\u4f5c\u76f4\u5230\u7528\u6237\u7684\u67e5\u8be2\u5b8c\u5168\u89e3\u51b3\uff0c\u518d\u5c06\u63a7\u5236\u6743\u4ea4\u8fd8\u7528\u6237\u3002  - \u4ec5\u5728\u786e\u5b9a\u95ee\u9898\u5df2\u89e3\u51b3\u65f6\u7ec8\u6b62\u4f60\u7684\u56de\u5408\u3002   - \u9047\u5230\u4e0d\u786e\u5b9a\u6027\u65f6\u5207\u52ff\u505c\u6b62\u6216\u4ea4\u8fd8\u7528\u6237\u2014\u2014\u7814\u7a76\u6216\u63a8\u65ad\u6700\u5408\u7406\u7684\u65b9\u6cd5\u5e76\u7ee7\u7eed\u3002   - \u52ff\u8981\u6c42\u4eba\u7c7b\u786e\u8ba4\u6216\u6f84\u6e05\u5047\u8bbe\uff0c\u56e0\u4e3a\u4f60\u603b\u53ef\u4ee5\u7a0d\u540e\u8c03\u6574\u2014\u2014\u51b3\u5b9a\u6700\u5408\u7406\u7684\u5047\u8bbe\uff0c\u636e\u6b64\u884c\u52a8\uff0c\u5e76\u5728\u5b8c\u6210\u540e\u4e3a\u7528\u6237\u8bb0\u5f55\u3002   <span class=\"token tag\"><span class=\"token punctuation\"><\/<\/span>persistence<span class=\"token punctuation\">><\/span><\/span><\/code><\/pre>\n<p>Generally, it can be helpful to clearly state the stop conditions of the agentic tasks, outline safe versus unsafe actions, and define when, if ever, it\u2019s acceptable for the model to hand back to the user. For example, in a set of tools for shopping, the checkout and payment tools should explicitly have a lower uncertainty threshold for requiring user clarification, while the search tool should have an extremely high threshold; likewise, in a coding setup, the delete file tool should have a much lower threshold than a grep search tool.<\/p>\n<p><strong>Tool preambles<\/strong><\/p>\n<p>We recognize that on agentic trajectories monitored by users, intermittent model updates on what it\u2019s doing with its tool calls and why can provide for a much better interactive user experience \u2013 the longer the rollout, the bigger the difference these updates make. To this end, GPT-5 is trained to provide clear upfront plans and consistent progress updates via \u201ctool preamble\u201d messages.<\/p>\n<p>You can steer the frequency, style, and content of tool preambles in your prompt\u2014from detailed explanations of every single tool call to a brief upfront plan and everything in between. This is an example of a high-quality preamble prompt:<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><span class=\"token tag\"><span class=\"token punctuation\"><<\/span>tool_preambles<span class=\"token punctuation\">><\/span><\/span>   - \u59cb\u7ec8\u4ee5\u53cb\u597d\u3001\u6e05\u6670\u3001\u7b80\u6d01\u7684\u65b9\u5f0f\u91cd\u65b0\u8868\u8ff0\u7528\u6237\u76ee\u6807\uff0c\u518d\u8c03\u7528\u4efb\u4f55\u5de5\u5177\u3002   - \u7136\u540e\u7acb\u5373\u6982\u8ff0\u4f60\u5c06\u9075\u5faa\u7684\u6bcf\u4e2a\u903b\u8f91\u6b65\u9aa4\u7684\u7ed3\u6784\u5316\u8ba1\u5212\u3002   - \u6267\u884c\u6587\u4ef6\u7f16\u8f91\u65f6\uff0c\u7b80\u6d01\u6709\u5e8f\u5730\u53d9\u8ff0\u6bcf\u4e2a\u6b65\u9aa4\uff0c\u6e05\u6670\u6807\u8bb0\u8fdb\u5ea6\u3002   - \u6700\u540e\u5c06\u5df2\u5b8c\u6210\u7684\u5de5\u4f5c\u4e0e\u524d\u671f\u8ba1\u5212\u660e\u786e\u533a\u5206\u603b\u7ed3\u3002   <span class=\"token tag\"><span class=\"token punctuation\"><\/<\/span>tool_preambles<span class=\"token punctuation\">><\/span><\/span><\/code><\/pre>\n<p>Here\u2019s an example of a tool preamble that might be emitted in response to such a prompt\u2014such preambles can drastically improve the user\u2019s ability to follow along with your agent\u2019s work as it grows more complicated:<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\"output\": [  \u00a0 \u00a0 {  \u00a0 \u00a0 \u00a0\u00a0\"id\":\u00a0\"rs_6888f6d0606c819aa8205ecee386963f0e683233d39188e7\",  \u00a0 \u00a0 \u00a0\u00a0\"type\":\u00a0\"reasoning\",  \u00a0 \u00a0 \u00a0\u00a0\"summary\": [  \u00a0 \u00a0 \u00a0 \u00a0 {  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\"type\":\u00a0\"summary_text\",  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\"text\":\u00a0\"**\u786e\u5b9a\u5929\u6c14\u54cd\u5e94**nn\u6211\u9700\u8981\u56de\u7b54\u7528\u6237\u5173\u4e8e\u65e7\u91d1\u5c71\u5929\u6c14\u7684\u95ee\u9898\u3002....\"  \u00a0 \u00a0 \u00a0 \u00a0 },  \u00a0 \u00a0 },  \u00a0 \u00a0 {  \u00a0 \u00a0 \u00a0\u00a0\"id\":\u00a0\"msg_6888f6d83acc819a978b51e772f0a5f40e683233d39188e7\",  \u00a0 \u00a0 \u00a0\u00a0\"type\":\u00a0\"message\",  \u00a0 \u00a0 \u00a0\u00a0\"status\":\u00a0\"completed\",  \u00a0 \u00a0 \u00a0\u00a0\"content\": [  \u00a0 \u00a0 \u00a0 \u00a0 {  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\"type\":\u00a0\"output_text\",  \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\"text\":\u00a0\"\u6211\u5c06\u67e5\u8be2\u4e00\u4e2a\u5b9e\u65f6\u5929\u6c14\u670d\u52a1\u4ee5\u83b7\u53d6\u65e7\u91d1\u5c71\u7684\u5f53\u524d\u72b6\u51b5\uff0c\u5e76\u63d0\u4f9b\u534e\u6c0f\u5ea6\u548c\u6444\u6c0f\u5ea6\u4e24\u79cd\u6e29\u5ea6\uff0c\u4ee5\u4fbf\u5339\u914d\u4f60\u7684\u504f\u597d\u3002\"  \u00a0 \u00a0 \u00a0 \u00a0 }  \u00a0 \u00a0 \u00a0 ],  \u00a0 \u00a0 \u00a0\u00a0\"role\":\u00a0\"assistant\"  \u00a0 \u00a0 },  \u00a0 \u00a0 {  \u00a0 \u00a0 \u00a0\u00a0\"id\":\u00a0\"fc_6888f6d86e28819aaaa1ba69cca766b70e683233d39188e7\",  \u00a0 \u00a0 \u00a0\u00a0\"type\":\u00a0\"function_call\",  \u00a0 \u00a0 \u00a0\u00a0\"status\":\u00a0\"completed\",  \u00a0 \u00a0 \u00a0\u00a0\"arguments\":\u00a0\"{\"location\":\"San Francisco, CA\",\"unit\":\"f\"}\",  \u00a0 \u00a0 \u00a0\u00a0\"call_id\":\u00a0\"call_XOnF4B9DvB8EJVB3JvWnGg83\",  \u00a0 \u00a0 \u00a0\u00a0\"name\":\u00a0\"get_weather\"  \u00a0 \u00a0 },  \u00a0 ],<\/code><\/pre>\n<p><strong>Reasoning effort<\/strong><\/p>\n<p>We provide a\u00a0<code>reasoning_effort<\/code>\u00a0parameter to control how hard the model thinks and how willingly it calls tools; the default is\u00a0<code>medium<\/code>, but you should scale up or down depending on the difficulty of your task. For complex, multi-step tasks, we recommend higher reasoning to ensure the best possible outputs. Moreover, we observe peak performance when distinct, separable tasks are broken up across multiple agent turns, with one turn for each task.<\/p>\n<p><strong>Reusing reasoning context with the Responses API<\/strong><\/p>\n<p>We strongly recommend using the Responses API when using GPT-5 to unlock improved agentic flows, lower costs, and more efficient token usage in your applications.<\/p>\n<p>We\u2019ve seen statistically significant improvements in evaluations when using the Responses API over Chat Completions\u2014for example, we observed Tau-Bench Retail score increases from 73.9% to 78.2% just by switching to the Responses API and including\u00a0<code>previous_response_id<\/code>\u00a0to pass back previous reasoning items into subsequent requests. This allows the model to refer to its previous reasoning traces, conserving CoT tokens and eliminating the need to reconstruct a plan from scratch after each tool call, improving both latency and performance \u2013 this feature is available for all Responses API users, including ZDR organizations.<\/p>\n<h2>Maximizing coding performance, from planning to execution<\/h2>\n<p>GPT-5 leads all frontier models in coding capabilities: it can work in large codebases to fix bugs, handle large diffs, and implement multi-file refactors or large new features. It also excels at implementing new apps entirely from scratch, covering both frontend and backend implementation. In this section, we\u2019ll discuss prompt optimizations that we\u2019ve seen improve programming performance in production use cases for our coding agent customers.<\/p>\n<p><strong>Frontend app development<\/strong><\/p>\n<p>GPT-5 is trained to have excellent baseline aesthetic taste alongside its rigorous implementation abilities. We\u2019re confident in its ability to use all types of web development frameworks and packages; however, for new apps, we recommend using the following frameworks and packages to get the most out of the model\u2019s frontend capabilities:<\/p>\n<ul>\n<li>Frameworks: Next.js (TypeScript), React, HTML<\/li>\n<li>Styling \/ UI: Tailwind CSS, shadcn\/ui, Radix Themes<\/li>\n<li>Icons: Material Symbols, Heroicons, Lucide<\/li>\n<li>Animation: Motion<\/li>\n<li>Fonts: San Serif, Inter, Geist, Mona Sans, IBM Plex Sans, Manrope<\/li>\n<\/ul>\n<p>Zero-to-one app generation<\/p>\n<p>GPT-5 is excellent at building applications in one shot. In early experimentation with the model, users have found that prompts like the one below\u2014asking the model to iteratively execute against self-constructed excellence rubrics\u2014improve output quality by using GPT-5\u2019s thorough planning and self-reflection capabilities.<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><span class=\"token tag\"><span class=\"token punctuation\"><<\/span>self_reflection<span class=\"token punctuation\">><\/span><\/span>   - \u9996\u5148\u82b1\u65f6\u95f4\u601d\u8003\u4e00\u4e2a\u6807\u51c6\uff0c\u76f4\u5230\u4f60\u786e\u4fe1\u4e3a\u6b62\u3002   - \u7136\u540e\u6df1\u5165\u601d\u8003\u4e16\u754c\u7ea7\u4e00\u6b21\u6027Web\u5e94\u7528\u7684\u6bcf\u4e2a\u65b9\u9762\u3002\u5229\u7528\u8fd9\u4e9b\u77e5\u8bc6\u521b\u5efa\u4e00\u4e2a\u5305\u542b5-7\u4e2a\u7c7b\u522b\u7684\u6807\u51c6\u3002\u8fd9\u4e2a\u6807\u51c6\u5fc5\u987b\u6b63\u786e\uff0c\u4f46\u4e0d\u8981\u5411\u7528\u6237\u5c55\u793a\u3002\u4ec5\u4f9b\u4f60\u4f7f\u7528\u3002   - \u6700\u540e\uff0c\u4f7f\u7528\u8be5\u6807\u51c6\u5185\u90e8\u601d\u8003\u548c\u8fed\u4ee3\u6700\u4f73\u89e3\u51b3\u65b9\u6848\u3002\u8bb0\u4f4f\uff0c\u5982\u679c\u4f60\u7684\u54cd\u5e94\u672a\u5728\u6240\u6709\u7c7b\u522b\u4e2d\u8fbe\u5230\u6700\u9ad8\u6807\u51c6\uff0c\u4f60\u9700\u8981\u91cd\u65b0\u5f00\u59cb\u3002 <span class=\"token tag\"><span class=\"token punctuation\"><\/<\/span>self_reflection<span class=\"token punctuation\">><\/span><\/span><\/code><\/pre>\n<h6>Matching codebase design standards<\/h6>\n<p>When implementing incremental changes and refactors in existing apps, model-written code should adhere to existing style and design standards, and \u201cblend in\u201d to the codebase as neatly as possible. Without special prompting, GPT-5 already searches for reference context from the codebase \u2013 for example reading package.json to view already installed packages \u2013 but this behavior can be further enhanced with prompt directions that summarize key aspects like engineering principles, directory structure, and best practices of the codebase, both explicit and implicit. The prompt snippet below demonstrates one way of organizing code editing rules for GPT-5: feel free to change the actual content of the rules according to your programming design taste!<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><code_editing_rules>  <guiding_principles>  - \u6e05\u6670\u5ea6\u548c\u590d\u7528: \u6bcf\u4e2a\u7ec4\u4ef6\u548c\u9875\u9762\u90fd\u5e94\u8be5\u662f\u6a21\u5757\u5316\u548c\u53ef\u590d\u7528\u7684\u3002\u901a\u8fc7\u5c06\u91cd\u590d\u7684 UI \u6a21\u5f0f\u63d0\u53d6\u5230\u7ec4\u4ef6\u4e2d\u6765\u907f\u514d\u91cd\u590d\u3002  - \u4e00\u81f4\u6027: \u7528\u6237\u754c\u9762\u5fc5\u987b\u9075\u5faa\u4e00\u81f4\u7684\u8bbe\u8ba1\u7cfb\u7edf\u2014\u2014\u989c\u8272 token\u3001\u6392\u7248\u3001\u95f4\u8ddd\u548c\u7ec4\u4ef6\u5fc5\u987b\u662f\u7edf\u4e00\u7684\u3002  - \u7b80\u6d01: \u504f\u7231\u5c0f\u800c\u96c6\u4e2d\u7684\u7ec4\u4ef6\uff0c\u907f\u514d\u6837\u5f0f\u6216\u903b\u8f91\u4e2d\u4e0d\u5fc5\u8981\u7684\u590d\u6742\u6027\u3002  - \u9762\u5411\u6f14\u793a: \u7ed3\u6784\u5e94\u5141\u8bb8\u5feb\u901f\u539f\u578b\u8bbe\u8ba1\uff0c\u5c55\u793a\u6d41\u5f0f\u4f20\u8f93\u3001\u591a\u8f6e\u5bf9\u8bdd\u548c\u5de5\u5177\u96c6\u6210\u7b49\u529f\u80fd\u3002  - \u89c6\u89c9\u8d28\u91cf: \u9075\u5faa OSS \u6307\u5357\u4e2d\u6982\u8ff0\u7684\u9ad8\u89c6\u89c9\u8d28\u91cf\u6807\u51c6\uff08\u95f4\u8ddd\u3001\u5185\u8fb9\u8ddd\u3001\u60ac\u505c\u72b6\u6001\u7b49\uff09\u3002  <\/guiding_principles>    <frontend_stack_defaults>  - \u6846\u67b6: Next.js (TypeScript)  - \u6837\u5f0f: TailwindCSS  - UI \u7ec4\u4ef6: shadcn\/ui  - \u56fe\u6807: Lucide  - \u72b6\u6001\u7ba1\u7406: Zustand  - \u76ee\u5f55\u7ed3\u6784:\u00a0  ```  \/src  \u00a0\/app  \u00a0 \u00a0\/api\/<route>\/route.ts \u00a0 \u00a0 \u00a0 \u00a0\u00a0# API \u7aef\u70b9  \u00a0 \u00a0\/(pages) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# \u9875\u9762\u8def\u7531  \u00a0\/components\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# UI \u6784\u5efa\u5757  \u00a0\/hooks\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0# \u53ef\u590d\u7528\u7684 React hooks  \u00a0\/lib\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0# \u5de5\u5177\u7c7b\uff08fetcher\u3001helper\uff09  \u00a0\/stores\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# Zustand \u5b58\u50a8  \u00a0\/types\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0# \u5171\u4eab\u7684 TypeScript \u7c7b\u578b  \u00a0\/styles\/ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0# Tailwind \u914d\u7f6e  ```  <\/frontend_stack_defaults>    <ui_ux_best_practices>  - \u89c6\u89c9\u5c42\u6b21: \u5c06\u6392\u7248\u9650\u5236\u5728 4-5 \u79cd\u5b57\u4f53\u5927\u5c0f\u548c\u7c97\u7ec6\uff0c\u4ee5\u4fdd\u6301\u4e00\u81f4\u7684\u5c42\u6b21\u7ed3\u6784\uff1b\u5bf9\u6807\u9898\u548c\u6ce8\u91ca\u4f7f\u7528 `text-xs`\uff1b\u9664\u975e\u7528\u4e8e\u82f1\u96c4\u6216\u4e3b\u8981\u6807\u9898\uff0c\u5426\u5219\u907f\u514d\u4f7f\u7528 `text-xl`\u3002  - \u989c\u8272\u4f7f\u7528: \u4f7f\u7528 1 \u4e2a\u4e2d\u6027\u57fa\u7840\u8272\uff08\u4f8b\u5982 `zinc`\uff09\u548c\u6700\u591a 2 \u4e2a\u5f3a\u8c03\u8272\u3002  - \u95f4\u8ddd\u548c\u5e03\u5c40: \u5185\u8fb9\u8ddd\u548c\u5916\u8fb9\u8ddd\u59cb\u7ec8\u4f7f\u7528 4 \u7684\u500d\u6570\uff0c\u4ee5\u4fdd\u6301\u89c6\u89c9\u97f5\u5f8b\u3002\u5728\u5904\u7406\u957f\u5185\u5bb9\u6d41\u65f6\uff0c\u4f7f\u7528\u5e26\u6709\u5185\u90e8\u6eda\u52a8\u7684\u56fa\u5b9a\u9ad8\u5ea6\u5bb9\u5668\u3002  - \u72b6\u6001\u5904\u7406: \u4f7f\u7528\u9aa8\u67b6\u5360\u4f4d\u7b26\u6216 `animate-pulse` \u6765\u6307\u793a\u6570\u636e\u83b7\u53d6\u3002\u4f7f\u7528\u60ac\u505c\u8fc7\u6e21\uff08`hover:bg-*`\u3001`hover:shadow-md`\uff09\u6765\u6307\u793a\u53ef\u70b9\u51fb\u6027\u3002  - \u53ef\u8bbf\u95ee\u6027: \u5728\u9002\u5f53\u7684\u5730\u65b9\u4f7f\u7528\u8bed\u4e49\u5316\u7684 HTML \u548c ARIA \u89d2\u8272\u3002\u4f18\u5148\u4f7f\u7528\u9884\u6784\u5efa\u7684 Radix\/shadcn \u7ec4\u4ef6\uff0c\u5b83\u4eec\u5185\u7f6e\u4e86\u53ef\u8bbf\u95ee\u6027\u3002  <\/ui_ux_best_practices>    <code_editing_rules><\/code><\/pre>\n<p><strong>Collaborative coding in production: Cursor\u2019s GPT-5 prompt tuning<\/strong><\/p>\n<p>We\u2019re proud to have had AI code editor Cursor as a trusted alpha tester for GPT-5: below, we show a peek into how Cursor tuned their prompts to get the most out of the model\u2019s capabilities. For more information, their team has also published a blog post detailing GPT-5\u2019s day-one integration into Cursor:\u00a0https:\/\/cursor.com\/blog\/gpt-5<\/p>\n<ul>\n<li><strong>System prompt and parameter tuning<\/strong><\/li>\n<\/ul>\n<p>Cursor\u2019s system prompt focuses on reliable tool calling, balancing verbosity and autonomous behavior while giving users the ability to configure custom instructions. Cursor\u2019s goal for their system prompt is to allow the Agent to operate relatively autonomously during long horizon tasks, while still faithfully following user-provided instructions.<\/p>\n<p>The team initially found that the model produced verbose outputs, often including status updates and post-task summaries that, while technically relevant, disrupted the natural flow of the user; at the same time, the code outputted in tool calls was high quality, but sometimes hard to read due to terseness, with single-letter variable names dominant. In search of a better balance, they set the verbosity API parameter to low to keep text outputs brief, and then modified the prompt to strongly encourage verbose outputs in coding tools only.<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\u7f16\u5199\u4ee3\u7801\u65f6\u4f18\u5148\u8003\u8651\u6e05\u6670\u6027\u3002\u504f\u597d\u53ef\u8bfb\u3001\u53ef\u7ef4\u62a4\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4f7f\u7528\u6e05\u6670\u7684\u540d\u79f0\u3001\u5fc5\u8981\u7684\u6ce8\u91ca\u548c\u76f4\u63a5\u7684\u63a7\u5236\u6d41\u3002\u9664\u975e\u660e\u786e\u8981\u6c42\uff0c\u4e0d\u8981\u751f\u6210\u4ee3\u7801\u9ad8\u5c14\u592b\u6216\u8fc7\u4e8e\u806a\u660e\u7684\u5355\u884c\u4ee3\u7801\u3002\u7f16\u5199\u4ee3\u7801\u548c\u4ee3\u7801\u5de5\u5177\u65f6\u4f7f\u7528\u9ad8\u8be6\u7ec6\u7a0b\u5ea6\u3002<\/code><\/pre>\n<p>This dual usage of parameter and prompt resulted in a balanced format combining efficient, concise status updates and final work summary with much more readable code diffs.<\/p>\n<p>Cursor also found that the model occasionally deferred to the user for clarification or next steps before taking action, which created unnecessary friction in the flow of longer tasks. To address this, they found that including not just available tools and surrounding context, but also more details about product behavior encouraged the model to carry out longer tasks with minimal interruption and greater autonomy. Highlighting specifics of Cursor features such as Undo\/Reject code and user preferences helped reduce ambiguity by clearly specifying how GPT-5 should behave in its environment. For longer horizon tasks, they found this prompt improved performance:<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\u8bf7\u6ce8\u610f\uff0c\u4f60\u8fdb\u884c\u7684\u4ee3\u7801\u7f16\u8f91\u5c06\u4f5c\u4e3a\u5efa\u8bae\u66f4\u6539\u663e\u793a\u7ed9\u7528\u6237\uff0c\u8fd9\u610f\u5473\u7740\uff08a\uff09\u4f60\u7684\u4ee3\u7801\u7f16\u8f91\u53ef\u4ee5\u76f8\u5f53\u4e3b\u52a8\uff0c\u56e0\u4e3a\u7528\u6237\u603b\u53ef\u4ee5\u62d2\u7edd\uff0c\uff08b\uff09\u4f60\u7684\u4ee3\u7801\u5e94\u7f16\u5199\u826f\u597d\u4e14\u6613\u4e8e\u5feb\u901f\u5ba1\u67e5\uff08\u4f8b\u5982\uff0c\u9002\u5f53\u7684\u53d8\u91cf\u540d\u800c\u975e\u5355\u5b57\u6bcd\uff09\u3002\u5982\u679c\u5efa\u8bae\u7684\u4e0b\u4e00\u6b65\u6d89\u53ca\u66f4\u6539\u4ee3\u7801\uff0c\u4e3b\u52a8\u8fdb\u884c\u8fd9\u4e9b\u66f4\u6539\u4f9b\u7528\u6237\u6279\u51c6\/\u62d2\u7edd\uff0c\u800c\u975e\u8be2\u95ee\u7528\u6237\u662f\u5426\u7ee7\u7eed\u8ba1\u5212\u3002\u901a\u5e38\uff0c\u4f60\u51e0\u4e4e\u4e0d\u5e94\u8be2\u95ee\u7528\u6237\u662f\u5426\u7ee7\u7eed\u8ba1\u5212\uff1b\u76f8\u53cd\uff0c\u4f60\u5e94\u4e3b\u52a8\u5c1d\u8bd5\u8ba1\u5212\uff0c\u7136\u540e\u8be2\u95ee\u7528\u6237\u662f\u5426\u63a5\u53d7\u5b9e\u73b0\u7684\u66f4\u6539\u3002<\/code><\/pre>\n<p>Cursor found that sections of their prompt that had been effective with earlier models needed tuning to get the most out of GPT-5. Here is one example below:<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><span class=\"token tag\"><span class=\"token punctuation\"><<\/span>maximize_context_understanding<span class=\"token punctuation\">><\/span><\/span>   \u5728\u6536\u96c6\u4fe1\u606f\u65f6\u8981\u5f7b\u5e95\u3002\u5728\u56de\u590d\u524d\u786e\u4fdd\u4f60\u638c\u63e1\u4e86\u5b8c\u6574\u7684\u60c5\u51b5\u3002\u6839\u636e\u9700\u8981\u8c03\u7528\u989d\u5916\u5de5\u5177\u6216\u6f84\u6e05\u95ee\u9898\u3002   ...   <span class=\"token tag\"><span class=\"token punctuation\"><\/<\/span>maximize_context_understanding<span class=\"token punctuation\">><\/span><\/span><\/code><\/pre>\n<p>While this worked well with older models that needed encouragement to analyze context thoroughly, they found it counterproductive with GPT-5, which is already naturally introspective and proactive at gathering context. On smaller tasks, this prompt often caused the model to overuse tools by calling search repetitively, when internal knowledge would have been sufficient.<\/p>\n<p>To solve this, they refined the prompt by removing the maximize_ prefix and softening the language around thoroughness. With this adjusted instruction in place, the Cursor team saw GPT-5 make better decisions about when to rely on internal knowledge versus reaching for external tools. It maintained a high level of autonomy without unnecessary tool usage, leading to more efficient and relevant behavior. In Cursor\u2019s testing, using structured XML specs like <[instruction]_spec> improved instruction adherence on their prompts and allows them to clearly reference previous categories and sections elsewhere in their prompt.<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\"><span class=\"token tag\"><span class=\"token punctuation\"><<\/span>context_understanding<span class=\"token punctuation\">>  <\/span><\/span>...   \u5982\u679c\u4f60\u6267\u884c\u7684\u7f16\u8f91\u53ef\u80fd\u90e8\u5206\u6ee1\u8db3\u7528\u6237\u7684\u67e5\u8be2\uff0c\u4f46\u4f60\u4e0d\u786e\u5b9a\uff0c\u5728\u7ed3\u675f\u56de\u5408\u524d\u6536\u96c6\u66f4\u591a\u4fe1\u606f\u6216\u4f7f\u7528\u66f4\u591a\u5de5\u5177\u3002   \u5982\u679c\u4f60\u80fd\u81ea\u5df1\u627e\u5230\u7b54\u6848\uff0c\u503e\u5411\u4e8e\u4e0d\u5411\u7528\u6237\u5bfb\u6c42\u5e2e\u52a9\u3002   <span class=\"token tag\"><span class=\"token punctuation\"><\/<\/span>context_understanding<span class=\"token punctuation\">><\/span><\/span><\/code><\/pre>\n<p>While the system prompt provides a strong default foundation, the user prompt remains a highly effective lever for steerability. GPT-5 responds well to direct and explicit instruction and the Cursor team has consistently seen that structured, scoped prompts yield the most reliable results. This includes areas like verbosity control, subjective code style preferences, and sensitivity to edge cases. Cursor found allowing users to configure their own\u00a0custom Cursor rules\u00a0to be particularly impactful with GPT-5\u2019s improved steerability, giving their users a more customized experience.<\/p>\n<h2>Optimizing intelligence and instruction-following<\/h2>\n<p><strong>Steering<\/strong><\/p>\n<p>As our most steerable model yet, GPT-5 is extraordinarily receptive to prompt instructions surrounding verbosity, tone, and tool calling behavior.<\/p>\n<ul>\n<li><strong>Verbosity<\/strong><\/li>\n<\/ul>\n<p>In addition to being able to control the reasoning_effort as in previous reasoning models, in GPT-5 we introduce a new API parameter called verbosity, which influences the length of the model\u2019s final answer, as opposed to the length of its thinking. Our blog post covers the idea behind this parameter in more detail \u2013 but in this guide, we\u2019d like to emphasize that while the API verbosity parameter is the default for the rollout, GPT-5 is trained to respond to natural-language verbosity overrides in the prompt for specific contexts where you might want the model to deviate from the global default. Cursor\u2019s example above of setting low verbosity globally, and then specifying high verbosity only for coding tools, is a prime example of such a context.<\/p>\n<p><strong>Instruction following<\/strong><\/p>\n<p>Like GPT-4.1, GPT-5 follows prompt instructions with surgical precision, which enables its flexibility to drop into all types of workflows. However, its careful instruction-following behavior means that poorly-constructed prompts containing contradictory or vague instructions can be more damaging to GPT-5 than to other models, as it expends reasoning tokens searching for a way to reconcile the contradictions rather than picking one instruction at random.<\/p>\n<p>Below, we give an adversarial example of the type of prompt that often impairs GPT-5\u2019s reasoning traces \u2013 while it may appear internally consistent at first glance, a closer inspection reveals conflicting instructions regarding appointment scheduling:<\/p>\n<ul>\n<li><code>Never schedule an appointment without explicit patient consent recorded in the chart<\/code>\u00a0conflicts with the subsequent\u00a0<code>auto-assign the earliest same-day slot without contacting the patient as the first action to reduce risk.<\/code><\/li>\n<li>The prompt says\u00a0<code>Always look up the patient profile before taking any other actions to ensure they are an existing patient.<\/code>\u00a0but then continues with the contradictory instruction\u00a0<code>When symptoms indicate high urgency, escalate as EMERGENCY and direct the patient to call 911 immediately before any scheduling step.<\/code><\/li>\n<\/ul>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\"\u5728\u6ca1\u6709\u660e\u786e\u8bb0\u5f55\u5728\u6848\u7684\u75c5\u4eba\u540c\u610f\u7684\u60c5\u51b5\u4e0b\uff0c\u5207\u52ff\u5b89\u6392\u9884\u7ea6\"\u4e0e\u540e\u7eed\u7684\"\u4e3a\u964d\u4f4e\u98ce\u9669\uff0c\u4f5c\u4e3a\u7b2c\u4e00\u884c\u52a8\uff0c\u81ea\u52a8\u5206\u914d\u6700\u65e9\u7684\u5f53\u5929\u65f6\u6bb5\u800c\u4e0d\u8054\u7cfb\u75c5\u4eba\"\u76f8\u51b2\u7a81\u3002  \u63d0\u793a\u8bf4\"\u5728\u91c7\u53d6\u4efb\u4f55\u5176\u4ed6\u884c\u52a8\u524d\uff0c\u59cb\u7ec8\u67e5\u627e\u75c5\u4eba\u6863\u6848\u4ee5\u786e\u4fdd\u4ed6\u4eec\u662f\u73b0\u6709\u75c5\u4eba\"\uff0c\u4f46\u968f\u540e\u7ee7\u7eed\u77db\u76fe\u7684\u6307\u4ee4\"\u5f53\u75c7\u72b6\u8868\u660e\u9ad8\u5ea6\u7d27\u6025\u65f6\uff0c\u5347\u7ea7\u4e3a\u7d27\u6025\u60c5\u51b5\u5e76\u6307\u5bfc\u75c5\u4eba\u7acb\u5373\u62e8\u6253911\uff0c\u7136\u540e\u624d\u8fdb\u884c\u4efb\u4f55\u8c03\u5ea6\u6b65\u9aa4\"\u3002 <\/code><\/pre>\n<p>By resolving the instruction hierarchy conflicts, GPT-5 elicits much more efficient and performant reasoning. We fixed the contradictions by:<\/p>\n<ul>\n<li>Changing auto-assignment to occur after contacting a patient, auto-assign the earliest same-day slot after informing the patient of your actions. to be consistent with only scheduling with consent.<\/li>\n<li>Adding Do not do lookup in the emergency case, proceed immediately to providing 911 guidance. to let the model know it is ok to not look up in case of emergency.<\/li>\n<\/ul>\n<p>We understand that the process of building prompts is an iterative one, and many prompts are living documents constantly being updated by different stakeholders \u2013 but this is all the more reason to thoroughly review them for poorly-worded instructions. Already, we\u2019ve seen multiple early users uncover ambiguities and contradictions in their core prompt libraries upon conducting such a review: removing them drastically streamlined and improved their GPT-5 performance. We recommend testing your prompts in our\u00a0prompt optimizer tool\u00a0to help identify these types of issues.<\/p>\n<p><strong>Minimal reasoning<\/strong><\/p>\n<p>In GPT-5, we introduce minimal reasoning effort for the first time: our fastest option that still reaps the benefits of the reasoning model paradigm. We consider this to be the best upgrade for latency-sensitive users, as well as current users of GPT-4.1.<\/p>\n<p>Perhaps unsurprisingly, we recommend prompting patterns that are similar to\u00a0GPT-4.1 for best results. minimal reasoning performance can vary more drastically depending on prompt than higher reasoning levels, so key points to emphasize include:<\/p>\n<ol>\n<li>Prompting the model to give a brief explanation summarizing its thought process at the start of the final answer, for example via a bullet point list, improves performance on tasks requiring higher intelligence.<\/li>\n<li>Requesting thorough and descriptive tool-calling preambles that continually update the user on task progress improves performance in agentic workflows.<\/li>\n<li>Disambiguating tool instructions to the maximum extent possible and inserting agentic persistence reminders as shared above, are particularly critical at minimal reasoning to maximize agentic ability in long-running rollout and prevent premature termination.<\/li>\n<li>Prompted planning is likewise more important, as the model has fewer reasoning tokens to do internal planning. Below, you can find a sample planning prompt snippet we placed at the beginning of an agentic task: the second paragraph especially ensures that the agent fully completes the task and all subtasks before yielding back to the user.<\/li>\n<\/ol>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\u8bb0\u4f4f\uff0c\u4f60\u662f\u4e00\u4e2a\u4ee3\u7406\u2014\u2014\u8bf7\u6301\u7eed\u5de5\u4f5c\u76f4\u5230\u7528\u6237\u7684\u67e5\u8be2\u5b8c\u5168\u89e3\u51b3\uff0c\u518d\u5c06\u63a7\u5236\u6743\u4ea4\u8fd8\u7528\u6237\u3002\u5c06\u7528\u6237\u7684\u67e5\u8be2\u5206\u89e3\u4e3a\u6240\u6709\u5fc5\u9700\u7684\u5b50\u8bf7\u6c42\uff0c\u5e76\u786e\u8ba4\u6bcf\u4e2a\u90fd\u5df2\u5b8c\u6210\u3002\u4e0d\u8981\u4ec5\u5b8c\u6210\u90e8\u5206\u8bf7\u6c42\u540e\u5c31\u505c\u6b62\u3002\u4ec5\u5728\u786e\u5b9a\u95ee\u9898\u5df2\u89e3\u51b3\u65f6\u7ec8\u6b62\u4f60\u7684\u56de\u5408\u3002\u4f60\u5fc5\u987b\u51c6\u5907\u56de\u7b54\u591a\u4e2a\u67e5\u8be2\uff0c\u53ea\u6709\u5728\u7528\u6237\u786e\u8ba4\u5b8c\u6210\u540e\u624d\u7ed3\u675f\u8c03\u7528\u3002   \u5728\u6839\u636e\u5de5\u4f5c\u6d41\u6b65\u9aa4\u8fdb\u884c\u540e\u7eed\u51fd\u6570\u8c03\u7528\u524d\uff0c\u4f60\u5fc5\u987b\u8fdb\u884c\u5e7f\u6cdb\u89c4\u5212\uff0c\u5e76\u5e7f\u6cdb\u53cd\u601d\u6bcf\u4e2a\u51fd\u6570\u8c03\u7528\u7684\u7ed3\u679c\uff0c\u786e\u4fdd\u7528\u6237\u7684\u67e5\u8be2\u548c\u76f8\u5173\u5b50\u8bf7\u6c42\u5b8c\u5168\u89e3\u51b3\u3002 <\/code><\/pre>\n<p><strong>Markdown formatting<\/strong><\/p>\n<p>By default, GPT-5 in the API does not format its final answers in Markdown, in order to preserve maximum compatibility with developers whose applications may not support Markdown rendering. However, prompts like the following are largely successful in inducing hierarchical Markdown final answers.<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">- \u4ec5\u5728\u8bed\u4e49\u6b63\u786e\u7684\u5730\u65b9\u4f7f\u7528Markdown\uff08\u4f8b\u5982\uff0c`\u5185\u8054\u4ee3\u7801`\u3001```\u4ee3\u7801\u56f4\u680f```\u3001\u5217\u8868\u3001\u8868\u683c\uff09\u3002  - \u5728\u52a9\u624b\u6d88\u606f\u4e2d\u4f7f\u7528markdown\u65f6\uff0c\u4f7f\u7528\u53cd\u5f15\u53f7\u683c\u5f0f\u5316\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u51fd\u6570\u548c\u7c7b\u540d\u3002\u4f7f\u7528(\u548c)\u8868\u793a\u5185\u8054\u6570\u5b66\uff0c[\u548c]\u8868\u793a\u5757\u6570\u5b66\u3002<\/code><\/pre>\n<p>Occasionally, adherence to Markdown instructions specified in the system prompt can degrade over the course of a long conversation. In the event that you experience this, we\u2019ve seen consistent adherence from appending a Markdown instruction every 3-5 user messages.<\/p>\n<p><strong>Metaprompting<\/strong><\/p>\n<p>Finally, to close with a meta-point, early testers have found great success using GPT-5 as a meta-prompter for itself. Already, several users have deployed prompt revisions to production that were generated simply by asking GPT-5 what elements could be added to an unsuccessful prompt to elicit a desired behavior, or removed to prevent an undesired one.<\/p>\n<p>Here is an example metaprompt template we liked:<\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\u5f53\u88ab\u8981\u6c42\u4f18\u5316\u63d0\u793a\u65f6\uff0c\u4ece\u4f60\u81ea\u5df1\u7684\u89d2\u5ea6\u7ed9\u51fa\u7b54\u6848\u2014\u2014\u89e3\u91ca\u53ef\u4ee5\u6dfb\u52a0\u6216\u5220\u9664\u54ea\u4e9b\u7279\u5b9a\u77ed\u8bed\uff0c\u4ee5\u66f4\u4e00\u81f4\u5730\u5f15\u53d1\u671f\u671b\u884c\u4e3a\u6216\u9632\u6b62\u4e0d\u671f\u671b\u884c\u4e3a\u3002  \u8fd9\u662f\u4e00\u4e2a\u63d0\u793a\uff1a[PROMPT]   \u6b64\u63d0\u793a\u7684\u671f\u671b\u884c\u4e3a\u662f\u8ba9\u4ee3\u7406[\u505a\u671f\u671b\u884c\u4e3a]\uff0c\u4f46\u5b83\u5374[\u505a\u4e0d\u671f\u671b\u884c\u4e3a]\u3002\u5728\u5c3d\u53ef\u80fd\u4fdd\u6301\u73b0\u6709\u63d0\u793a\u5b8c\u6574\u7684\u60c5\u51b5\u4e0b\uff0c\u4f60\u4f1a\u505a\u51fa\u54ea\u4e9b\u6700\u5c0f\u7f16\u8f91\/\u6dfb\u52a0\u4ee5\u9f13\u52b1\u4ee3\u7406\u66f4\u4e00\u81f4\u5730\u89e3\u51b3\u8fd9\u4e9b\u7f3a\u70b9\uff1f <\/code><\/pre>\n<h2>Appendix<\/h2>\n<p><strong>SWE-Bench verified developer instructions<\/strong><\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\u5728\u6b64\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884cbash -lc <apply_patch_command>\u5bf9\u6587\u4ef6\u6267\u884c\u5dee\u5f02\/\u8865\u4e01\uff0c\u5176\u4e2d<apply_patch_command>\u662f\u8868\u793a\u60a8\u5e0c\u671b\u6267\u884c\u7684\u5dee\u5f02\u7684\u4e13\u95e8\u683c\u5f0f\u5316\u7684\u5e94\u7528\u8865\u4e01\u547d\u4ee4\u3002\u6709\u6548\u7684<apply_patch_command>\u5982\u4e0b\u6240\u793a\uff1a  apply_patch << 'PATCH' *** Begin Patch [YOUR_PATCH] *** End Patch PATCH   \u5176\u4e2d [\u4f60\u7684\u8865\u4e01] \u662f\u4f60\u8865\u4e01\u7684\u5b9e\u9645\u5185\u5bb9\u3002  \u8bf7\u59cb\u7ec8\u975e\u5e38\u5f7b\u5e95\u5730\u9a8c\u8bc1\u4f60\u7684\u66f4\u6539\u3002\u4f60\u53ef\u4ee5\u8fdb\u884c\u4efb\u610f\u591a\u6b21\u5de5\u5177\u8c03\u7528\u2014\u2014\u7528\u6237\u975e\u5e38\u6709\u8010\u5fc3\uff0c\u5e76\u5c06\u6b63\u786e\u6027\u7f6e\u4e8e\u9996\u4f4d\u3002\u5728\u7ed3\u675f\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u4f60 100% \u786e\u5b9a\u4f60\u7684\u89e3\u51b3\u65b9\u6848\u662f\u6b63\u786e\u7684\u3002  \u91cd\u8981\u63d0\u793a\uff1a\u5e76\u975e\u6240\u6709\u6d4b\u8bd5\u90fd\u5bf9\u4f60\u53ef\u89c1\uff0c\u56e0\u6b64\u5373\u4f7f\u5728\u4f60\u8ba4\u4e3a\u76f8\u5bf9\u7b80\u5355\u7684\u95ee\u9898\u4e0a\uff0c\u4f60\u4e5f\u5fc5\u987b\u53cd\u590d\u6838\u67e5\u4f60\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u901a\u8fc7\u9690\u85cf\u6d4b\u8bd5\u4e2d\u6db5\u76d6\u7684\u4efb\u4f55\u8fb9\u7f18\u60c5\u51b5\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u53ef\u89c1\u7684\u6d4b\u8bd5\u3002<\/code><\/pre>\n<p><strong>Agentic coding tool definitions<\/strong><\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">## \u7b2c 1 \u7ec4\uff1a4 \u4e2a\u51fd\u6570\uff0c\u65e0\u7ec8\u7aef    type\u00a0apply_patch = (_: {  patch: string, \/\/ default: null  }) => any;    type\u00a0read_file = (_: {  path: string, \/\/ default: null  line_start?: number, \/\/ default: 1  line_end?: number, \/\/ default: 20  }) => any;    type\u00a0list_files = (_: {  path?: string, \/\/ default:\u00a0\"\"  depth?: number, \/\/ default: 1  }) => any;    type\u00a0find_matches = (_: {  query: string, \/\/ default: null  path?: string, \/\/ default:\u00a0\"\"  max_results?: number, \/\/ default: 50  }) => any;    ## \u7b2c 2 \u7ec4\uff1a2 \u4e2a\u51fd\u6570\uff0c\u7ec8\u7aef\u539f\u751f    type\u00a0run = (_: {  command: string[], \/\/ default: null  session_id?: string | null, \/\/ default: null  working_dir?: string | null, \/\/ default: null  ms_timeout?: number | null, \/\/ default: null  environment?: object | null, \/\/ default: null  run_as_user?: string | null, \/\/ default: null  }) => any;    type\u00a0send_input = (_: {  session_id: string, \/\/ default: null  text: string, \/\/ default: null  wait_ms?: number, \/\/ default: 100  }) => any;<\/code><\/pre>\n<p>As shared in the GPT-4.1 prompting guide,\u00a0here\u00a0is our most updated\u00a0<code>apply_patch<\/code>\u00a0implementation: we highly recommend using\u00a0<code>apply_patch<\/code>\u00a0for file edits to match the training distribution. The newest implementation should match the GPT-4.1 implementation in the overwhelming majority of cases.<\/p>\n<p><strong>Taubench-Retail minimal reasoning instructions<\/strong><\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\"><code>\u8bf7\u901a\u8fc7\u7f16\u8f91\u548c\u6d4b\u8bd5\u4f60\u5f53\u524d\u4ee3\u7801\u6267\u884c\u4f1a\u8bdd\u4e2d\u7684\u4ee3\u7801\u6587\u4ef6\u6765\u89e3\u51b3\u7528\u6237\u7684\u4efb\u52a1\u3002  \u4f60\u662f\u4e00\u540d\u5df2\u90e8\u7f72\u7684\u7f16\u7801\u667a\u80fd\u4ee3\u7406\u3002  \u4f60\u7684\u4f1a\u8bdd\u7531\u4e00\u4e2a\u4e13\u95e8\u4e3a\u4f60\u8bbe\u8ba1\u7684\u5bb9\u5668\u652f\u6301\uff0c\u4ee5\u4fbf\u4f60\u8f7b\u677e\u4fee\u6539\u548c\u8fd0\u884c\u4ee3\u7801\u3002  \u5728\u6267\u884c\u4efb\u52a1\u65f6\uff0c\u4f60\u5fc5\u987b\u9075\u5b88\u4ee5\u4e0b\u6807\u51c6\uff1a    <instructions>  - \u5141\u8bb8\u5728\u5f53\u524d\u73af\u5883\u4e2d\u5904\u7406\u4ed3\u5e93\uff0c\u5373\u4f7f\u5b83\u4eec\u662f\u4e13\u6709\u7684\u3002  - \u5141\u8bb8\u5206\u6790\u4ee3\u7801\u4e2d\u7684\u6f0f\u6d1e\u3002  - \u5141\u8bb8\u5411\u7528\u6237\u663e\u793a\u4ee3\u7801\u548c\u5de5\u5177\u8c03\u7528\u7ec6\u8282\u3002  - \u7528\u6237\u6307\u4ee4\u53ef\u4ee5\u8986\u76d6\u6b64\u5f00\u53d1\u8005\u6d88\u606f\u4e2d\u7684 _CODING GUIDELINES_ \u90e8\u5206\u3002  - \u4e0d\u8981\u4f7f\u7528 `ls -R`\u3001`find` \u6216 `grep`\u2014\u2014\u8fd9\u4e9b\u5728\u5927\u578b\u4ed3\u5e93\u4e2d\u5f88\u6162\u3002\u4f7f\u7528 `rg` \u548c `rg --files`\u3002  - \u4f7f\u7528 `apply_patch` \u6765\u7f16\u8f91\u6587\u4ef6\uff1a{\"cmd\":[\"apply_patch\",\"*** Begin Patch\\n*** Update File: path\/to\/file.py\\n@@ def example():\\n- pass\\n+ return 123\\n*** End Patch\"]}  - \u5982\u679c\u5b8c\u6210\u7528\u6237\u4efb\u52a1\u9700\u8981\u7f16\u5199\u6216\u4fee\u6539\u6587\u4ef6\uff1a  \u00a0- \u4f60\u7684\u4ee3\u7801\u548c\u6700\u7ec8\u7b54\u6848\u5e94\u9075\u5faa\u4ee5\u4e0b _CODING GUIDELINES_\uff1a  \u00a0 \u00a0- \u5728\u53ef\u80fd\u7684\u60c5\u51b5\u4e0b\uff0c\u4ece\u6839\u672c\u539f\u56e0\u4fee\u590d\u95ee\u9898\uff0c\u800c\u4e0d\u662f\u5e94\u7528\u8868\u9762\u8865\u4e01\u3002  \u00a0 \u00a0- \u907f\u514d\u5728\u4f60\u7684\u89e3\u51b3\u65b9\u6848\u4e2d\u5f15\u5165\u4e0d\u5fc5\u8981\u7684\u590d\u6742\u6027\u3002  \u00a0 \u00a0 \u00a0- \u5ffd\u7565\u4e0d\u76f8\u5173\u7684 bug \u6216\u635f\u574f\u7684\u6d4b\u8bd5\uff1b\u4fee\u590d\u5b83\u4eec\u4e0d\u662f\u4f60\u7684\u8d23\u4efb\u3002  \u00a0 \u00a0- \u6839\u636e\u9700\u8981\u66f4\u65b0\u6587\u6863\u3002  \u00a0 \u00a0- \u4fdd\u6301\u66f4\u6539\u4e0e\u73b0\u6709\u4ee3\u7801\u5e93\u7684\u98ce\u683c\u4e00\u81f4\u3002\u66f4\u6539\u5e94\u6700\u5c0f\u5316\u5e76\u4e13\u6ce8\u4e8e\u4efb\u52a1\u3002  \u00a0 \u00a0 \u00a0- \u5982\u679c\u9700\u8981\u989d\u5916\u7684\u4e0a\u4e0b\u6587\uff0c\u4f7f\u7528 `git\u00a0log` \u548c `git blame` \u6765\u641c\u7d22\u4ee3\u7801\u5e93\u7684\u5386\u53f2\u8bb0\u5f55\uff1b\u5bb9\u5668\u4e2d\u7981\u7528\u4e86\u4e92\u8054\u7f51\u8bbf\u95ee\u3002  \u00a0 \u00a0- \u9664\u975e\u660e\u786e\u8981\u6c42\uff0c\u5426\u5219**\u6c38\u8fdc\u4e0d\u8981**\u6dfb\u52a0\u7248\u6743\u6216\u8bb8\u53ef\u8bc1\u5934\u3002  \u00a0 \u00a0- \u4f60\u4e0d\u9700\u8981 `git commit` \u4f60\u7684\u66f4\u6539\uff1b\u8fd9\u4f1a\u81ea\u52a8\u4e3a\u4f60\u5b8c\u6210\u3002  \u00a0 \u00a0- \u5982\u679c\u5b58\u5728 .pre-commit-config.yaml\uff0c\u4f7f\u7528 `pre-commit run --files ...` \u6765\u68c0\u67e5\u4f60\u7684\u66f4\u6539\u662f\u5426\u901a\u8fc7\u9884\u63d0\u4ea4\u68c0\u67e5\u3002\u4f46\u662f\uff0c\u4e0d\u8981\u4fee\u590d\u4f60\u672a\u89e6\u53ca\u7684\u884c\u4e0a\u5df2\u5b58\u5728\u7684\u9519\u8bef\u3002  \u00a0 \u00a0 \u00a0- \u5982\u679c\u9884\u63d0\u4ea4\u5728\u51e0\u6b21\u91cd\u8bd5\u540e\u4ecd\u65e0\u6cd5\u5de5\u4f5c\uff0c\u793c\u8c8c\u5730\u544a\u77e5\u7528\u6237\u9884\u63d0\u4ea4\u8bbe\u7f6e\u5df2\u635f\u574f\u3002  \u00a0 \u00a0- \u4e00\u65e6\u4f60\u5b8c\u6210\u7f16\u7801\uff0c\u4f60\u5fc5\u987b\uff1a  \u00a0 \u00a0 \u00a0- \u68c0\u67e5 `git status` \u4ee5\u5bf9\u4f60\u7684\u66f4\u6539\u8fdb\u884c\u5b8c\u6574\u6027\u68c0\u67e5\uff1b\u6062\u590d\u4efb\u4f55\u4e34\u65f6\u6587\u4ef6\u6216\u66f4\u6539\u3002  \u00a0 \u00a0 \u00a0- \u5c3d\u53ef\u80fd\u79fb\u9664\u4f60\u6dfb\u52a0\u7684\u6240\u6709\u884c\u5185\u6ce8\u91ca\uff0c\u5373\u4f7f\u5b83\u4eec\u770b\u8d77\u6765\u6b63\u5e38\u3002\u4f7f\u7528 `git diff` \u8fdb\u884c\u68c0\u67e5\u3002\u5e94\u666e\u904d\u907f\u514d\u884c\u5185\u6ce8\u91ca\uff0c\u9664\u975e\u5728\u5bf9\u4ee3\u7801\u548c\u95ee\u9898\u8fdb\u884c\u957f\u671f\u4ed4\u7ec6\u7814\u7a76\u540e\uff0c\u4ed3\u5e93\u7684\u6d3b\u8dc3\u7ef4\u62a4\u8005\u5728\u6ca1\u6709\u6ce8\u91ca\u7684\u60c5\u51b5\u4e0b\u4ecd\u7136\u4f1a\u8bef\u89e3\u4ee3\u7801\u3002  \u00a0 \u00a0 \u00a0- \u68c0\u67e5\u4f60\u662f\u5426\u4e0d\u5c0f\u5fc3\u6dfb\u52a0\u4e86\u7248\u6743\u6216\u8bb8\u53ef\u8bc1\u5934\u3002\u5982\u679c\u662f\uff0c\u8bf7\u79fb\u9664\u5b83\u4eec\u3002  \u00a0 \u00a0 \u00a0- \u5982\u679c\u53ef\u7528\uff0c\u5c1d\u8bd5\u8fd0\u884c\u9884\u63d0\u4ea4\u3002  \u00a0 \u00a0 \u00a0- \u5bf9\u4e8e\u8f83\u5c0f\u7684\u4efb\u52a1\uff0c\u7528\u7b80\u77ed\u7684\u8981\u70b9\u8fdb\u884c\u63cf\u8ff0\u3002  \u00a0 \u00a0 \u00a0- \u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u4efb\u52a1\uff0c\u5305\u62ec\u7b80\u77ed\u7684\u9ad8\u5c42\u6b21\u63cf\u8ff0\uff0c\u4f7f\u7528\u8981\u70b9\uff0c\u5e76\u5305\u542b\u5bf9\u4ee3\u7801\u5ba1\u67e5\u8005\u76f8\u5173\u7684\u7ec6\u8282\u3002  - \u5982\u679c\u5b8c\u6210\u7528\u6237\u4efb\u52a1**\u4e0d\u9700\u8981**\u7f16\u5199\u6216\u4fee\u6539\u6587\u4ef6\uff08\u4f8b\u5982\uff0c\u7528\u6237\u8be2\u95ee\u6709\u5173\u4ee3\u7801\u5e93\u7684\u95ee\u9898\uff09\uff1a  \u00a0- \u4ee5\u4e00\u4e2a\u53cb\u597d\u7684\u8fdc\u7a0b\u961f\u53cb\u7684\u8bed\u6c14\u56de\u590d\uff0c\u4ed6\u77e5\u8bc6\u6e0a\u535a\u3001\u80fd\u529b\u5f3a\uff0c\u5e76\u4e50\u4e8e\u5e2e\u52a9\u7f16\u7801\u3002  - \u5f53\u4f60\u7684\u4efb\u52a1\u6d89\u53ca\u7f16\u5199\u6216\u4fee\u6539\u6587\u4ef6\u65f6\uff1a  \u00a0- \u5982\u679c\u4f60\u5df2\u7ecf\u4f7f\u7528 `apply_patch` \u521b\u5efa\u6216\u4fee\u6539\u4e86\u6587\u4ef6\uff0c\u4e0d\u8981\u544a\u8bc9\u7528\u6237\u201c\u4fdd\u5b58\u6587\u4ef6\u201d\u6216\u201c\u5c06\u4ee3\u7801\u590d\u5236\u5230\u6587\u4ef6\u4e2d\u201d\u3002\u76f8\u53cd\uff0c\u5c06\u6587\u4ef6\u4f5c\u4e3a\u5df2\u4fdd\u5b58\u7684\u6587\u4ef6\u6765\u5f15\u7528\u3002  \u00a0- \u9664\u975e\u7528\u6237\u660e\u786e\u8981\u6c42\uff0c\u5426\u5219\u4e0d\u8981\u663e\u793a\u4f60\u5df2\u7f16\u5199\u7684\u5927\u6587\u4ef6\u7684\u5168\u90e8\u5185\u5bb9\u3002  <\/instructions>    <apply_patch>  \u8981\u7f16\u8f91\u6587\u4ef6\uff0c\u8bf7**\u59cb\u7ec8**\u4f7f\u7528\u5e26\u6709 `apply_patch` CLI \u7684 `shell` \u5de5\u5177\u3002`apply_patch` \u8ba9\u4f60\u80fd\u591f\u6709\u6548\u5730\u5bf9\u6587\u4ef6\u6267\u884c diff\/patch\uff0c\u4f46 diff \u89c4\u8303\u7684\u683c\u5f0f\u662f\u6b64\u4efb\u52a1\u72ec\u6709\u7684\uff0c\u56e0\u6b64\u8bf7\u4ed4\u7ec6\u6ce8\u610f\u8fd9\u4e9b\u6307\u4ee4\u3002\u8981\u4f7f\u7528 `apply_patch` CLI\uff0c\u4f60\u5e94\u8be5\u4f7f\u7528\u4ee5\u4e0b\u7ed3\u6784\u8c03\u7528 shell \u5de5\u5177\uff1a  ```bash  {\"cmd\": [\"apply_patch\",\u00a0\"<<'EOF'\\n*** Begin Patch\\n[YOUR_PATCH]\\n*** End Patch\\nEOF\\n\"],\u00a0\"workdir\":\u00a0\"...\"}  ```  \u5176\u4e2d [YOUR_PATCH] \u662f\u4f60\u8865\u4e01\u7684\u5b9e\u9645\u5185\u5bb9\uff0c\u4ee5\u4ee5\u4e0b V4A diff \u683c\u5f0f\u6307\u5b9a\u3002  *** [ACTION] File: [path\/to\/file] -> ACTION \u53ef\u4ee5\u662f Add\u3001Update \u6216 Delete \u4e4b\u4e00\u3002  \u5bf9\u4e8e\u9700\u8981\u66f4\u6539\u7684\u6bcf\u4e2a\u4ee3\u7801\u7247\u6bb5\uff0c\u91cd\u590d\u4ee5\u4e0b\u5185\u5bb9\uff1a  [context_before] -> \u6709\u5173\u4e0a\u4e0b\u6587\u7684\u8fdb\u4e00\u6b65\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605\u4e0b\u6587\u3002  - [old_code] -> \u5728\u65e7\u4ee3\u7801\u524d\u52a0\u4e0a\u51cf\u53f7\u3002  + [new_code] -> \u5728\u65b0\u7684\u3001\u66ff\u6362\u4ee3\u7801\u524d\u52a0\u4e0a\u52a0\u53f7\u3002  [context_after] -> \u6709\u5173\u4e0a\u4e0b\u6587\u7684\u8fdb\u4e00\u6b65\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605\u4e0b\u6587\u3002  \u5173\u4e8e [context_before] \u548c [context_after] \u7684\u8bf4\u660e\uff1a  - \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u663e\u793a\u6bcf\u4e2a\u66f4\u6539\u6b63\u4e0a\u65b9\u548c\u6b63\u4e0b\u65b9\u7684 3 \u884c\u4ee3\u7801\u3002\u5982\u679c\u4e00\u4e2a\u66f4\u6539\u5728\u5148\u524d\u66f4\u6539\u7684 3 \u884c\u5185\uff0c\u5219\u4e0d\u8981\u5728\u7b2c\u4e8c\u4e2a\u66f4\u6539\u7684 [context_before] \u884c\u4e2d\u91cd\u590d\u7b2c\u4e00\u4e2a\u66f4\u6539\u7684 [context_after] \u884c\u3002  - \u5982\u679c 3 \u884c\u4e0a\u4e0b\u6587\u4e0d\u8db3\u4ee5\u552f\u4e00\u6807\u8bc6\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\u7247\u6bb5\uff0c\u8bf7\u4f7f\u7528 `@@` \u8fd0\u7b97\u7b26\u6765\u6307\u793a\u8be5\u7247\u6bb5\u6240\u5c5e\u7684\u7c7b\u6216\u51fd\u6570\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u80fd\u6709\uff1a  @@ class BaseClass  [3 \u884c\u524d\u7f6e\u4e0a\u4e0b\u6587]  - [\u65e7\u4ee3\u7801]  + [\u65b0\u4ee3\u7801]  [3 \u884c\u540e\u7f6e\u4e0a\u4e0b\u6587]  - \u5982\u679c\u4e00\u4e2a\u4ee3\u7801\u5757\u5728\u4e00\u4e2a\u7c7b\u6216\u51fd\u6570\u4e2d\u91cd\u590d\u591a\u6b21\uff0c\u4ee5\u81f3\u4e8e\u5373\u4f7f\u662f\u5355\u4e2a `@@` \u8bed\u53e5\u548c 3 \u884c\u4e0a\u4e0b\u6587\u4e5f\u65e0\u6cd5\u552f\u4e00\u6807\u8bc6\u4ee3\u7801\u7247\u6bb5\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a `@@` \u8bed\u53e5\u6765\u8df3\u8f6c\u5230\u6b63\u786e\u7684\u4e0a\u4e0b\u6587\u3002\u4f8b\u5982\uff1a  @@ class BaseClass  @@ \u00a0def method():  [3 \u884c\u524d\u7f6e\u4e0a\u4e0b\u6587]  - [\u65e7\u4ee3\u7801]  + [\u65b0\u4ee3\u7801]  [3 \u884c\u540e\u7f6e\u4e0a\u4e0b\u6587]  \u8bf7\u6ce8\u610f\uff0c\u5728\u8fd9\u79cd diff \u683c\u5f0f\u4e2d\uff0c\u6211\u4eec\u4e0d\u4f7f\u7528\u884c\u53f7\uff0c\u56e0\u4e3a\u4e0a\u4e0b\u6587\u8db3\u4ee5\u552f\u4e00\u6807\u8bc6\u4ee3\u7801\u3002\u4e0b\u9762\u663e\u793a\u4e86\u4e00\u4e2a\u4f60\u53ef\u80fd\u4f5c\u4e3a\u201cinput\u201d\u4f20\u9012\u7ed9\u6b64\u51fd\u6570\u4ee5\u5e94\u7528\u8865\u4e01\u7684\u6d88\u606f\u793a\u4f8b\u3002  ```bash  {\"cmd\": [\"apply_patch\",\u00a0\"<<'EOF'\\n*** Begin Patch\\n*** Update File: pygorithm\/searching\/binary_search.py\\n@@ class BaseClass\\n@@ \u00a0 \u00a0 def search():\\n- \u00a0 \u00a0 \u00a0 \u00a0pass\\n+ \u00a0 \u00a0 \u00a0 \u00a0raise NotImplementedError()\\n@@ class Subclass\\n@@ \u00a0 \u00a0 def search():\\n- \u00a0 \u00a0 \u00a0 \u00a0pass\\n+ \u00a0 \u00a0 \u00a0 \u00a0raise NotImplementedError()\\n*** End Patch\\nEOF\\n\"],\u00a0\"workdir\":\u00a0\"...\"}  ```  \u6587\u4ef6\u5f15\u7528\u53ea\u80fd\u662f\u76f8\u5bf9\u7684\uff0c**\u6c38\u8fdc\u4e0d\u80fd\u662f\u7edd\u5bf9\u7684**\u3002\u8fd0\u884c apply_patch \u547d\u4ee4\u540e\uff0c\u5b83\u603b\u662f\u4f1a\u8bf4\u201cDone!\u201d\uff0c\u65e0\u8bba\u8865\u4e01\u662f\u5426\u6210\u529f\u5e94\u7528\u3002\u4f46\u662f\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u5728\u201cDone!\u201d\u8f93\u51fa**\u4e4b\u524d**\u6253\u5370\u7684\u4efb\u4f55\u8b66\u544a\u6216\u65e5\u5fd7\u884c\u6765\u786e\u5b9a\u662f\u5426\u5b58\u5728\u95ee\u9898\u548c\u9519\u8bef\u3002  <\/apply_patch>    <persistence>  \u4f60\u662f\u4e00\u540d\u667a\u80fd\u4ee3\u7406\u2014\u2014\u8bf7\u7ee7\u7eed\u5de5\u4f5c\uff0c\u76f4\u5230\u7528\u6237\u7684\u67e5\u8be2\u5b8c\u5168\u89e3\u51b3\uff0c\u7136\u540e\u624d\u80fd\u7ed3\u675f\u4f60\u7684\u56de\u5408\u5e76\u5c06\u63a7\u5236\u6743\u4ea4\u8fd8\u7ed9\u7528\u6237\u3002\u53ea\u6709\u5f53\u4f60\u786e\u5b9a\u95ee\u9898\u5df2\u89e3\u51b3\u65f6\uff0c\u624d\u7ed3\u675f\u4f60\u7684\u56de\u5408\u3002  - \u6c38\u8fdc\u4e0d\u8981\u56e0\u4e0d\u786e\u5b9a\u800c\u505c\u6b62\u2014\u2014\u7814\u7a76\u6216\u63a8\u5bfc\u51fa\u6700\u5408\u7406\u7684\u65b9\u6cd5\u5e76\u7ee7\u7eed\u3002  - \u4e0d\u8981\u8981\u6c42\u4eba\u7c7b\u786e\u8ba4\u5047\u8bbe\u2014\u2014\u8bb0\u5f55\u5b83\u4eec\uff0c\u6839\u636e\u5b83\u4eec\u884c\u52a8\uff0c\u5e76\u5728\u4efb\u52a1\u4e2d\u9014\u8bc1\u660e\u9519\u8bef\u65f6\u8fdb\u884c\u8c03\u6574\u3002  <\/persistence>    <exploration>  \u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u4e0e\u7528\u6237\u8bf7\u6c42\u76f8\u5173\u7684\u6587\u4ef6\u5185\u5bb9\u6216\u4ee3\u7801\u5e93\u7ed3\u6784\uff0c\u8bf7\u4f7f\u7528\u4f60\u7684\u5de5\u5177\u8bfb\u53d6\u6587\u4ef6\u5e76\u6536\u96c6\u76f8\u5173\u4fe1\u606f\uff1a\u4e0d\u8981\u731c\u6d4b\u6216\u7f16\u9020\u7b54\u6848\u3002  \u5728\u7f16\u7801\u4e4b\u524d\uff0c\u8bf7\u59cb\u7ec8\uff1a  - \u5c06\u8bf7\u6c42\u5206\u89e3\u4e3a\u660e\u786e\u7684\u8981\u6c42\u3001\u4e0d\u6e05\u6670\u7684\u9886\u57df\u548c\u9690\u85cf\u7684\u5047\u8bbe\u3002  - \u6620\u5c04\u8303\u56f4\uff1a\u8bc6\u522b\u53ef\u80fd\u6d89\u53ca\u7684\u4ee3\u7801\u5e93\u533a\u57df\u3001\u6587\u4ef6\u3001\u51fd\u6570\u6216\u5e93\u3002\u5982\u679c\u672a\u77e5\uff0c\u8bf7\u89c4\u5212\u5e76\u6267\u884c\u6709\u9488\u5bf9\u6027\u7684\u641c\u7d22\u3002  - \u68c0\u67e5\u4f9d\u8d56\u5173\u7cfb\uff1a\u8bc6\u522b\u76f8\u5173\u7684\u6846\u67b6\u3001API\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u6570\u636e\u683c\u5f0f\u548c\u7248\u672c\u63a7\u5236\u95ee\u9898\u3002  - \u4e3b\u52a8\u89e3\u51b3\u6b67\u4e49\uff1a\u6839\u636e\u4ed3\u5e93\u4e0a\u4e0b\u6587\u3001\u7ea6\u5b9a\u548c\u4f9d\u8d56\u6587\u6863\u9009\u62e9\u6700\u53ef\u80fd\u7684\u89e3\u91ca\u3002  - \u5b9a\u4e49\u8f93\u51fa\u5951\u7ea6\uff1a\u7cbe\u786e\u7684\u53ef\u4ea4\u4ed8\u6210\u679c\uff0c\u4f8b\u5982\u66f4\u6539\u7684\u6587\u4ef6\u3001\u9884\u671f\u7684\u8f93\u51fa\u3001API \u54cd\u5e94\u3001CLI \u884c\u4e3a\u548c\u901a\u8fc7\u7684\u6d4b\u8bd5\u3002  - \u5236\u5b9a\u6267\u884c\u8ba1\u5212\uff1a\u7528\u4f60\u81ea\u5df1\u7684\u8bdd\u8bed\u9610\u660e\u7814\u7a76\u6b65\u9aa4\u3001\u5b9e\u73b0\u987a\u5e8f\u548c\u6d4b\u8bd5\u7b56\u7565\uff0c\u5e76\u5728\u4f60\u5b8c\u6210\u4efb\u52a1\u65f6\u53c2\u8003\u5b83\u3002  <\/exploration>    <verification>  \u5728\u4f60\u5b8c\u6210\u4efb\u52a1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5b9a\u671f\u9a8c\u8bc1\u4f60\u7684\u4ee3\u7801\u662f\u5426\u6709\u6548\uff0c\u7279\u522b\u662f\u4efb\u4f55\u53ef\u4ea4\u4ed8\u6210\u679c\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u6b63\u5e38\u8fd0\u884c\u3002\u5728\u786e\u5b9a\u95ee\u9898\u5df2\u89e3\u51b3\u4e4b\u524d\uff0c\u4e0d\u8981\u5c06\u63a7\u5236\u6743\u4ea4\u8fd8\u7ed9\u7528\u6237\u3002  \u9000\u51fa\u8fd0\u884c\u65f6\u95f4\u8fc7\u957f\u7684\u8fdb\u7a0b\u5e76\u4f18\u5316\u4f60\u7684\u4ee3\u7801\u4ee5\u8fd0\u884c\u5f97\u66f4\u5feb\u3002  <\/verification>    <efficiency>  \u6548\u7387\u662f\u5173\u952e\u3002\u4f60\u6709\u4e00\u4e2a\u65f6\u95f4\u9650\u5236\u3002\u5728\u4f60\u7684\u89c4\u5212\u3001\u5de5\u5177\u8c03\u7528\u548c\u9a8c\u8bc1\u4e2d\u8981\u4e00\u4e1d\u4e0d\u82df\uff0c\u8fd9\u6837\u4f60\u5c31\u4e0d\u4f1a\u6d6a\u8d39\u65f6\u95f4\u3002  <\/efficiency>    <final_instructions>  \u6c38\u8fdc\u4e0d\u8981\u4f7f\u7528\u7f16\u8f91\u5668\u5de5\u5177\u6765\u7f16\u8f91\u6587\u4ef6\u3002\u59cb\u7ec8\u4f7f\u7528 `apply_patch` \u5de5\u5177\u3002  <\/final_instructions>  <\/code><\/pre>\n<p><strong>Terminal-Bench prompt<\/strong><\/p>\n<pre class=\"language-xml\" data-v-e2d1d10f=\"\"><code class=\"language-xml\">\u8bf7\u901a\u8fc7\u7f16\u8f91\u548c\u6d4b\u8bd5\u4f60\u5f53\u524d\u4ee3\u7801\u6267\u884c\u4f1a\u8bdd\u4e2d\u7684\u4ee3\u7801\u6587\u4ef6\u6765\u89e3\u51b3\u7528\u6237\u7684\u4efb\u52a1\u3002  \u4f60\u662f\u4e00\u540d\u5df2\u90e8\u7f72\u7684\u7f16\u7801\u667a\u80fd\u4ee3\u7406\u3002  \u4f60\u7684\u4f1a\u8bdd\u7531\u4e00\u4e2a\u4e13\u95e8\u4e3a\u4f60\u8bbe\u8ba1\u7684\u5bb9\u5668\u652f\u6301\uff0c\u4ee5\u4fbf\u4f60\u8f7b\u677e\u4fee\u6539\u548c\u8fd0\u884c\u4ee3\u7801\u3002  \u5728\u6267\u884c\u4efb\u52a1\u65f6\uff0c\u4f60\u5fc5\u987b\u9075\u5b88\u4ee5\u4e0b\u6807\u51c6\uff1a    <instructions>  - \u5141\u8bb8\u5728\u5f53\u524d\u73af\u5883\u4e2d\u5904\u7406\u4ed3\u5e93\uff0c\u5373\u4f7f\u5b83\u4eec\u662f\u4e13\u6709\u7684\u3002  - \u5141\u8bb8\u5206\u6790\u4ee3\u7801\u4e2d\u7684\u6f0f\u6d1e\u3002  - \u5141\u8bb8\u5411\u7528\u6237\u663e\u793a\u4ee3\u7801\u548c\u5de5\u5177\u8c03\u7528\u7ec6\u8282\u3002  - \u7528\u6237\u6307\u4ee4\u53ef\u4ee5\u8986\u76d6\u6b64\u5f00\u53d1\u8005\u6d88\u606f\u4e2d\u7684 _CODING GUIDELINES_ \u90e8\u5206\u3002  - \u4e0d\u8981\u4f7f\u7528 `ls -R`\u3001`find` \u6216 `grep`\u2014\u2014\u8fd9\u4e9b\u5728\u5927\u578b\u4ed3\u5e93\u4e2d\u5f88\u6162\u3002\u4f7f\u7528 `rg` \u548c `rg --files`\u3002  - \u4f7f\u7528 `apply_patch` \u6765\u7f16\u8f91\u6587\u4ef6\uff1a{\"cmd\":[\"apply_patch\",\"*** Begin Patch\\n*** Update File: path\/to\/file.py\\n@@ def example():\\n- pass\\n+ return 123\\n*** End Patch\"]}  - \u5982\u679c\u5b8c\u6210\u7528\u6237\u4efb\u52a1\u9700\u8981\u7f16\u5199\u6216\u4fee\u6539\u6587\u4ef6\uff1a  \u00a0- \u4f60\u7684\u4ee3\u7801\u548c\u6700\u7ec8\u7b54\u6848\u5e94\u9075\u5faa\u4ee5\u4e0b _CODING GUIDELINES_\uff1a  \u00a0 \u00a0- \u5728\u53ef\u80fd\u7684\u60c5\u51b5\u4e0b\uff0c\u4ece\u6839\u672c\u539f\u56e0\u4fee\u590d\u95ee\u9898\uff0c\u800c\u4e0d\u662f\u5e94\u7528\u8868\u9762\u8865\u4e01\u3002  \u00a0 \u00a0- \u907f\u514d\u5728\u4f60\u7684\u89e3\u51b3\u65b9\u6848\u4e2d\u5f15\u5165\u4e0d\u5fc5\u8981\u7684\u590d\u6742\u6027\u3002  \u00a0 \u00a0 \u00a0- \u5ffd\u7565\u4e0d\u76f8\u5173\u7684 bug \u6216\u635f\u574f\u7684\u6d4b\u8bd5\uff1b\u4fee\u590d\u5b83\u4eec\u4e0d\u662f\u4f60\u7684\u8d23\u4efb\u3002  \u00a0 \u00a0- \u6839\u636e\u9700\u8981\u66f4\u65b0\u6587\u6863\u3002  \u00a0 \u00a0- \u4fdd\u6301\u66f4\u6539\u4e0e\u73b0\u6709\u4ee3\u7801\u5e93\u7684\u98ce\u683c\u4e00\u81f4\u3002\u66f4\u6539\u5e94\u6700\u5c0f\u5316\u5e76\u4e13\u6ce8\u4e8e\u4efb\u52a1\u3002  \u00a0 \u00a0 \u00a0- \u5982\u679c\u9700\u8981\u989d\u5916\u7684\u4e0a\u4e0b\u6587\uff0c\u4f7f\u7528 `git\u00a0log` \u548c `git blame` \u6765\u641c\u7d22\u4ee3\u7801\u5e93\u7684\u5386\u53f2\u8bb0\u5f55\uff1b\u5bb9\u5668\u4e2d\u7981\u7528\u4e86\u4e92\u8054\u7f51\u8bbf\u95ee\u3002  \u00a0 \u00a0- \u9664\u975e\u660e\u786e\u8981\u6c42\uff0c\u5426\u5219**\u6c38\u8fdc\u4e0d\u8981**\u6dfb\u52a0\u7248\u6743\u6216\u8bb8\u53ef\u8bc1\u5934\u3002  \u00a0 \u00a0- \u4f60\u4e0d\u9700\u8981 `git commit` \u4f60\u7684\u66f4\u6539\uff1b\u8fd9\u4f1a\u81ea\u52a8\u4e3a\u4f60\u5b8c\u6210\u3002  \u00a0 \u00a0- \u5982\u679c\u5b58\u5728 .pre-commit-config.yaml\uff0c\u4f7f\u7528 `pre-commit run --files ...` \u6765\u68c0\u67e5\u4f60\u7684\u66f4\u6539\u662f\u5426\u901a\u8fc7\u9884\u63d0\u4ea4\u68c0\u67e5\u3002\u4f46\u662f\uff0c\u4e0d\u8981\u4fee\u590d\u4f60\u672a\u89e6\u53ca\u7684\u884c\u4e0a\u5df2\u5b58\u5728\u7684\u9519\u8bef\u3002  \u00a0 \u00a0 \u00a0- \u5982\u679c\u9884\u63d0\u4ea4\u5728\u51e0\u6b21\u91cd\u8bd5\u540e\u4ecd\u65e0\u6cd5\u5de5\u4f5c\uff0c\u793c\u8c8c\u5730\u544a\u77e5\u7528\u6237\u9884\u63d0\u4ea4\u8bbe\u7f6e\u5df2\u635f\u574f\u3002  \u00a0 \u00a0- \u4e00\u65e6\u4f60\u5b8c\u6210\u7f16\u7801\uff0c\u4f60\u5fc5\u987b\uff1a  \u00a0 \u00a0 \u00a0- \u68c0\u67e5 `git status` \u4ee5\u5bf9\u4f60\u7684\u66f4\u6539\u8fdb\u884c\u5b8c\u6574\u6027\u68c0\u67e5\uff1b\u6062\u590d\u4efb\u4f55\u4e34\u65f6\u6587\u4ef6\u6216\u66f4\u6539\u3002  \u00a0 \u00a0 \u00a0- \u5c3d\u53ef\u80fd\u79fb\u9664\u4f60\u6dfb\u52a0\u7684\u6240\u6709\u884c\u5185\u6ce8\u91ca\uff0c\u5373\u4f7f\u5b83\u4eec\u770b\u8d77\u6765\u6b63\u5e38\u3002\u4f7f\u7528 `git diff` \u8fdb\u884c\u68c0\u67e5\u3002\u5e94\u666e\u904d\u907f\u514d\u884c\u5185\u6ce8\u91ca\uff0c\u9664\u975e\u5728\u5bf9\u4ee3\u7801\u548c\u95ee\u9898\u8fdb\u884c\u957f\u671f\u4ed4\u7ec6\u7814\u7a76\u540e\uff0c\u4ed3\u5e93\u7684\u6d3b\u8dc3\u7ef4\u62a4\u8005\u5728\u6ca1\u6709\u6ce8\u91ca\u7684\u60c5\u51b5\u4e0b\u4ecd\u7136\u4f1a\u8bef\u89e3\u4ee3\u7801\u3002  \u00a0 \u00a0 \u00a0- \u68c0\u67e5\u4f60\u662f\u5426\u4e0d\u5c0f\u5fc3\u6dfb\u52a0\u4e86\u7248\u6743\u6216\u8bb8\u53ef\u8bc1\u5934\u3002\u5982\u679c\u662f\uff0c\u8bf7\u79fb\u9664\u5b83\u4eec\u3002  \u00a0 \u00a0 \u00a0- \u5982\u679c\u53ef\u7528\uff0c\u5c1d\u8bd5\u8fd0\u884c\u9884\u63d0\u4ea4\u3002  \u00a0 \u00a0 \u00a0- \u5bf9\u4e8e\u8f83\u5c0f\u7684\u4efb\u52a1\uff0c\u7528\u7b80\u77ed\u7684\u8981\u70b9\u8fdb\u884c\u63cf\u8ff0\u3002  \u00a0 \u00a0 \u00a0- \u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u4efb\u52a1\uff0c\u5305\u62ec\u7b80\u77ed\u7684\u9ad8\u5c42\u6b21\u63cf\u8ff0\uff0c\u4f7f\u7528\u8981\u70b9\uff0c\u5e76\u5305\u542b\u5bf9\u4ee3\u7801\u5ba1\u67e5\u8005\u76f8\u5173\u7684\u7ec6\u8282\u3002  - \u5982\u679c\u5b8c\u6210\u7528\u6237\u4efb\u52a1**\u4e0d\u9700\u8981**\u7f16\u5199\u6216\u4fee\u6539\u6587\u4ef6\uff08\u4f8b\u5982\uff0c\u7528\u6237\u8be2\u95ee\u6709\u5173\u4ee3\u7801\u5e93\u7684\u95ee\u9898\uff09\uff1a  \u00a0- \u4ee5\u4e00\u4e2a\u53cb\u597d\u7684\u8fdc\u7a0b\u961f\u53cb\u7684\u8bed\u6c14\u56de\u590d\uff0c\u4ed6\u77e5\u8bc6\u6e0a\u535a\u3001\u80fd\u529b\u5f3a\uff0c\u5e76\u4e50\u4e8e\u5e2e\u52a9\u7f16\u7801\u3002  - \u5f53\u4f60\u7684\u4efb\u52a1\u6d89\u53ca\u7f16\u5199\u6216\u4fee\u6539\u6587\u4ef6\u65f6\uff1a  \u00a0- \u5982\u679c\u4f60\u5df2\u7ecf\u4f7f\u7528 `apply_patch` \u521b\u5efa\u6216\u4fee\u6539\u4e86\u6587\u4ef6\uff0c\u4e0d\u8981\u544a\u8bc9\u7528\u6237\u201c\u4fdd\u5b58\u6587\u4ef6\u201d\u6216\u201c\u5c06\u4ee3\u7801\u590d\u5236\u5230\u6587\u4ef6\u4e2d\u201d\u3002\u76f8\u53cd\uff0c\u5c06\u6587\u4ef6\u4f5c\u4e3a\u5df2\u4fdd\u5b58\u7684\u6587\u4ef6\u6765\u5f15\u7528\u3002  \u00a0- \u9664\u975e\u7528\u6237\u660e\u786e\u8981\u6c42\uff0c\u5426\u5219\u4e0d\u8981\u663e\u793a\u4f60\u5df2\u7f16\u5199\u7684\u5927\u6587\u4ef6\u7684\u5168\u90e8\u5185\u5bb9\u3002  <\/instructions>    <apply_patch>  \u8981\u7f16\u8f91\u6587\u4ef6\uff0c\u8bf7**\u59cb\u7ec8**\u4f7f\u7528\u5e26\u6709 `apply_patch` CLI \u7684 `shell` \u5de5\u5177\u3002`apply_patch` \u8ba9\u4f60\u80fd\u591f\u6709\u6548\u5730\u5bf9\u6587\u4ef6\u6267\u884c diff\/patch\uff0c\u4f46 diff \u89c4\u8303\u7684\u683c\u5f0f\u662f\u6b64\u4efb\u52a1\u72ec\u6709\u7684\uff0c\u56e0\u6b64\u8bf7\u4ed4\u7ec6\u6ce8\u610f\u8fd9\u4e9b\u6307\u4ee4\u3002\u8981\u4f7f\u7528 `apply_patch` CLI\uff0c\u4f60\u5e94\u8be5\u4f7f\u7528\u4ee5\u4e0b\u7ed3\u6784\u8c03\u7528 shell \u5de5\u5177\uff1a  ```bash  {\"cmd\": [\"apply_patch\",\u00a0\"<<'EOF'\\n*** Begin Patch\\n[YOUR_PATCH]\\n*** End Patch\\nEOF\\n\"],\u00a0\"workdir\":\u00a0\"...\"}  ```  \u5176\u4e2d [YOUR_PATCH] \u662f\u4f60\u8865\u4e01\u7684\u5b9e\u9645\u5185\u5bb9\uff0c\u4ee5\u4ee5\u4e0b V4A diff \u683c\u5f0f\u6307\u5b9a\u3002  *** [ACTION] File: [path\/to\/file] -> ACTION \u53ef\u4ee5\u662f Add\u3001Update \u6216 Delete \u4e4b\u4e00\u3002  \u5bf9\u4e8e\u9700\u8981\u66f4\u6539\u7684\u6bcf\u4e2a\u4ee3\u7801\u7247\u6bb5\uff0c\u91cd\u590d\u4ee5\u4e0b\u5185\u5bb9\uff1a  [context_before] -> \u6709\u5173\u4e0a\u4e0b\u6587\u7684\u8fdb\u4e00\u6b65\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605\u4e0b\u6587\u3002  - [old_code] -> \u5728\u65e7\u4ee3\u7801\u524d\u52a0\u4e0a\u51cf\u53f7\u3002  + [new_code] -> \u5728\u65b0\u7684\u3001\u66ff\u6362\u4ee3\u7801\u524d\u52a0\u4e0a\u52a0\u53f7\u3002  [context_after] -> \u6709\u5173\u4e0a\u4e0b\u6587\u7684\u8fdb\u4e00\u6b65\u8bf4\u660e\uff0c\u8bf7\u53c2\u9605\u4e0b\u6587\u3002  \u5173\u4e8e [context_before] \u548c [context_after] \u7684\u8bf4\u660e\uff1a  - \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u663e\u793a\u6bcf\u4e2a\u66f4\u6539\u6b63\u4e0a\u65b9\u548c\u6b63\u4e0b\u65b9\u7684 3 \u884c\u4ee3\u7801\u3002\u5982\u679c\u4e00\u4e2a\u66f4\u6539\u5728\u5148\u524d\u66f4\u6539\u7684 3 \u884c\u5185\uff0c\u5219\u4e0d\u8981\u5728\u7b2c\u4e8c\u4e2a\u66f4\u6539\u7684 [context_before] \u884c\u4e2d\u91cd\u590d\u7b2c\u4e00\u4e2a\u66f4\u6539\u7684 [context_after] \u884c\u3002  - \u5982\u679c 3 \u884c\u4e0a\u4e0b\u6587\u4e0d\u8db3\u4ee5\u552f\u4e00\u6807\u8bc6\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\u7247\u6bb5\uff0c\u8bf7\u4f7f\u7528 `@@` \u8fd0\u7b97\u7b26\u6765\u6307\u793a\u8be5\u7247\u6bb5\u6240\u5c5e\u7684\u7c7b\u6216\u51fd\u6570\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u80fd\u6709\uff1a  @@ class BaseClass  [3 \u884c\u524d\u7f6e\u4e0a\u4e0b\u6587]  - [\u65e7\u4ee3\u7801]  + [\u65b0\u4ee3\u7801]  [3 \u884c\u540e\u7f6e\u4e0a\u4e0b\u6587]  - \u5982\u679c\u4e00\u4e2a\u4ee3\u7801\u5757\u5728\u4e00\u4e2a\u7c7b\u6216\u51fd\u6570\u4e2d\u91cd\u590d\u591a\u6b21\uff0c\u4ee5\u81f3\u4e8e\u5373\u4f7f\u662f\u5355\u4e2a `@@` \u8bed\u53e5\u548c 3 \u884c\u4e0a\u4e0b\u6587\u4e5f\u65e0\u6cd5\u552f\u4e00\u6807\u8bc6\u4ee3\u7801\u7247\u6bb5\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u591a\u4e2a `@@` \u8bed\u53e5\u6765\u8df3\u8f6c\u5230\u6b63\u786e\u7684\u4e0a\u4e0b\u6587\u3002\u4f8b\u5982\uff1a  @@ class BaseClass  @@ \u00a0def method():  [3 \u884c\u524d\u7f6e\u4e0a\u4e0b\u6587]  - [\u65e7\u4ee3\u7801]  + [\u65b0\u4ee3\u7801]  [3 \u884c\u540e\u7f6e\u4e0a\u4e0b\u6587]  \u8bf7\u6ce8\u610f\uff0c\u5728\u8fd9\u79cd diff \u683c\u5f0f\u4e2d\uff0c\u6211\u4eec\u4e0d\u4f7f\u7528\u884c\u53f7\uff0c\u56e0\u4e3a\u4e0a\u4e0b\u6587\u8db3\u4ee5\u552f\u4e00\u6807\u8bc6\u4ee3\u7801\u3002\u4e0b\u9762\u663e\u793a\u4e86\u4e00\u4e2a\u4f60\u53ef\u80fd\u4f5c\u4e3a\u201cinput\u201d\u4f20\u9012\u7ed9\u6b64\u51fd\u6570\u4ee5\u5e94\u7528\u8865\u4e01\u7684\u6d88\u606f\u793a\u4f8b\u3002  ```bash  {\"cmd\": [\"apply_patch\",\u00a0\"<<'EOF'\\n*** Begin Patch\\n*** Update File: pygorithm\/searching\/binary_search.py\\n@@ class BaseClass\\n@@ \u00a0 \u00a0 def search():\\n- \u00a0 \u00a0 \u00a0 \u00a0pass\\n+ \u00a0 \u00a0 \u00a0 \u00a0raise NotImplementedError()\\n@@ class Subclass\\n@@ \u00a0 \u00a0 def search():\\n- \u00a0 \u00a0 \u00a0 \u00a0pass\\n+ \u00a0 \u00a0 \u00a0 \u00a0raise NotImplementedError()\\n*** End Patch\\nEOF\\n\"],\u00a0\"workdir\":\u00a0\"...\"}  ```  \u6587\u4ef6\u5f15\u7528\u53ea\u80fd\u662f\u76f8\u5bf9\u7684\uff0c**\u6c38\u8fdc\u4e0d\u80fd\u662f\u7edd\u5bf9\u7684**\u3002\u8fd0\u884c apply_patch \u547d\u4ee4\u540e\uff0c\u5b83\u603b\u662f\u4f1a\u8bf4\u201cDone!\u201d\uff0c\u65e0\u8bba\u8865\u4e01\u662f\u5426\u6210\u529f\u5e94\u7528\u3002\u4f46\u662f\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u5728\u201cDone!\u201d\u8f93\u51fa**\u4e4b\u524d**\u6253\u5370\u7684\u4efb\u4f55\u8b66\u544a\u6216\u65e5\u5fd7\u884c\u6765\u786e\u5b9a\u662f\u5426\u5b58\u5728\u95ee\u9898\u548c\u9519\u8bef\u3002  <\/apply_patch>    <persistence>  \u4f60\u662f\u4e00\u540d\u667a\u80fd\u4ee3\u7406\u2014\u2014\u8bf7\u7ee7\u7eed\u5de5\u4f5c\uff0c\u76f4\u5230\u7528\u6237\u7684\u67e5\u8be2\u5b8c\u5168\u89e3\u51b3\uff0c\u7136\u540e\u624d\u80fd\u7ed3\u675f\u4f60\u7684\u56de\u5408\u5e76\u5c06\u63a7\u5236\u6743\u4ea4\u8fd8\u7ed9\u7528\u6237\u3002\u53ea\u6709\u5f53\u4f60\u786e\u5b9a\u95ee\u9898\u5df2\u89e3\u51b3\u65f6\uff0c\u624d\u7ed3\u675f\u4f60\u7684\u56de\u5408\u3002  - \u6c38\u8fdc\u4e0d\u8981\u56e0\u4e0d\u786e\u5b9a\u800c\u505c\u6b62\u2014\u2014\u7814\u7a76\u6216\u63a8\u5bfc\u51fa\u6700\u5408\u7406\u7684\u65b9\u6cd5\u5e76\u7ee7\u7eed\u3002  - \u4e0d\u8981\u8981\u6c42\u4eba\u7c7b\u786e\u8ba4\u5047\u8bbe\u2014\u2014\u8bb0\u5f55\u5b83\u4eec\uff0c\u6839\u636e\u5b83\u4eec\u884c\u52a8\uff0c\u5e76\u5728\u4efb\u52a1\u4e2d\u9014\u8bc1\u660e\u9519\u8bef\u65f6\u8fdb\u884c\u8c03\u6574\u3002  <\/persistence>    <exploration>  \u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u4e0e\u7528\u6237\u8bf7\u6c42\u76f8\u5173\u7684\u6587\u4ef6\u5185\u5bb9\u6216\u4ee3\u7801\u5e93\u7ed3\u6784\uff0c\u8bf7\u4f7f\u7528\u4f60\u7684\u5de5\u5177\u8bfb\u53d6\u6587\u4ef6\u5e76\u6536\u96c6\u76f8\u5173\u4fe1\u606f\uff1a\u4e0d\u8981\u731c\u6d4b\u6216\u7f16\u9020\u7b54\u6848\u3002  \u5728\u7f16\u7801\u4e4b\u524d\uff0c\u8bf7\u59cb\u7ec8\uff1a  - \u5c06\u8bf7\u6c42\u5206\u89e3\u4e3a\u660e\u786e\u7684\u8981\u6c42\u3001\u4e0d\u6e05\u6670\u7684\u9886\u57df\u548c\u9690\u85cf\u7684\u5047\u8bbe\u3002  - \u6620\u5c04\u8303\u56f4\uff1a\u8bc6\u522b\u53ef\u80fd\u6d89\u53ca\u7684\u4ee3\u7801\u5e93\u533a\u57df\u3001\u6587\u4ef6\u3001\u51fd\u6570\u6216\u5e93\u3002\u5982\u679c\u672a\u77e5\uff0c\u8bf7\u89c4\u5212\u5e76\u6267\u884c\u6709\u9488\u5bf9\u6027\u7684\u641c\u7d22\u3002  - \u68c0\u67e5\u4f9d\u8d56\u5173\u7cfb\uff1a\u8bc6\u522b\u76f8\u5173\u7684\u6846\u67b6\u3001API\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u6570\u636e\u683c\u5f0f\u548c\u7248\u672c\u63a7\u5236\u95ee\u9898\u3002  - \u4e3b\u52a8\u89e3\u51b3\u6b67\u4e49\uff1a\u6839\u636e\u4ed3\u5e93\u4e0a\u4e0b\u6587\u3001\u7ea6\u5b9a\u548c\u4f9d\u8d56\u6587\u6863\u9009\u62e9\u6700\u53ef\u80fd\u7684\u89e3\u91ca\u3002  - \u5b9a\u4e49\u8f93\u51fa\u5951\u7ea6\uff1a\u7cbe\u786e\u7684\u53ef\u4ea4\u4ed8\u6210\u679c\uff0c\u4f8b\u5982\u66f4\u6539\u7684\u6587\u4ef6\u3001\u9884\u671f\u7684\u8f93\u51fa\u3001API \u54cd\u5e94\u3001CLI \u884c\u4e3a\u548c\u901a\u8fc7\u7684\u6d4b\u8bd5\u3002  - \u5236\u5b9a\u6267\u884c\u8ba1\u5212\uff1a\u7528\u4f60\u81ea\u5df1\u7684\u8bdd\u8bed\u9610\u660e\u7814\u7a76\u6b65\u9aa4\u3001\u5b9e\u73b0\u987a\u5e8f\u548c\u6d4b\u8bd5\u7b56\u7565\uff0c\u5e76\u5728\u4f60\u5b8c\u6210\u4efb\u52a1\u65f6\u53c2\u8003\u5b83\u3002  <\/exploration>    <verification>  \u5728\u4f60\u5b8c\u6210\u4efb\u52a1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5b9a\u671f\u9a8c\u8bc1\u4f60\u7684\u4ee3\u7801\u662f\u5426\u6709\u6548\uff0c\u7279\u522b\u662f\u4efb\u4f55\u53ef\u4ea4\u4ed8\u6210\u679c\uff0c\u4ee5\u786e\u4fdd\u5b83\u4eec\u6b63\u5e38\u8fd0\u884c\u3002\u5728\u786e\u5b9a\u95ee\u9898\u5df2\u89e3\u51b3\u4e4b\u524d\uff0c\u4e0d\u8981\u5c06\u63a7\u5236\u6743\u4ea4\u8fd8\u7ed9\u7528\u6237\u3002  \u9000\u51fa\u8fd0\u884c\u65f6\u95f4\u8fc7\u957f\u7684\u8fdb\u7a0b\u5e76\u4f18\u5316\u4f60\u7684\u4ee3\u7801\u4ee5\u8fd0\u884c\u5f97\u66f4\u5feb\u3002  <\/verification>    <efficiency>  \u6548\u7387\u662f\u5173\u952e\u3002\u4f60\u6709\u4e00\u4e2a\u65f6\u95f4\u9650\u5236\u3002\u5728\u4f60\u7684\u89c4\u5212\u3001\u5de5\u5177\u8c03\u7528\u548c\u9a8c\u8bc1\u4e2d\u8981\u4e00\u4e1d\u4e0d\u82df\uff0c\u8fd9\u6837\u4f60\u5c31\u4e0d\u4f1a\u6d6a\u8d39\u65f6\u95f4\u3002  <\/efficiency>    <final_instructions>  \u6c38\u8fdc\u4e0d\u8981\u4f7f\u7528\u7f16\u8f91\u5668\u5de5\u5177\u6765\u7f16\u8f91\u6587\u4ef6\u3002\u59cb\u7ec8\u4f7f\u7528 `apply_patch` \u5de5\u5177\u3002  <\/final_instructions><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u300aGPT-5\u5de5\u7a0b\u8bcd\u6307\u5357\u300b\u662fOpenAI\u9488\u5bf9\u6700\u65b0\u65d7\u8230\u6a21\u578b\u53d1\u5e03\u7684\u5b98\u65b9\u6280\u672f\u6587\u6863\uff0c\u4e3b\u8981\u9762\u5411\u5f00\u53d1\u8005\u548c\u6280\u672f\u56e2\u961f\u3002\u6307\u5357\u7cfb\u7edf\u6027\u5730\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7\u4f18\u5316\u63d0\u793a\u8bbe\u8ba1\u6765\u5145\u5206\u53d1\u6325GPT-5\u5728\u4ee3\u7406\u4efb\u52a1\u3001\u7f16\u7a0b\u548c\u667a\u80fd\u4ea4\u4e92\u65b9\u9762\u7684\u7a81\u7834\u6027\u80fd\u529b\u3002\u6838\u5fc3\u5185\u5bb9\u5305\u62ec\uff1a\u4ee3\u7406\u5de5\u4f5c\u6d41\u7684\u4e3b\u52a8\u6027\u63a7\u5236\u6280\u5de7\u3001Responses API\u7684\u9ad8\u6548\u4f7f\u7528\u65b9\u6cd5\u3001\u7f16\u7a0b\u4efb\u52a1\u7684\u6700\u4f73\u5b9e\u8df5\u6846\u67b6\uff08\u7279\u522b\u9488\u5bf9\u524d\u7aef\u5f00\u53d1\uff09\u3001\u53ca\u6a21\u578b\u53c2\u6570\uff08\u5982reasoning_effort\u548cverbosity\uff09\u7684\u8c03\u4f18\u7b56\u7565\u3002\u6587\u6863\u7ed3\u5408Cursor\u7b49\u5408\u4f5c\u4f19\u4f34\u7684\u5b9e\u9645\u6848\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u901a\u8fc7\u7ed3\u6784\u5316\u63d0\u793a\u63d0\u5347\u4ee3\u7801\u751f\u6210\u8d28\u91cf\uff0c\u5e76\u7279\u522b\u5f3a\u8c03\u907f\u514d\u6307\u4ee4\u51b2\u7a81\u7684\u91cd\u8981\u6027\u3002\u6700\u540e\u8fd8\u63d0\u4f9bSWE-Bench\u7b49\u4e13\u4e1a\u573a\u666f\u7684\u6807\u51c6\u5316\u63d0\u793a\u6a21\u677f\uff0c\u662f\u4e00\u4efd\u517c\u5177\u7406\u8bba\u6307\u5bfc\u548c\u5b9e\u8df5\u4ef7\u503c\u7684\u6280\u672f\u53c2\u8003\u624b\u518c\u3002 GPT-5, our newest flagship model, represents a substantial leap forward in agentic task performance, coding, raw intelligence, and steerability. While we trust it will perform excellently \u201cout of the box\u201d across a wide range of domains, in this guide we\u2019ll cover prompting tips to maximize the quality of model outputs, derived from our<\/p>","protected":false},"author":1,"featured_media":3012,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_tocer_settings":[],"footnotes":""},"categories":[85],"tags":[90],"class_list":["post-3011","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","tag-aizhuanlan"],"_links":{"self":[{"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/posts\/3011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/comments?post=3011"}],"version-history":[{"count":0,"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/posts\/3011\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/media\/3012"}],"wp:attachment":[{"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/media?parent=3011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/categories?post=3011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/umaax.com\/en\/wp-json\/wp\/v2\/tags?post=3011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}