anthropics / anthropics/courses

anthropic_api_fundamentals notebooks reference retired model IDs and an outdated API-error demo

Aperta
#181 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
22.8k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

1. Outdated/retired model ID throughout the notebooks

Multiple notebooks in anthropic_api_fundamentals hardcode claude-3-haiku-20240307, which Anthropic deprecated Feb 19, 2026 and fully retired April 20, 2026 ([model deprecations docs](https://platform.claude.com/docs/en/about-claude/model-deprecations)). Any learner running these notebooks today hits an immediate NotFoundError on the first API call.

Confirmed in 02_messages_format.ipynb — 7 code cells (roughly cells 5, 11, 21, 23, 26, 30, 33 in the current notebook) use the retired ID. Likely present in 01_getting_started.ipynb and later notebooks (03_models, 04_parameters, etc.) too.

Suggested fix: replace with claude-haiku-4-5-20251001 (Anthropic's documented replacement), and ideally define the model ID once as a variable near the top of each notebook rather than repeating the literal string, so future retirements are a one-line fix.

2. "Mistake #2: improperly alternating messages" no longer demonstrates an error

In 02_messages_format.ipynb, the "Message list mistakes" section sends a messages list ending in two consecutive assistant messages, expecting the API to raise a validation error (the lesson's whole point). That's no longer what happens: Anthropic's API now silently merges consecutive same-role turns into one turn instead of erroring (confirmed via Anthropic's own docs, quoted in [anthropic-sdk-typescript#565](https://github.com/anthropics/anthropic-sdk-typescript/issues/565)). Since the merged conversation now ends on an assistant turn, the call is treated as a prefill continuation instead — and in practice this returns a response with an empty content list, so the cell fails with IndexError: list index out of range on response.content[0].text rather than the intended API error.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with 02_messages_format.ipynb, then search 01_getting_started.ipynb and the later notebooks for the retired model ID. Run the affected cells and inspect the “Message list mistakes” section; done means the notebooks no longer call the retired model and that example no longer fails with IndexError under the current API behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
jupyter-notebook
Ambito
content, documentation
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
64/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.