copyWith method

ToolUseContent copyWith({
  1. Map<String, Object?>? meta,
  2. String? id,
  3. Map<String, Object?>? input,
  4. String? name,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

ToolUseContent copyWith({
  Map<String, Object?>? meta,
  String? id,
  Map<String, Object?>? input,
  String? name,
}) =>
    ToolUseContent.fromJson({
      ...toJson(),
      if (meta != null) '_meta': $encode(meta),
      if (id != null) 'id': $encode(id),
      if (input != null) 'input': $encode(input),
      if (name != null) 'name': $encode(name),
    });