Converts to JSON.
Map<String, dynamic> toJson() => { 'tool_outputs': toolOutputs.map((o) => o.toJson()).toList(), if (stream != null) 'stream': stream, };