Message class

Available extensions

Constructors

Message.new({required String text, bool isUser = false, Uint8List? imageBytes, MessageType type = MessageType.text, String? toolName})
const
Message.imageOnly({required Uint8List imageBytes, bool isUser = false, String text = ''})
factory
Message.systemInfo({required String text, String? icon})
factory
Message.text({required String text, bool isUser = false})
factory
Message.thinking({required String text})
factory
Message.toolCall({required String text})
factory
Message.toolResponse({required String toolName, required Map<String, dynamic> response})
factory
Message.withImage({required String text, required Uint8List imageBytes, bool isUser = false})
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
hasImage bool
no setter
imageBytes Uint8List?
final
isUser bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
final
toolName String?
final
type MessageType
final

Methods

copyWith({String? text, bool? isUser, Uint8List? imageBytes, MessageType? type, String? toolName}) Message
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
transformToChatPrompt({ModelType type = ModelType.general, ModelFileType fileType = ModelFileType.binary}) String

Available on Message, provided by the MessageExtension extension

Operators

operator ==(Object other) bool
The equality operator.
override