pub struct CreateChatCompletionRequest {Show 33 fields
pub messages: Vec<ChatCompletionRequestMessage>,
pub model: String,
pub mm_processor_kwargs: Option<Value>,
pub store: Option<bool>,
pub reasoning_effort: Option<ReasoningEffort>,
pub metadata: Option<Value>,
pub frequency_penalty: Option<f32>,
pub logit_bias: Option<HashMap<String, Value>>,
pub logprobs: Option<bool>,
pub top_logprobs: Option<u8>,
pub max_tokens: Option<u32>,
pub max_completion_tokens: Option<u32>,
pub n: Option<u8>,
pub modalities: Option<Vec<ResponseModalities>>,
pub prediction: Option<PredictionContent>,
pub audio: Option<ChatCompletionAudio>,
pub presence_penalty: Option<f32>,
pub response_format: Option<ResponseFormat>,
pub seed: Option<i64>,
pub service_tier: Option<ServiceTier>,
pub stop: Option<Stop>,
pub stream: Option<bool>,
pub stream_options: Option<ChatCompletionStreamOptions>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub tools: Option<Vec<ChatCompletionTool>>,
pub tool_choice: Option<ChatCompletionToolChoiceOption>,
pub parallel_tool_calls: Option<bool>,
pub user: Option<String>,
pub prompt_cache_key: Option<String>,
pub function_call: Option<ChatCompletionFunctionCall>,
pub functions: Option<Vec<ChatCompletionFunctions>>,
pub web_search_options: Option<WebSearchOptions>,
}Expand description
Chat completion request with multimodal processor support.
Extends upstream CreateChatCompletionRequest with:
mm_processor_kwargs: multimodal processor configuration (vLLM-specific)- Uses our extended
ChatCompletionRequestMessage(with reasoning, video/audio) - Uses our extended
ChatCompletionStreamOptions(with continuous_usage_stats)
Fields§
§messages: Vec<ChatCompletionRequestMessage>§model: String§mm_processor_kwargs: Option<Value>Multimodal processor configuration (vLLM-specific)
store: Option<bool>§reasoning_effort: Option<ReasoningEffort>§metadata: Option<Value>§frequency_penalty: Option<f32>§logit_bias: Option<HashMap<String, Value>>§logprobs: Option<bool>§top_logprobs: Option<u8>§max_tokens: Option<u32>max_completion_tokens: Option<u32>§n: Option<u8>§modalities: Option<Vec<ResponseModalities>>§prediction: Option<PredictionContent>§audio: Option<ChatCompletionAudio>§presence_penalty: Option<f32>§response_format: Option<ResponseFormat>§seed: Option<i64>§service_tier: Option<ServiceTier>§stop: Option<Stop>§stream: Option<bool>§stream_options: Option<ChatCompletionStreamOptions>§temperature: Option<f32>§top_p: Option<f32>§tools: Option<Vec<ChatCompletionTool>>§tool_choice: Option<ChatCompletionToolChoiceOption>§parallel_tool_calls: Option<bool>§user: Option<String>§prompt_cache_key: Option<String>OpenAI cache-affinity hint: requests sharing a prompt prefix send the same key (Kimi Code CLI sends its session id on every request).
NOTICE: accepted and preserved only. Nothing in this crate or in Dynamo acts on it yet — Dynamo’s KV-aware router keys on prompt-prefix block hashes, not on this value.
function_call: Option<ChatCompletionFunctionCall>functions: Option<Vec<ChatCompletionFunctions>>web_search_options: Option<WebSearchOptions>Implementations§
Source§impl CreateChatCompletionRequest
impl CreateChatCompletionRequest
Sourcepub fn dynamic_system_tools(&self) -> impl Iterator<Item = &Value>
pub fn dynamic_system_tools(&self) -> impl Iterator<Item = &Value>
Kimi-style dynamic tools declared on system messages, in message order.
Kimi defines these as coexisting with the top-level tools list: a
dynamic declaration keeps its position in the message history so the
prompt prefix (and any KV cache built on it) stays intact. Do not fold
them into tools; reason about the union with
Self::has_effective_tools and Self::effective_tool_contains.
Only system messages can carry tools in the typed schema; the
developer message is the upstream type and has no such field.
Sourcepub fn has_effective_tools(&self) -> bool
pub fn has_effective_tools(&self) -> bool
Whether the request declares any tool, either top-level or through a dynamic system-message declaration.
Gates that decide whether model output may be interpreted as tool
calls must use this rather than tools alone, or a call to a
dynamically declared tool is stripped from the response.
Sourcepub fn effective_tool_names(&self) -> impl Iterator<Item = &str>
pub fn effective_tool_names(&self) -> impl Iterator<Item = &str>
Names of every tool the model can see: top-level tools first, then
dynamic system-message tools in message order.
Sourcepub fn effective_tool_contains(&self, name: &str) -> bool
pub fn effective_tool_contains(&self, name: &str) -> bool
Whether name is declared anywhere in the effective tool set.
Use this to validate a named tool_choice so a forced call to a
dynamically declared tool is not rejected as “not present in tools”.
Trait Implementations§
Source§impl Clone for CreateChatCompletionRequest
impl Clone for CreateChatCompletionRequest
Source§fn clone(&self) -> CreateChatCompletionRequest
fn clone(&self) -> CreateChatCompletionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more