llm_wire/generation

Reusable generation controls, independent of model, messages and output. Values are immutable and allocate no runtime resources. Setters retain input values; llm_wire.prepare validates them against the selected provider. Applying llm_wire.with_generation replaces every generation control.

Types

Generation controls only; no conversation, tool, credential or output state.

pub type Settings =
  @internal Settings

Values

pub fn default() -> Settings

Leave optional controls absent and stop sequences empty. Provider-specific defaults remain with the provider encoder.

pub fn with_google_cached_content(
  settings: Settings,
  name: String,
) -> Settings

Set Google’s cachedContent reference. Other built-in providers refuse it in llm_wire.prepare.

pub fn with_max_tokens(settings: Settings, max: Int) -> Settings

Set the maximum output-token count; preparation requires a positive value.

pub fn with_openai_prompt_cache_key(
  settings: Settings,
  key: String,
) -> Settings

Set OpenAI’s prompt_cache_key. Other built-in providers refuse it in llm_wire.prepare.

pub fn with_stop_sequences(
  settings: Settings,
  sequences: List(String),
) -> Settings

Set stop sequences; provider-specific admission remains in preparation.

pub fn with_temperature(
  settings: Settings,
  temperature: Float,
) -> Settings

Set sampling temperature; preparation accepts values from zero to two.

pub fn with_top_p(settings: Settings, top_p: Float) -> Settings

Set nucleus sampling probability; preparation accepts zero through one.

✨ Search Document