StepDetails.fromJson constructor
Creates a StepDetails from JSON.
Implementation
factory StepDetails.fromJson(Map<String, dynamic> json) {
final type = json['type'] as String;
return switch (type) {
'message_creation' => MessageCreationDetails.fromJson(json),
'tool_calls' => ToolCallsDetails.fromJson(json),
_ => throw FormatException('Unknown step type: $type'),
};
}