toJson method

Map<String, dynamic> toJson()

Convert capabilities to JSON

Implementation

Map<String, dynamic> toJson() {
  final result = <String, dynamic>{};

  if (tools != null) {
    result['tools'] = tools!.toJson();
  }

  if (resources != null) {
    result['resources'] = resources!.toJson();
  }

  if (prompts != null) {
    result['prompts'] = prompts!.toJson();
  }

  if (logging != null) {
    result['logging'] = logging!.toJson();
  }

  if (completions != null) {
    result['completions'] = completions!.toJson();
  }

  if (sampling != null) {
    result['sampling'] = sampling!.toJson();
  }

  if (roots != null) {
    result['roots'] = roots!.toJson();
  }

  if (progress != null) {
    result['progress'] = progress!.toJson();
  }

  return result;
}