The tools namespace
clear(); unregister by name.
Defining a tool
Controlling the loop
tools.register are offered to every generation. Tools passed in
options.tools apply to that call alone.
Watching the calls happen
The stream reports tool activity, which is what lets you show “checking the weather…” rather than a stalled cursor:capabilities().tools reports { registry: true, parallel: false, cancellation: false } on
Web, so tools run one at a time.
Executors run in the page
Your executor is ordinary page code, so it has the network, storage, and DOM. That also means it is subject to CORS: afetch to an origin that does not allow you will fail inside the
tool loop, and the model will see the failure rather than an answer.