CompletionPrompt class sealed
A prompt for completions.
Can be a string, list of strings, list of token IDs, or list of lists of token IDs.
Example
// Simple text prompt
final prompt = CompletionPrompt.text('Once upon a time');
// Multiple prompts
final prompt = CompletionPrompt.texts(['Hello', 'World']);
// Token IDs
final prompt = CompletionPrompt.tokens([1234, 5678]);
Constructors
- CompletionPrompt.fromJson(Object json)
-
Creates from JSON.
factory
- CompletionPrompt.text(String text)
-
Creates a single text prompt.
constfactory
-
CompletionPrompt.texts(List<
String> texts) -
Creates multiple text prompts.
constfactory
-
CompletionPrompt.tokenLists(List<
List< tokenLists)int> > -
Creates a list of token ID lists.
constfactory
-
CompletionPrompt.tokens(List<
int> tokens) -
Creates a token ID prompt.
constfactory
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
-
toJson(
) → Object - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited