Struct openai_flows::completion::CompletionRequest
source · pub struct CompletionRequest {
pub model: String,
pub prompt: String,
pub suffix: Option<String>,
pub n: u8,
pub best_of: u8,
pub max_tokens: u16,
pub temperature: f32,
pub top_p: f32,
pub logprobs: Option<u8>,
pub presence_penalty: f32,
pub frequency_penalty: f32,
}Expand description
Request struct for the completion.
The default model is “text-davinci-003”.
For more detail about parameters, please refer to OpenAI docs
Fields§
§model: StringThe ID or name of the model to use for completion.
prompt: StringThe text to be used as the prompt for completion.
suffix: Option<String>An optional suffix to append to the prompt before completion.
n: u8The number of completions to generate.
best_of: u8The number of completions to consider and return the best from.
max_tokens: u16The maximum number of tokens in the generated completions.
temperature: f32Controls the randomness of the generated completions.
top_p: f32Nucleus sampling: controls the diversity of the generated completions.
logprobs: Option<u8>Whether to include log probabilities for each token in the completions.
presence_penalty: f32Penalty to discourage the model from generating repetitive completions.
frequency_penalty: f32Penalty to discourage the model from using low-frequency words in completions.