Skip to content

Fix typos, links, section and phrasing on all GPT-5 examples #2040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/gpt-5/gpt-5_frontend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"- Styling / UI: Tailwind CSS, shadcn/ui, Radix Themes\n",
"- Icons: Material Symbols, Heroicons, Lucide\n",
"- Animation: Motion\n",
"- Fonts: San Serif, Inter, Geist, Mona Sans, IBM Plex Sans, Manrope\n",
"- Fonts: Sans Serif, Inter, Geist, Mona Sans, IBM Plex Sans, Manrope\n",
"\n",
"These packages are not an exhaustive list and we have seen many different application styles. \n",
"\n",
Expand Down
16 changes: 8 additions & 8 deletions examples/gpt-5/gpt-5_new_params_and_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"- medium (default) → balanced detail.\n",
"- high → verbose, great for audits, teaching, or hand-offs.\n",
"\n",
"Keep prompts stable and use the param rather than re-writing.\n"
"Keep prompts stable and use the parameter rather than re-writing.\n"
]
},
{
Expand Down Expand Up @@ -354,9 +354,9 @@
"id": "19b2e969",
"metadata": {},
"source": [
"### 2.3 Using Verbosity for Coding Use Cases \n",
"### 1.2 Using Verbosity for Coding Use Cases \n",
"\n",
"The verbosity parameter also influences the length and complexity of generated code, as well as the depth of accompanying explanations. Here's an example, wherein we use various verboisty levels for a task to generate a Python program that sorts an array of 1000000 random numbers. "
"The verbosity parameter also influences the length and complexity of generated code, as well as the depth of accompanying explanations. Here's an example, wherein we use various verbosity levels for a task to generate a Python program that sorts an array of 1000000 random numbers. "
]
},
{
Expand Down Expand Up @@ -503,7 +503,7 @@
"id": "fa48bbeb",
"metadata": {},
"source": [
"Medium verboisty, generated richer code with additioanl explanations. Let's do the same with high. "
"Medium verbosity, generated richer code with additional explanations. Let's do the same with high. "
]
},
{
Expand Down Expand Up @@ -898,7 +898,7 @@
"\n",
"\n",
"prompt = \"\"\"\n",
"Write code to sort the array of numbers in three languages: C++, Python and Java (10 times each)using code_exec functions.\n",
"Write code to sort the array of numbers in three languages: C++, Python and Java (10 times each) using code_exec functions.\n",
"\n",
"ALWAYS CALL THESE THREE FUNCTIONS EXACTLY ONCE: code_exec_python, code_exec_cpp and code_exec_java tools to sort the array in each language. Stop once you've called these three functions in each language once.\n",
"\n",
Expand Down Expand Up @@ -1257,7 +1257,7 @@
"id": "b9e2b86a",
"metadata": {},
"source": [
"### 3.5 Best Practices\n",
"### 3.6 Best Practices\n",
"\n",
"Lark grammars can be tricky to perfect. While simple grammars perform most reliably, complex grammars often require iteration on the grammar definition itself, the prompt, and the tool description to ensure that the model does not go out of distribution.\n",
"\n",
Expand Down Expand Up @@ -1286,7 +1286,7 @@
"id": "4c2ef909",
"metadata": {},
"source": [
"### 3.6 Takeaways \n",
"### 3.7 Takeaways \n",
"\n",
"Context-Free Grammar (CFG) support in GPT-5 lets you strictly constrain model output to match predefined syntax, ensuring only valid strings are generated. This is especially useful for enforcing programming language rules or custom formats, reducing post-processing and errors. By providing a precise grammar and clear tool description, you can make the model reliably stay within your target output structure."
]
Expand Down Expand Up @@ -1330,7 +1330,7 @@
"response = client.responses.create(\n",
" model=\"gpt-5\",\n",
" input= [{ 'role': 'developer', 'content': prompt }, \n",
" { 'role': 'user', 'content': 'The food that the restaurant was great! I recommend it to everyone.' }],\n",
" { 'role': 'user', 'content': 'The food at the restaurant was great! I recommend it to everyone.' }],\n",
" reasoning = {\n",
" \"effort\": \"minimal\"\n",
" },\n",
Expand Down
6 changes: 3 additions & 3 deletions examples/gpt-5/gpt-5_prompting_guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"\n",
"GPT-5, our newest flagship model, represents a substantial leap forward in agentic task performance, coding, raw intelligence, and steerability.\n",
"\n",
"While we trust it will perform excellently “out of the box” across a wide range of domains, in this guide we’ll 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 - with key insights into AI code editor Cursor’s prompt tuning work with GPT-5.\n",
"While we trust it will perform excellently “out of the box” across a wide range of domains, in this guide we’ll 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 new API features, and optimizing coding for frontend and software engineering tasks - with key insights into AI code editor Cursor’s prompt tuning work with GPT-5.\n",
"\n",
"We’ve seen significant gains from applying these best practices and adopting our canonical tools whenever possible, and we hope that this guide, along with the [prompt optimizer tool](https://platform.openai.com/chat/edit?optimize=true) we’ve 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 - we encourage you to run experiments and iterate on the foundation offered here to find the best solution for your problem."
]
Expand Down Expand Up @@ -490,13 +490,13 @@
" - If pre-commit doesn't work after a few retries, politely inform the user that the pre-commit setup is broken.\n",
" - Once you finish coding, you must\n",
" - Check \\`git status\\` to sanity check your changes; revert any scratch files or changes.\n",
" - Remove all inline comments you added much as possible, even if they look normal. Check using \\`git diff\\`. Inline comments must be generally avoided, unless active maintainers of the repo, after long careful study of the code and the issue, will still misinterpret the code without the comments.\n",
" - Remove all inline comments you added as much as possible, even if they look normal. Check using \\`git diff\\`. Inline comments must be generally avoided, unless active maintainers of the repo, after long careful study of the code and the issue, will still misinterpret the code without the comments.\n",
" - Check if you accidentally add copyright or license headers. If so, remove them.\n",
" - Try to run pre-commit if it is available.\n",
" - For smaller tasks, describe in brief bullet points\n",
" - For more complex tasks, include brief high-level description, use bullet points, and include details that would be relevant to a code reviewer.\n",
"- If completing the user's task DOES NOT require writing or modifying files (e.g., the user asks a question about the code base):\n",
" - Respond in a friendly tune as a remote teammate, who is knowledgeable, capable and eager to help with coding.\n",
" - Respond in a friendly tone as a remote teammate, who is knowledgeable, capable and eager to help with coding.\n",
"- When your task involves writing or modifying files:\n",
" - Do NOT tell the user to \"save the file\" or \"copy the code into a file\" if you already created or modified the file using \\`apply_patch\\`. Instead, reference the file as already saved.\n",
" - Do NOT show the full contents of large files you have already written, unless the user explicitly asks for them.\n",
Expand Down
12 changes: 6 additions & 6 deletions examples/gpt-5/prompt-optimization-cookbook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"source": [
"### Evaluate Generated Scripts - Baseline Prompt\n",
"\n",
"We then benchmark every script in ``results_topk_baseline`` On larger datasets this evaluation is intentionally heavy and can take several minutes."
"We then benchmark every script in ``results_topk_baseline``. On larger datasets this evaluation is intentionally heavy and can take several minutes."
]
},
{
Expand Down Expand Up @@ -254,15 +254,15 @@
"id": "56da7b3f",
"metadata": {},
"source": [
"Now let's use the prompt optimization tool in the console to improve our prompt and then review the results. We can start by going to the [OpenAI Optimize Playground](#https://platform.openai.com/chat/edit?optimize=true), and pasting our existing prompt in the Developer Message section.\n",
"Now let's use the prompt optimization tool in the console to improve our prompt and then review the results. We can start by going to the [OpenAI Optimize Playground](https://platform.openai.com/chat/edit?optimize=true), and pasting our existing prompt in the Developer Message section.\n",
"\n",
"From there press the **Optimize** button. This will open the optimization panel. At this stage, you can either provide specific edits you'd like to see reflected in the prompt or simply press **Optimize** to have it refined according to best practices for the target model and task. To start let's do just this.\n",
"From there press the **Optimize** button. This will open the optimization panel. At this stage, you can either provide specific edits you'd like to see reflected in the prompt or simply press **Optimize** to have it refined according to best practices for the target model and task. To start, let's do just this.\n",
"\n",
"![optimize_image](../../images/image_optimize_1.png)\n",
"\n",
"\n",
"\n",
"Once it's completed you'll see the result of the prompt optimization. In our example below you'll see many changes were made to the prompt. It will also give you snippets of what it changed and why the change was made. You can interact with these by opening the comments up or using the inline reviewer mode.\n",
"Once it's completed, you'll see the result of the prompt optimization. In our example below you'll see many changes were made to the prompt. It will also give you snippets of what it changed and why the change was made. You can interact with these by opening the comments up or using the inline reviewer mode.\n",
"\n",
"We'll add an additional change we'd like which include:\n",
"\n",
Expand All @@ -279,7 +279,7 @@
"id": "a983e50d",
"metadata": {},
"source": [
"Once we are happy with the optimized version of our prompt, we can save it as a [Prompt Object](#https://platform.openai.com/docs/guides/prompt-engineering#reusable-prompts) using a button on the top right of the optimizer. We can use this object within our API Calls which can help with future iteration, version management, and reusability across different applications. \n",
"Once we are happy with the optimized version of our prompt, we can save it as a [Prompt Object](https://platform.openai.com/docs/guides/prompt-engineering#reusable-prompts) using a button on the top right of the optimizer. We can use this object within our API Calls which can help with future iteration, version management, and reusability across different applications. \n",
"\n",
"![optimize_image](../../images/image_optimize_3.png)\n"
]
Expand Down Expand Up @@ -951,7 +951,7 @@
"id": "0a84939c",
"metadata": {},
"source": [
"GPT-5-mini crushes this task, so even the baseline prompt gets scores of >= 4 almost all of the time. However if we compare the percent of perfect scores (6/6) for the judge, we see that the optimize prompt has way significantly more perfect answers when evaluated in the two categories of FailSafeQA answer quality: robustness and context grounding."
"GPT-5-mini crushes this task, so even the baseline prompt gets scores of >= 4 almost all of the time. However if we compare the percent of perfect scores (6/6) for the judge, we see that the optimized prompt has way significantly more perfect answers when evaluated in the two categories of FailSafeQA answer quality: robustness and context grounding."
]
},
{
Expand Down