Skip to content

Replace retired Claude model ids in the Anthropic examples and README - #1454

Open
kasparovabi wants to merge 1 commit into
AgentOps-AI:mainfrom
kasparovabi:chore/opus5-compat
Open

kasparovabi wants to merge 1 commit into
AgentOps-AI:mainfrom
kasparovabi:chore/opus5-compat

Conversation

@kasparovabi

Copy link
Copy Markdown

📥 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.

Where Was Now Retired on
examples/anthropic/agentops-anthropic-understanding-tools.py and .ipynb (4 calls each) claude-3-7-sonnet-20250219 claude-sonnet-5 19 February 2026
examples/anthropic/anthropic-example-sync.py and .ipynb (1 call each) claude-3-7-sonnet-20250219 claude-sonnet-5 19 February 2026
examples/anthropic/anthropic-example-async.py and .ipynb (1 call each) claude-3-7-sonnet-20250219 claude-sonnet-5 19 February 2026
README.md Anthropic sync, streaming and async snippets (3 calls) claude-3-opus-20240229 claude-opus-5 5 January 2026

Dates are from https://platform.claude.com/docs/en/about-claude/model-deprecations. The notebooks and the .py files were changed together so they keep matching. None of the calls pass temperature, top_p or top_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.mdx carries the same ids but is generated from the notebook by add-notebook-examples-to-docs.yml on push to main, so editing it here would only create a conflict with that workflow. llms.txt is likewise generated by compile-llms-txt.yml. The tests/ fixtures, VCR recordings and test_attributes.py reference old ids as recorded data and still work as tests. docs/v2/integrations/anthropic.mdx uses claude-sonnet-4-20250514 and claude-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.yml runs 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 that git diff shows only the model= 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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant