discontinuedPackage flutter_gemma has been discontinued and replaced by flutter_edge_ai.

ChatMessage constructor

ChatMessage({
  1. required ChatMessageRole role,
  2. List<StandardPart> parts = const [],
  3. Map<String, Object?> metadata = const {},
  4. FinishStatus? finishStatus,
})

Creates a new message.

If parts or metadata are not provided, empty collections are used.

If there are no parts of type TextPart, the text property will be empty.

If there is more than one part of type TextPart, the text property will be a concatenation of all of them.

Implementation

ChatMessage({
  required this.role,
  this.parts = const [],
  this.metadata = const {},
  this.finishStatus,
});