anthropics / anthropics/courses

implement dynamic model name selection in course notebooks

Open
#71 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
22.8k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

Currently in the course notebooks you have hardcoded in a model name that is deprecated resulting in a 404

tool_use\03_structured_outputs.ipynb

response = client.messages.create(
model="claude-3-sonnet-20240629", <----- no longer exists

suggest you implement something aligned to the below, where "sonnet" could be a param in a function (accepting either 'sonnet' or 'haiku' and then return the model.id:

even better would be something in the Anthropic class like Athropic().model.latest.large / Anthropic().model.latest.small or similar to protect against name changes away from 'sonnet' or 'haiku'

models = Anthropic().models.list().data
for model in models:
if "sonnet" in model.id:
print(model.id)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.