Loading exercise...

Exercise: Answer Every Tool Call

If this is your first coding exercise on RealJS, then this tab shows you how the editor, the tests, and the hints work together.

How Coding Exercises Work

A coding exercise runs right here in your browser. You write your code in the editor above, then click Run Tests or press Ctrl+Enter (Cmd+Enter on macOS). Automated tests run your code and mark each test as passed or failed. The exercises in this course never call a real model, so you don’t need an API key for them. In this exercise, askWithTools() is a stand-in that plays scripted replies.

Run the tests early and often, even before you change anything. A failing test’s message tells you what the tests found and what they expected, so read it before you edit. Fix the first failing test, then run the tests again. A different failing test usually means you’ve made progress!

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.