copyWith method

ToolChoice copyWith({
  1. ToolChoiceMode? mode,
})

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

Implementation

ToolChoice copyWith({
  ToolChoiceMode? mode,
}) =>
    ToolChoice.fromJson({
      ...toJson(),
      if (mode != null) 'mode': $encode(mode),
    });