CompletionRequest class

Model to use as input for code generation

model required, ID of the model to use. https://beta.openai.com/docs/models

for text generation / editing https://beta.openai.com/docs/models/gpt-3 defaults to text-davinci-003 For code generation or Edit https://beta.openai.com/docs/models/codex use "code-davinci-002" as model

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

max_token The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).

temperature What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.

Constructors

CompletionRequest({String? model = 'text-davinci-003', required String prompt, double? temperature = 0.3, int? maxTokens = 50, double? topP = 0, double? presencePenalty = 0, List<String>? stop, int? n})

Properties

hashCode int
The hash code for this object.
no setterinherited
maxTokens int?
final
model String?
final
n int?
final
presencePenalty double?
final
prompt String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stop List<String>?
final
temperature double?
final
topP double?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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