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]);
Implementers

Constructors

CompletionPrompt.fromJson(Object json)
Creates from JSON.
factory
CompletionPrompt.text(String text)
Creates a single text prompt.
const
factory
CompletionPrompt.texts(List<String> texts)
Creates multiple text prompts.
const
factory
CompletionPrompt.tokenLists(List<List<int>> tokenLists)
Creates a list of token ID lists.
const
factory
CompletionPrompt.tokens(List<int> tokens)
Creates a token ID prompt.
const
factory

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