toJson method
Serializes to the JSON map shape (round-trips with fromJsonMap).
Implementation
Map<String, Object?> toJson() => {
'provider_type': providerType,
'provider_config': {
'model': model,
if (baseUrl != null) 'baseUrl': baseUrl,
if (apiKeyEnv != null) 'apiKeyEnv': apiKeyEnv,
if (contextWindow != null) 'contextWindow': contextWindow,
if (maxTokens != null) 'maxTokens': maxTokens,
},
};