class ExecutionEvent {
  final String promptId;
  final int timestamp;
  final String? node;
  final Map<String, dynamic>? extra;

  const ExecutionEvent({
    required this.promptId,
    required this.timestamp,
    this.node,
    this.extra,
  });

  factory ExecutionEvent.fromJson(Map<String, dynamic> json) {
    return ExecutionEvent(
      promptId: json['prompt_id'] as String,
      timestamp: json['timestamp'] as int,
      node: json['node'] as String?,
      extra: json['extra'] as Map<String, dynamic>?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'prompt_id': promptId,
      'timestamp': timestamp,
      'node': node,
      'extra': extra,
    };
  }
}
