GemmaChatTemplate class

Renders Gemma 4 prompts from M.E.AI chat messages and tool declarations.

Constructors

GemmaChatTemplate()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String generated) GemmaTurn
Parses one raw generated model turn into prose plus any tool calls.
render(Iterable<ChatMessage> messages, {Iterable<AIFunctionDeclaration> tools = const <AIFunctionDeclaration>[], bool enableThinking = false, bool addGenerationPrompt = true}) GemmaPrompt
Renders messages (with optional tools) into a Gemma 4 prompt.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

channelClose → const String
channelOpen → const String
mediaMarker → const String
mtmd's default media marker. One is emitted into the prompt text per attached image; mtmd (LlamaSession evalMultimodalPrompt) splits the prompt on these and substitutes the model-specific image tokens. Matches mtmd_default_marker() ("<media>") in the vendored mtmd.h.
stopSequences → const List<String>
Stop sequences a caller passes to generation.
stringDelimiter → const String
thinkToken → const String
toolCallClose → const String
toolCallOpen → const String
toolClose → const String
toolOpen → const String
toolResponseClose → const String
toolResponseOpen → const String
turnClose → const String
turnOpen → const String