Replace retired Claude model ids in the Anthropic examples and README - #1454
Open
kasparovabi wants to merge 1 commit into
Open
kasparovabi wants to merge 1 commit into
kasparovabi wants to merge 1 commit into
Conversation
claude-3-7-sonnet-20250219 and claude-3-opus-20240229 are past their retirement dates and the API no longer serves them. Source: https://platform.claude.com/docs/en/about-claude/model-deprecations
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.
📥 Pull Request
📘 Description
The three Anthropic examples and the three Anthropic snippets in the README call model ids that Anthropic has retired, so a reader who runs them as written gets an API error instead of a trace. This swaps each id for the current model in the same tier and changes nothing else. 15 lines across 7 files, every one of them a
model=argument.examples/anthropic/agentops-anthropic-understanding-tools.pyand.ipynb(4 calls each)claude-3-7-sonnet-20250219claude-sonnet-5examples/anthropic/anthropic-example-sync.pyand.ipynb(1 call each)claude-3-7-sonnet-20250219claude-sonnet-5examples/anthropic/anthropic-example-async.pyand.ipynb(1 call each)claude-3-7-sonnet-20250219claude-sonnet-5README.mdAnthropic sync, streaming and async snippets (3 calls)claude-3-opus-20240229claude-opus-5Dates are from https://platform.claude.com/docs/en/about-claude/model-deprecations. The notebooks and the
.pyfiles were changed together so they keep matching. None of the calls passtemperature,top_portop_k, which matters because Opus 5 rejects non-default values for those, so nothing else needed to move.Left alone on purpose.
docs/v2/examples/anthropic.mdxcarries the same ids but is generated from the notebook byadd-notebook-examples-to-docs.ymlon push to main, so editing it here would only create a conflict with that workflow.llms.txtis likewise generated bycompile-llms-txt.yml. Thetests/fixtures, VCR recordings andtest_attributes.pyreference old ids as recorded data and still work as tests.docs/v2/integrations/anthropic.mdxusesclaude-sonnet-4-20250514andclaude-opus-4-20250514, which are also past retirement, but that is hand-written documentation rather than a runnable example and I did not want to widen this diff. Happy to send that separately if you want it.🧪 Testing
examples-integration-test.ymlruns these three example files on pull requests, so CI will exercise the change against the API with your key. I have not run them against the API myself. I did check that all three notebooks still parse as JSON after the edit and thatgit diffshows only themodel=lines.I read this diff line by line before opening it, and I am happy to adjust or drop any part of it. What brought me here was a checker I maintain that flags retired Claude model ids, so I am saying that up front rather than leaving you to wonder. The claim that the old ids no longer work rests on the published retirement dates, I have not reproduced the failure myself. If you would rather handle this your own way, or would rather not get this kind of contribution at all, tell me and I will not send another.