fromJson static method

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

Implementation

static MessagingChannel fromJson(Map<String, dynamic> json) {
  return MessagingChannel(
    protocol: (json['protocol'] as String?) ?? 'meshagent.agent-message.v1',
    prompts: (json['prompts'] as List?)?.map((entry) => PromptTemplate.fromJson(entry as Map<String, dynamic>)).toList(),
    annotations: json['annotations'] != null
        ? {for (final entry in (json['annotations'] as Map).entries) entry.key as String: entry.value as String}
        : null,
  );
}