PromptFormat class abstract

A class representing a LLM Prompt Format. Handles formatting of messages for specific model architectures.

Implementers

Constructors

PromptFormat(PromptFormatType type, {required String inputSequence, required String outputSequence, required String systemSequence, String? stopSequence})

Properties

hashCode int
The hash code for this object.
no setterinherited
inputSequence String
final
outputSequence String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stopSequence String?
final
systemSequence String
final
type PromptFormatType
final

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).
formatPrompt(String prompt) String
Formats a single prompt (User -> Assistant).
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