pub struct CompletionRequest {
pub system: Option<String>,
pub messages: Vec<Message>,
pub max_tokens: u32,
pub model_override: Option<String>,
pub schema: Option<Value>,
pub tools: Option<Vec<ToolRequest>>,
pub tool_choice: Option<ToolChoice>,
}Expand description
Request for a text completion from an LLM provider.
Fields§
§system: Option<String>Optional system prompt. Sent before the conversation messages.
messages: Vec<Message>Conversation messages in chronological order.
max_tokens: u32Maximum number of tokens in the response.
model_override: Option<String>Optional per-request model override.
None resolves to the client’s LlmClient::default_model at call time.
schema: Option<Value>Optional JSON schema for structured output.
Passed through to the provider as-is. Phase 166 adds a typed
complete::<T>() wrapper with schemars normalization on top of this field.
With streaming + schema, tokens arrive as raw JSON fragments — callers
must accumulate before parsing (Pitfall 1).
tools: Option<Vec<ToolRequest>>Optional tool definitions for the tool-calling dispatch loop.
Each entry’s parameters_schema must be pre-normalized via
schema::for_structured_output. Set by ToolRegistry::dispatch (D-14).
tool_choice: Option<ToolChoice>Controls how the LLM selects a tool when tools is Some.
Trait Implementations§
Source§impl Clone for CompletionRequest
impl Clone for CompletionRequest
Source§fn clone(&self) -> CompletionRequest
fn clone(&self) -> CompletionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more