toJson method

Map<String, dynamic> toJson()

The wire JSON (type: 'user', message: {role, content}, …).

Implementation

Map<String, dynamic> toJson() => {
  'type': 'user',
  'message': {'role': 'user', 'content': content},
  'parent_tool_use_id': null,
  'session_id': '',
  if (uuid != null) 'uuid': uuid,
};