llm apis — talking to claude and openai8 / 9
messages, roles, and the response — the call ai ships every time
Build the stub of a real LLM call. Write a function called ask that
takes a single string question, builds a messages list with one
user turn, calls the provided fake_create(messages) to simulate the
API, and returns the text from response["content"][0]["text"].
Then call ask("What's 2 + 2?") and print the result.
Expected output:
4
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _