toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
  'categories': categories.map((c) => c.toJson()).toList(),
  'totalTokens': totalTokens,
  'maxTokens': maxTokens,
  'rawMaxTokens': rawMaxTokens,
  'percentage': percentage,
  'gridRows': gridRows
      .map((row) => row.map((s) => s.toJson()).toList())
      .toList(),
  'model': model,
  'memoryFiles': memoryFiles.map((m) => m.toJson()).toList(),
  'mcpTools': mcpTools.map((t) => t.toJson()).toList(),
  if (deferredBuiltinTools != null)
    'deferredBuiltinTools': deferredBuiltinTools!
        .map((t) => t.toJson())
        .toList(),
  if (systemTools != null)
    'systemTools': systemTools!.map((t) => t.toJson()).toList(),
  if (systemPromptSections != null)
    'systemPromptSections': systemPromptSections!
        .map((s) => s.toJson())
        .toList(),
  'agents': agents.map((a) => a.toJson()).toList(),
  if (slashCommands != null) 'slashCommands': slashCommands!.toJson(),
  if (skills != null) 'skills': skills!.toJson(),
  if (autoCompactThreshold != null)
    'autoCompactThreshold': autoCompactThreshold,
  'isAutoCompactEnabled': isAutoCompactEnabled,
  if (messageBreakdown != null)
    'messageBreakdown': messageBreakdown!.toJson(),
  if (apiUsage != null) 'apiUsage': apiUsage!.toJson(),
};