CompletionPrompt class sealed

The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.

Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.

Available extensions
Annotations
  • @freezed

Constructors

CompletionPrompt.fromJson(Map<String, dynamic> json)
Object construction from a JSON representation
factory
CompletionPrompt.listString(List<String> value)
A list of string prompts.
const
factory
CompletionPrompt.listTokens(List<List<int>> value)
A list of tokenized prompts.
const
factory
CompletionPrompt.string(String value)
A string prompt.
const
factory
CompletionPrompt.tokens(List<int> value)
A tokenized 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
value Object
no setterinherited

Methods

map<TResult extends Object?>({required TResult listTokens(CompletionPromptListListInt value), required TResult tokens(CompletionPromptListInt value), required TResult listString(CompletionPromptListString value), required TResult string(CompletionPromptString value)}) → TResult

Available on CompletionPrompt, provided by the CompletionPromptPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? listTokens(CompletionPromptListListInt value)?, TResult? tokens(CompletionPromptListInt value)?, TResult? listString(CompletionPromptListString value)?, TResult? string(CompletionPromptString value)?}) → TResult?

Available on CompletionPrompt, provided by the CompletionPromptPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult listTokens(CompletionPromptListListInt value)?, TResult tokens(CompletionPromptListInt value)?, TResult listString(CompletionPromptListString value)?, TResult string(CompletionPromptString value)?, required TResult orElse()}) → TResult

Available on CompletionPrompt, provided by the CompletionPromptPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult listTokens(List<List<int>> value)?, TResult tokens(List<int> value)?, TResult listString(List<String> value)?, TResult string(String value)?, required TResult orElse()}) → TResult

Available on CompletionPrompt, provided by the CompletionPromptPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this CompletionPrompt to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult listTokens(List<List<int>> value), required TResult tokens(List<int> value), required TResult listString(List<String> value), required TResult string(String value)}) → TResult

Available on CompletionPrompt, provided by the CompletionPromptPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? listTokens(List<List<int>> value)?, TResult? tokens(List<int> value)?, TResult? listString(List<String> value)?, TResult? string(String value)?}) → TResult?

Available on CompletionPrompt, provided by the CompletionPromptPatterns extension

A variant of when that fallback to returning null

Operators

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