CreateMessageResult.toMCP constructor
Implementation
factory CreateMessageResult.toMCP(Map<String, Object?> map) {
return CreateMessageResult(
model: map['model'] as String,
stopReason: map['stopReason'] as String?,
role: Role.to(map['role'] as String),
content: (map['content'] as List<dynamic>)
.map((e) => ContentBlock.toMCP(e as Map<String, Object?>))
.toList(),
$meta: map['_meta'] != null
? MetaObject.toMCP(map['_meta'] as Map<String, Object?>)
: null,
);
}