Skip to content

Commit 21cac77

Browse files
committed
Enhance Realtime Prompting Guide with clarifications and new content
- Revised text for improved clarity, including updates to examples and instructions on language control and repetition. - Added a new section on prompt optimization to help users refine their prompts for better model performance. - Enhanced descriptions to emphasize the importance of clear instructions and the impact of language constraints on model behavior.
1 parent a002724 commit 21cac77

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

examples/Realtime_prompting_guide.ipynb

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,11 @@
7373
"source": [
7474
"# General Tips\n",
7575
"- **Iterate relentlessly**: Small wording changes can make or break behavior.\n",
76-
" - Example: swapping “inaudible” → “intelligible” boosted noisy input handling.\n",
77-
"- **Make instructions clear**: The realtime model is excellent at instruction following, so unclear or conflicting instructions will degrade performance.\n",
76+
" - Example: swapping “inaudible” → “intelligible” boosted noisy audio input handling.\n",
7877
"- **Prefer bullets over paragraphs**: Clear, short bullets outperform long paragraphs.\n",
7978
"- **Guide with examples**: The model strongly follows onto sample phrases.\n",
8079
"- **Be precise**: Ambiguity or conflicting instructions = degraded performance similar to GPT-5.\n",
81-
"- **Control language**: Pin output to a target language if you see drift.\n",
80+
"- **Control language**: Pin output to a target language if you see unwanted language switching.\n",
8281
"- **Fight repetition**: Add a Variety rule to reduce robotic phrasing.\n"
8382
]
8483
},
@@ -520,6 +519,7 @@
520519
"metadata": {},
521520
"source": [
522521
"## Language Constraint\n",
522+
"Language constraints ensure the model consistently responds in the intended language, even in challenging conditions like background noise or multilingual inputs.\n",
523523
"\n",
524524
"- **When to use**: To prevent accidental language switching in multilingual or noisy environments.\n",
525525
"- **What it does**: Locks output to the chosen language to prevent accidental language changes.\n",
@@ -617,7 +617,7 @@
617617
"metadata": {},
618618
"source": [
619619
"## Reduce Repetition\n",
620-
"Prevents “robotic” outputs by encouraging varied phrasing while preserving meaning and brand voice.\n",
620+
"The realtime model can follow sample phrases closely to stay on-brand, but it may overuse them, making responses sound robotic or repetitive. Adding a repetition rule helps maintain variety while preserving clarity and brand voice.\n",
621621
"\n",
622622
"- **When to use**: Outputs recycle the same openings, fillers, or sentence patterns across turns or sessions.\n",
623623
"- **What it does**: Adds a variety constraint—discourages repeated phrases, nudges synonyms and alternate sentence structures, and keeps required terms intact.\n",
@@ -657,7 +657,7 @@
657657
"id": "7d0da635",
658658
"metadata": {},
659659
"source": [
660-
"This is the responses **before** applying the instruction using `gpt-realtime`\n",
660+
"This is the responses **before** applying the instruction using `gpt-realtime`. The model repeats the same confirmation `Got it`.\n",
661661
"\n",
662662
"<img\n",
663663
" src=\"../images/repeat_before.png\"\n",
@@ -818,7 +818,7 @@
818818
"id": "f5bc3747",
819819
"metadata": {},
820820
"source": [
821-
"If you are following a conversation flow prompting strategy, you can specify which conversation state needs to apply the alpha-numeric pronunciations instruction.\n",
821+
"*Tip: If you are following a conversation flow prompting strategy, you can specify which conversation state needs to apply the alpha-numeric pronunciations instruction.*\n",
822822
"\n",
823823
"### Example \n",
824824
"*(taken from the conversation flow of the prompt of our [openai-realtime-agents](https://github.com/openai/openai-realtime-agents/blob/main/src/app/agentConfigs/customerServiceRetail/authentication.ts))*\n",
@@ -882,7 +882,7 @@
882882
"metadata": {},
883883
"source": [
884884
"## Instruction Following\n",
885-
"Like 4.1, if the instructions are conflicting, ambiguous or not clear, Realtime models will perform worse\n",
885+
"Like GPT-4.1 and GPT-5, if the instructions are conflicting, ambiguous or not clear, the new realtime model will perform worse\n",
886886
"\n",
887887
"- **When to use**: Outputs drift from rules, skip phases, or misuse tools.\n",
888888
"- **What it does**: Uses an LLM to point out ambiguity, conflicts, and missing definitions before you ship.\n"
@@ -895,7 +895,7 @@
895895
"source": [
896896
"### **Instructions Quality Prompt (can be used in ChatGPT or with API)**\n",
897897
"\n",
898-
"Use the following prompt to identify problematic areas in your prompt that you can fix.\n",
898+
"Use the following prompt with GPT-5 to identify problematic areas in your prompt that you can fix.\n",
899899
"\n",
900900
"```\n",
901901
"## Role & Objective \n",
@@ -930,6 +930,29 @@
930930
"```"
931931
]
932932
},
933+
{
934+
"cell_type": "markdown",
935+
"id": "e823fcd9",
936+
"metadata": {},
937+
"source": [
938+
"### **Prompt Optimization Meta Prompt (can be used in ChatGPT or with API)**\n",
939+
"\n",
940+
"This meta-prompt helps you improve your base system prompt by targeting a specific failure mode. Provide the current prompt and describe the issue you’re seeing, the model (GPT-5) will suggest refined variants that tighten constraints and reduce the problem.\n",
941+
"\n",
942+
"```\n",
943+
"Here's my current prompt to an LLM:\n",
944+
"[BEGIN OF CURRENT PROMPT]\n",
945+
"{CURRENT_PROMPT}\n",
946+
"[END OF CURRENT PROMPT]\n",
947+
" \n",
948+
"But I see this issue happening from the LLM:\n",
949+
"[BEGIN OF ISSUE]\n",
950+
"{ISSUE}\n",
951+
"[END OF ISSUE]\n",
952+
"Can you provide some variants of the prompt so that the model can better understand the constraints to alleviate the issue?\n",
953+
"```"
954+
]
955+
},
933956
{
934957
"cell_type": "markdown",
935958
"id": "e9d05945",

0 commit comments

Comments
 (0)