Signal · Methods

signal.stream

signal.stream(prompt) runs the same request as .complete() and returns an async iterable of events: tool_start, tool_end, text for each chunk, retry, and a final done that carries the .complete() result (only its response is shown here). The model’s turns are scripted and streamed six characters per chunk; no model is called.

Prompt
'How many seats are left on Saturday?'
Scripted model turns
[
  {
    calls: [{ name: 'seatsLeft', args: '{"night":"2026-10-24"}' }],
  },
  { content: '113 seats are left.' },
]
Stream, event by event
Event
{
  type: 'tool_start',
  name: 'seatsLeft',
  args: { night: '2026-10-24' },
}
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.