toJson method
Converts the request to a JSON map.
Implementation
Map<String, dynamic> toJson() => {
'messages': [
{
'role': 'system',
'content': [
{
'type': 'text',
'text':
'''You are an AI assistant that helps people find information.''',
}
],
},
],
if (maxTokens != null) 'max_tokens': maxTokens,
if (temperature != null) 'temperature': temperature,
if (topP != null) 'top_p': topP,
};