promptdojo_

Messages, roles, and the response — the call AI ships every time — step 8 of 9

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

full-screen editor opens — close anytime to keep reading.