Update prompt-engineering materials for the rewritten tutorial - #851
Draft
realpython-bot wants to merge 1 commit into
Draft
realpython-bot wants to merge 1 commit into
realpython-bot wants to merge 1 commit into
Conversation
The tutorial has been rewritten around a different project. It now classifies support conversations against an explicit follow-up policy using the Responses API with structured output, and evaluates prompts against development and held-out cases. Replace the old sentiment/sanitizing project (app.py, settings.toml, chats.txt and friends) with the new one: - classify.py, try_prompt.py, cases.py, evaluate.py, evaluate_test.py - baseline.txt, policy.txt, examples.txt - requirements.txt pinned to openai==3.14.1 and pydantic==2.13.5 - README rewritten for the new project All scripts were run against the live API on Python 3.14.7. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Materials for the Prompt Engineering: A Practical Example full update (Trello 1513, CMS post 2143).
Draft on purpose
Don't merge until the updated tutorial goes live. The current live article still documents the old project, so merging this now would break it.
What changed
The tutorial was rewritten around a different project, so this replaces the folder's contents rather than editing them.
Removed (old sentiment-analysis/sanitizing project):
app.py,settings.toml,settings-final.toml,chats.txt,sanitized-chats.txt,testing-chats.txt,sanitized-testing-chats.txtAdded:
classify.pytry_prompt.pycases.pyevaluate.pyevaluate_test.pybaseline.txt/policy.txt/examples.txtUpdated:
README.mdrewritten for the new project,requirements.txtpinned toopenai==3.14.1andpydantic==2.13.5(wasopenai==1.13.3).Verification
Every script was run against the live OpenAI API on Python 3.14.7, using the files exactly as committed:
try_prompt.py-> correct labelevaluate.py baseline.txt-> 5/6 labelsevaluate.py policy.txt-> 6/6 labelsevaluate.py examples.txt-> 6/6 labelsevaluate_test.py policy.txt-> 4/4 labelsExact-quote scores vary between runs, which is the point the tutorial makes about rerunning a comparison before attributing a difference to your prompt.
Note on model pinning
classify.pyuses thegpt-5.6-lunaalias. The 5.6 and 6 families currently have no dated snapshots (confirmed viaclient.models.list()), so there's nothing to pin to. The scripts record which model answered each request instead, and the README explains the alias/snapshot distinction.🤖 Generated with Claude Code