pub struct GenerateRequest<'input> {Show 15 fields
pub prompt: &'input str,
pub model: Option<GenerateModel>,
pub max_tokens: Option<u32>,
pub preset: Option<String>,
pub temperature: Option<f64>,
pub num_generations: Option<u8>,
pub k: Option<u64>,
pub p: Option<f64>,
pub frequency_penalty: Option<f64>,
pub presence_penalty: Option<f64>,
pub end_sequences: Option<Vec<String>>,
pub stop_sequences: Option<Vec<String>>,
pub return_likelihoods: Option<ReturnLikelihoods>,
pub logit_bias: Option<HashMap<u64, f32>>,
pub truncate: Option<Truncate>,
}
Fields§
§prompt: &'input str
Represents the prompt or text to be completed.
model: Option<GenerateModel>
optional - The model to use for text generation. Custom models can also be supplied with their full ID.
max_tokens: Option<u32>
optional - Denotes the number of tokens to predict per generation.
preset: Option<String>
optional - The ID of a custom playground preset.
temperature: Option<f64>
optional - A non-negative float that tunes the degree of randomness in generation.
num_generations: Option<u8>
optional - Denotes the maximum number of generations that will be returned. Defaults to 1, max value of 5.
k: Option<u64>
optional - If set to a positive integer, it ensures only the top k most likely tokens are considered for generation at each step. Defaults to 0 (disabled)
p: Option<f64>
optional - If set to a probability 0.0 < p < 1.0, it ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. If both k and p are enabled, p acts after k. Max value of 1.0. Defaults to 0.75.
frequency_penalty: Option<f64>
optional - Can be used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation. Max value of 1.0. Defaults to 0.0.
presence_penalty: Option<f64>
optional - Can be used to reduce repetitiveness of generated tokens. Similar to frequency_penalty, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies. Max value of 1.0. Defaults to 0.0.
end_sequences: Option<Vec<String>>
optional - The generated text will be cut at the beginning of the earliest occurrence of an end sequence. The sequence will be excluded from the text.
stop_sequences: Option<Vec<String>>
optional - The generated text will be cut at the end of the earliest occurrence of a stop sequence. The sequence will be included the text.
return_likelihoods: Option<ReturnLikelihoods>
optional - One of GENERATION|ALL|NONE to specify how and if the token likelihoods are returned with the response. If GENERATION is selected, the token likelihoods will only be provided for generated text. If ALL is selected, the token likelihoods will be provided both for the prompt and the generated text.
logit_bias: Option<HashMap<u64, f32>>
optional - Used to prevent the model from generating unwanted tokens or to incentivize it to include desired tokens A map of tokens to biases where bias is a float between -10 and +10 Negative values will disincentivize that token from appearing while positives values will incentivize them Tokens can be obtained from text using the tokenizer Note: logit bias may not be supported for all finetune models
truncate: Option<Truncate>
optional - Specify how the API will handle inputs longer than the maximum token length. Passing START will discard the start of the input. END will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model. If NONE is selected, when the input exceeds the maximum input token length an error will be returned.