Llama3ChatTemplate class
Renders Llama 3 prompts from M.E.AI chat messages and tool declarations.
Constructors
- Llama3ChatTemplate()
-
Creates a Llama3ChatTemplate.
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) → ParsedTurn - Parses one raw generated turn into prose plus any tool calls.
-
render(
Iterable< ChatMessage> messages, {Iterable<AIFunctionDeclaration> tools = const <AIFunctionDeclaration>[], bool addGenerationPrompt = true}) → RenderedPrompt -
Renders
messages(with optionaltools) into a Llama 3 prompt. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- eom → const String
- eot → const String
- headerEnd → const String
- headerStart → const String
- Header and turn markers.
- mediaMarker → const String
- The shared mtmd media marker; one is emitted per attached image.
- pythonTag → const String
- Marker that prefixes a tool call.
-
stopSequences
→ const List<
String> -
Stop sequences: a normal turn ends with
<|eot_id|>; a tool-call turn ends with<|eom_id|>.