copyWith method
A copy with the given properties replaced; everything else, unknown keys included, is kept.
Implementation
CreateMessageResult copyWith({
Map<String, Object?>? meta,
List<SamplingMessageContentBlock>? content,
String? model,
Role? role,
String? stopReason,
}) =>
CreateMessageResult.fromJson({
...toJson(),
if (meta != null) '_meta': $encode(meta),
if (content != null) 'content': (content.length == 1 ? $encode(content.single) : $encode(content)),
if (model != null) 'model': $encode(model),
if (role != null) 'role': $encode(role),
if (stopReason != null) 'stopReason': $encode(stopReason),
});