copyWith method

Message copyWith({
  1. String? text,
  2. bool? isUser,
  3. Uint8List? imageBytes,
  4. List<Uint8List>? images,
  5. Uint8List? audioBytes,
  6. MessageType? type,
  7. String? toolName,
  8. List<FunctionCallResponse>? toolCalls,
  9. String? toolCallId,
})

Implementation

Message copyWith({
  String? text,
  bool? isUser,
  Uint8List? imageBytes,
  List<Uint8List>? images,
  Uint8List? audioBytes,
  MessageType? type,
  String? toolName,
  List<FunctionCallResponse>? toolCalls,
  String? toolCallId,
}) {
  return Message(
    text: text ?? this.text,
    isUser: isUser ?? this.isUser,
    imageBytes: imageBytes ?? this.imageBytes,
    images: images ?? this.images,
    audioBytes: audioBytes ?? this.audioBytes,
    type: type ?? this.type,
    toolName: toolName ?? this.toolName,
    toolCalls: toolCalls ?? this.toolCalls,
    toolCallId: toolCallId ?? this.toolCallId,
  );
}