llm apis — talking to claude and openai7 / 9
messages, roles, and the response — the call ai ships every time
AI assumed the response had a top-level text field, but Anthropic
returns text nested inside content[0]. The script crashes with a
KeyError. Fix line 11 so it prints the reply.
Expected output:
All tests pass.
The break is on line 11 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _