PromptValue.fromMap constructor
Convert the prompt value from a map.
Implementation
factory PromptValue.fromMap(Map<String, dynamic> map) =>
switch (map['type']) {
'string' => StringPromptValue.fromMap(map),
'chat' => ChatPromptValue.fromMap(map),
null => throw ArgumentError('Prompt value type is null'),
_ => throw ArgumentError('Unknown prompt value type ${map['type']}'),
};