pub struct CompletionRequest {Show 15 fields
pub instructions: String,
pub role: Option<String>,
pub chat_history: Vec<Message>,
pub raw_history: Vec<Json>,
pub documents: Documents,
pub prompt: String,
pub content: Vec<ContentPart>,
pub tools: Vec<FunctionDefinition>,
pub tool_choice_required: bool,
pub temperature: Option<f64>,
pub max_output_tokens: Option<usize>,
pub output_schema: Option<Json>,
pub stop: Option<Vec<String>>,
pub model: Option<String>,
pub effort: Option<ModelEffort>,
}Expand description
Provider-neutral completion request.
Fields§
§instructions: StringSystem instructions sent to the completion provider.
role: Option<String>Role used for prompt and content; defaults to user when omitted.
chat_history: Vec<Message>The chat history to be sent to the completion model provider.
raw_history: Vec<Json>Provider-specific history used by model adapters. It is empty for most callers.
documents: DocumentsThe documents to embed into the prompt.
prompt: StringPrompt sent to the completion provider using role.
It can be empty.
content: Vec<ContentPart>The content parts to be sent to the completion model provider. It can be empty.
tools: Vec<FunctionDefinition>The tools to be sent to the completion model provider.
tool_choice_required: boolWhether the tool choice is required.
temperature: Option<f64>Sampling temperature requested from the provider, usually in the [0.0, 2.0] range.
max_output_tokens: Option<usize>Upper bound for the number of tokens that can be generated for a response.
output_schema: Option<Json>An object specifying the JSON format that the model must output.
stop: Option<Vec<String>>The stop sequence to be sent to the completion model provider.
model: Option<String>The name or label of the model to be used for the completion request.
effort: Option<ModelEffort>Optional reasoning/thinking effort for providers and models that support it.
Implementations§
Source§impl CompletionRequest
impl CompletionRequest
Sourcepub fn append_documents(self, docs: Documents) -> Self
pub fn append_documents(self, docs: Documents) -> Self
Adds multiple documents to the request.
Sourcepub fn append_tools(self, tools: Vec<FunctionDefinition>) -> Self
pub fn append_tools(self, tools: Vec<FunctionDefinition>) -> Self
Adds multiple tools to the request.
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