PromptArgument.fromJson constructor

PromptArgument.fromJson(
  1. Map<String, dynamic> json
)

Construct from the spec JSON shape — convenient for callers that don't want to import this typed class (e.g., generic adapters).

Implementation

factory PromptArgument.fromJson(Map<String, dynamic> json) {
  return PromptArgument(
    name: json['name'] as String,
    description: (json['description'] ?? '') as String,
    required: (json['required'] ?? false) as bool,
    defaultValue: json['default'] as String?,
  );
}