AlpacaFormat class

Implementation of the Alpaca prompt format. Structure:

Instruction:

{system}

Input:

{user}

Response:

{model}

Inheritance

Constructors

AlpacaFormat({String defaultSystemPrompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request."})

Properties

defaultSystemPrompt String
Alpaca models often expect a specific default system prompt if none is provided.
final
hashCode int
The hash code for this object.
no setterinherited
inputSequence String
finalinherited
outputSequence String
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stopSequence String?
finalinherited
systemSequence String
finalinherited
type PromptFormatType
finalinherited

Methods

formatMessages(List<Map<String, dynamic>> messages) String
Formats a list of messages into a full conversation string. Subclasses should override this for specific logic (e.g. handling newlines or special tags).
override
formatPrompt(String prompt) String
Formats a single prompt (User -> Assistant).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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