toMap method

  1. @override
Map<String, dynamic> toMap()
override

Converts this ChatMessage to a map along with a type hint for deserialization.

Implementation

@override
Map<String, dynamic> toMap() => {
  ...super.toMap(),
  'content': content,
  'toolCalls': toolCalls.map((t) => t.toMap()).toList(growable: false),
  'type': 'ai',
};