toJson method
Implementation
@override
Object toJson() => {
'agentId': ?agentId,
if (agentType.isNotDefault) 'agentType': agentType,
if (description.isNotDefault) 'description': description,
if (instruction.isNotDefault) 'instruction': instruction,
if (tools.isNotDefault) 'tools': [for (final i in tools) i.toJson()],
if (subAgents.isNotDefault) 'subAgents': subAgents,
};