toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'object': object,
    'created_at': createdAt,
    if (name != null) 'name': name,
    if (description != null) 'description': description,
    'model': model,
    if (instructions != null) 'instructions': instructions,
    'tools': tools.map((tool) => tool.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(),
  };
}