Skip to main content

apply_options

Function apply_options 

Source
pub fn apply_options(body: &mut Map<String, Value>, options: &ChatOptions)
Expand description

Apply the scalar ChatOptions fields Mistral’s Chat Completions API actually supports onto a request body map.

Deliberately narrower than [agent_framework_openai::convert::apply_options]:

  • temperature, top_p, max_tokens, stop, frequency_penalty, presence_penalty, response_format, and tool_choice-adjacent parallel_tool_calls map straight across (documented Mistral request fields).
  • seed maps to Mistral’s differently-named random_seed field rather than OpenAI’s seed.
  • store, metadata, logit_bias, and user have no Mistral Chat Completions equivalent and are skipped gracefully (never sent) instead of being forwarded as unrecognized fields.