toJson method

Map<String, dynamic> toJson()

Converts to JSON.

Implementation

Map<String, dynamic> toJson() => {
  'id': id,
  'object': object,
  'created_at': createdAt,
  'model': model,
  if (name != null) 'name': name,
  if (description != null) 'description': description,
  if (instructions != null) 'instructions': instructions,
  'tools': tools.map((t) => t.toJson()).toList(),
  if (toolResources != null) 'tool_resources': toolResources!.toJson(),
  'metadata': metadata,
  if (temperature != null) 'temperature': temperature,
  if (topP != null) 'top_p': topP,
  if (responseFormat != null) 'response_format': responseFormat!.toJson(),
};