run method

  1. @override
Stream<Map<String, Object?>> run(
  1. Map<String, Object?> input
)
override

Starts a run with input and streams it as decoded JSON.

Skips replayed runs, expands text and tool-call chunks, and closes after RUN_FINISHED or RUN_ERROR. An ambiguous chunk fails with a FormatException. An earlier end or stream error means the run broke. Cancelling aborts even pending response headers and waits for cleanup. Drain a stopped run to keep the agent's thread consistent.

Implementation

@override
Stream<Map<String, Object?>> run(Map<String, Object?> input) {
  _requests.add(input);
  return _play(_requests.length - 1, input);
}