GoodMemGoodMem
ReferenceSdkRustTypes

LlmSamplingParams

Rust struct goodmem::models::LlmSamplingParams: declaration, fields or variants, and implementations.

All types

Struct LlmSamplingParams

goodmem::models::LlmSamplingParams

Sampling and generation parameters for controlling LLM text output

pub struct LlmSamplingParams {
    pub max_tokens: Option<i32>,
    pub temperature: Option<f64>,
    pub top_p: Option<f64>,
    pub top_k: Option<i32>,
    pub frequency_penalty: Option<f64>,
    pub presence_penalty: Option<f64>,
    pub stop_sequences: Option<Vec<String>>,
}

Fields

max_tokens

pub max_tokens: Option<i32>

Maximum tokens to generate (>0 if set; provider-dependent limits apply) Wire name: maxTokens.

temperature

pub temperature: Option<f64>

Sampling temperature; valid range depends on the configured provider Wire name: temperature.

top_p

pub top_p: Option<f64>

Nucleus sampling threshold 0.0-1.0 (smaller values focus on higher probability tokens) Wire name: topP.

top_k

pub top_k: Option<i32>

Top-k sampling limit (>0 if set; primarily for local/open-source models) Wire name: topK.

frequency_penalty

pub frequency_penalty: Option<f64>

Frequency penalty; valid range depends on the configured provider Wire name: frequencyPenalty.

presence_penalty

pub presence_penalty: Option<f64>

Presence penalty; valid range depends on the configured provider Wire name: presencePenalty.

stop_sequences

pub stop_sequences: Option<Vec<String>>

Generation stop sequences; generation halts on exact match Wire name: stopSequences.

Implementations

validate

pub fn validate(&self) -> crate::Result<()>

Validate the request before sending, without making an HTTP call.

Trait implementations

  • Clone (derived)
  • Default (derived)
  • PartialEq (derived)
  • Serialize (derived)
  • impl<'de> Deserialize<'de> for LlmSamplingParams
  • impl std::fmt::Debug for LlmSamplingParams

On this page