pub struct CompletionRequest {Show 16 fields
pub model: String,
pub prompt: Option<Value>,
pub suffix: Option<String>,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub n: Option<i32>,
pub stream: Option<bool>,
pub logprobs: Option<u32>,
pub echo: Option<bool>,
pub stop: Option<StopSequence>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub best_of: Option<i32>,
pub logit_bias: Option<HashMap<String, i32>>,
pub user: Option<String>,
}Expand description
Represents a request payload for the Completions API.
This structure includes various optional and required fields that configure the behavior of the text generation process.
Fields§
§model: StringID of the model to use.
prompt: Option<Value>The prompt(s) to generate completions for.
Can be a string, an array of strings, or null.
suffix: Option<String>The suffix that comes after the generated completion.
max_tokens: Option<u32>The maximum number of tokens to generate.
temperature: Option<f32>Sampling temperature to use. Higher values make output more random.
top_p: Option<f32>Nucleus sampling probability.
n: Option<i32>Number of completions to generate for each prompt.
stream: Option<bool>Whether to stream back partial progress.
logprobs: Option<u32>Include the log probabilities of the top tokens.
echo: Option<bool>Echo back the prompt in addition to the completion.
stop: Option<StopSequence>Sequences where the API will stop generating further tokens.
presence_penalty: Option<f32>Penalizes repeated tokens based on presence.
frequency_penalty: Option<f32>Penalizes repeated tokens based on frequency.
best_of: Option<i32>Generates best_of completions server-side and returns the best one.
logit_bias: Option<HashMap<String, i32>>Modifies the likelihood of specified tokens appearing in the completion.
user: Option<String>A unique identifier representing the end-user.