toJson method
Everything except the API key, which must never be stored with it.
Implementation
Map<String, Object?> toJson() => {
'id': id,
'name': name,
'protocol': protocol.name,
'baseUrl': baseUrl,
'model': model,
'presetId': ?presetId,
'structuredOutput': structuredOutput.name,
'maxTokensField': maxTokensField.name,
};