toJson method

Map<String, dynamic> toJson()

Converts to JSON.

Implementation

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