Skip to content
Merged
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
10 changes: 5 additions & 5 deletions examples/gpt-5/gpt-5_new_params_and_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"| # | Feature | Overview | Values / Usage |\n",
"|----|---------|----------|----------------|\n",
"| 1. | **Verbosity Parameter** | Lets you hint the model to be more or less expansive in its replies. Keep prompts stable and use the parameter instead of re-writing. | • **low** → terse UX, minimal prose.<br>• **medium** *(default)* → balanced detail.<br>• **high** → verbose, great for audits, teaching, or hand-offs. |\n",
"| 2. | **Free-Form Function Calling** | Generate raw text payloads—anything from Python scripts to SQL queries—directly to your custom tool without JSON wrapping. Offers greater flexibility for external runtimes like:<br>• Code sandboxes (Python, C++, Java, …)<br>• SQL databases<br>• Shell environments<br>• Config generators | Use when structured JSON isn’t needed and raw text is more natural for the target tool. |\n",
"| 2. | **Freeform Function Calling** | Generate raw text payloads—anything from Python scripts to SQL queries—directly to your custom tool without JSON wrapping. Offers greater flexibility for external runtimes like:<br>• Code sandboxes (Python, C++, Java, …)<br>• SQL databases<br>• Shell environments<br>• Config generators | Use when structured JSON isn’t needed and raw text is more natural for the target tool. |\n",
"| 3. | **Context-Free Grammar (CFG)** | A set of production rules defining valid strings in a language. Each rule rewrites a non-terminal into terminals and/or other non-terminals, independent of surrounding context. Useful for constraining output to match the syntax of programming languages or custom formats in OpenAI tools. | Use as a contract to ensure the model emits only valid strings accepted by the grammar. |\n",
"| 4. | **Minimal Reasoning** | Runs GPT-5 with few or no reasoning tokens to minimize latency and speed time-to-first-token. Ideal for deterministic, lightweight tasks (extraction, formatting, short rewrites, simple classification) where explanations aren’t needed. If not specified, effort defaults to medium. | Set reasoning effort: \"minimal\". Avoid for multi-step planning or tool-heavy workflows. |\n",
"\n",
Expand All @@ -35,7 +35,7 @@
"id": "cbeb1c44",
"metadata": {},
"source": [
"## Pre-requisites \n",
"## Prerequisites \n",
"\n",
"Let's begin with updating your OpenAI SDK that supports the new params and tools for GPT-5. Make sure you've set OPENAI_API_KEY as an environment variable. "
]
Expand Down Expand Up @@ -687,7 +687,7 @@
"id": "3f6d3e73",
"metadata": {},
"source": [
"The code below produces a simple python code to calculate area of a circle, and instruct the model to use the free-form tool call to output the result. "
"The code below produces a simple python code to calculate area of a circle, and instruct the model to use the freeform tool call to output the result. "
]
},
{
Expand Down Expand Up @@ -933,7 +933,7 @@
"source": [
"### 2.4 Takeaways \n",
"\n",
"Free-form tool calling in GPT-5 lets you send raw text payloads—such as Python scripts, SQL queries, or config files—directly to custom tools without JSON wrapping. This provides greater flexibility for interacting with external runtimes and allows the model to generate code or text in the exact format your tool expects. It’s ideal when structured JSON is unnecessary and natural text output improves usability."
"Freeform tool calling in GPT-5 lets you send raw text payloads—such as Python scripts, SQL queries, or config files—directly to custom tools without JSON wrapping. This provides greater flexibility for interacting with external runtimes and allows the model to generate code or text in the exact format your tool expects. It’s ideal when structured JSON is unnecessary and natural text output improves usability."
]
},
{
Expand Down Expand Up @@ -1201,7 +1201,7 @@
"source": [
"### 3.5 Example - Regex CFG Syntax\n",
"\n",
"The following code example demonstrates using the Regex CFG syntax to constrain the free-form tool call to a certain timestamp pattern."
"The following code example demonstrates using the Regex CFG syntax to constrain the freeform tool call to a certain timestamp pattern."
]
},
{
Expand Down