Skip to main content
Support assistant tutorial This checkpoint returns to the read-only order tool. Text goes to stdout; the tool-start event goes to stderr. This makes tool use visible without treating it as user-facing answer text.

Complete checkpoint

support.ts

Run it

Verify the result

You should see a lookup_order diagnostic and incremental response text reporting Friday. Providers can buffer chunks, so visible token-by-token timing varies. Consume the iterator until it ends. A finish chunk can finish one model call while the Agent still has tools to run. Do not break the loop on the first finish chunk. An iterator error must reach your request handler. On an HTTP disconnect, abort the run and release the iterator; cancellation does not undo a tool that already completed. Read the execution lifecycle and observability guide before connecting logs to an external destination.

Expose an HTTP API

Continue to the next chapter.