pub struct SampleRequest {Show 18 fields
pub model: Option<String>,
pub prompt: Option<SampleContent>,
pub max_tokens: Option<i32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub n: Option<i32>,
pub stream: Option<bool>,
pub stream_options: Option<StreamOptions>,
pub stop: Option<Vec<String>>,
pub presence_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub echo: Option<bool>,
pub logprobs: Option<bool>,
pub best_of: Option<i32>,
pub logit_bias: Option<Value>,
pub seed: Option<i32>,
pub suffix: Option<String>,
pub user: Option<String>,
}Expand description
(Legacy) Request for /v1/completions endpoint.
Fields§
§model: Option<String>Specifies the model to be used for the request.
prompt: Option<SampleContent>Input for generating completions.
max_tokens: Option<i32>Limits the number of tokens that can be produced in the output.
temperature: Option<f32>What sampling temperature to use, between 0 and 2.
top_p: Option<f32>An alternative to sampling with temperature, called nucleus sampling.
n: Option<i32>Determines how many completion sequences to produce for each prompt.
stream: Option<bool>Whether to stream back partial progress.
stream_options: Option<StreamOptions>Options for streaming response.
stop: Option<Vec<String>>(Not supported by reasoning models) Up to 4 sequences where the API will stop generating.
presence_penalty: Option<f32>(Not supported by grok-3 and reasoning models) Presence penalty.
frequency_penalty: Option<f32>(Unsupported) Frequency penalty.
echo: Option<bool>Option to include the original prompt in the response.
logprobs: Option<bool>Include the log probabilities on the most likely output tokens.
best_of: Option<i32>(Unsupported) Generates multiple completions internally.
logit_bias: Option<Value>(Unsupported) Logit bias.
seed: Option<i32>If specified, system will make a best effort to sample deterministically.
suffix: Option<String>(Unsupported) Optional string to append after the generated text.
user: Option<String>A unique identifier representing your end-user.
Trait Implementations§
Source§impl Clone for SampleRequest
impl Clone for SampleRequest
Source§fn clone(&self) -> SampleRequest
fn clone(&self) -> SampleRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more