implement dynamic model name selection in course notebooks
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)
Actually I notice you have this in your client: claude-3-opus-latest etc suggest a quick swap out for that in the notebooks