Message class

Available extensions

Constructors

Message({required String text, bool isUser = false, Uint8List? imageBytes, Uint8List? audioBytes, MessageType type = MessageType.text, String? toolName})
const
Message.audioOnly({required Uint8List audioBytes, bool isUser = false, String text = ''})
factory
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.withAudio({required String text, required Uint8List audioBytes, bool isUser = false})
factory
Message.withImage({required String text, required Uint8List imageBytes, bool isUser = false})
factory

Properties

audioBytes Uint8List?
final
hasAudio bool
no setter
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, Uint8List? audioBytes, 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