toJson method
Serializes to a JSON map.
Implementation
Map<String, dynamic> toJson() => {
if (systemPrompt != null) 'systemPrompt': systemPrompt,
'messages': messages.map((message) => message.toJson()).toList(),
if (tools != null) 'tools': tools!.map((tool) => tool.toJson()).toList(),
};