pub struct ContentGenerationApiGeneratePost {Show 13 fields
pub text: String,
pub max_new_tokens: Option<i64>,
pub max_tokens: Option<i64>,
pub creativity_index: Option<f64>,
pub token_repetition_penalty: Option<f64>,
pub top_k: Option<i64>,
pub top_p: Option<f64>,
pub temperature: Option<f64>,
pub avoid_words: Option<Vec<String>>,
pub avoid_starting_words: Option<Vec<String>>,
pub stop_words: Option<Vec<String>>,
pub supplement_token: Option<String>,
pub tag: Option<String>,
}Expand description
Request for content_generation/generate/live.
Fields§
§text: StringInitial text to continue (1–500 tokens).
max_new_tokens: Option<i64>Maximum new tokens to generate (max 300); required unless max_tokens
is set.
max_tokens: Option<i64>Maximum total tokens including the input (max 1024); required unless
max_new_tokens is set.
creativity_index: Option<f64>Randomness of token selection, 0–1 (default 0.8); overrides top_k/top_p/temperature.
token_repetition_penalty: Option<f64>Penalty limiting repeated tokens, 0.5–2 (default 1).
top_k: Option<i64>Number of top tokens shortlisted per step, 1–100 (default 40); ignored
when creativity_index is set.
top_p: Option<f64>Nucleus sampling probability cutoff, 0–1 (default 0.9); ignored when
creativity_index is set.
temperature: Option<f64>Output randomness, 0–1 (default 0.7); ignored when creativity_index is
set.
avoid_words: Option<Vec<String>>Up to 50 words or phrases to avoid anywhere in the output.
avoid_starting_words: Option<Vec<String>>Up to 50 words or phrases to avoid at the start of the output.
stop_words: Option<Vec<String>>Up to 50 words or phrases that end generation.
supplement_token: Option<String>Token from a previous response to continue that generation.
tag: Option<String>User-defined task identifier (max 255 characters).
Implementations§
Source§impl ContentGenerationApiGeneratePost
impl ContentGenerationApiGeneratePost
Sourcepub fn new(text: &str) -> ContentGenerationApiGeneratePost
pub fn new(text: &str) -> ContentGenerationApiGeneratePost
Creates a request that continues the given text.