pub struct CompletionRequest {
pub preamble: Option<String>,
pub chat_history: OneOrMany<Message>,
pub documents: Vec<Document>,
pub tools: Vec<ToolDefinition>,
pub temperature: Option<f64>,
pub max_tokens: Option<u64>,
pub additional_params: Option<Value>,
}
Expand description
Struct representing a general completion request that can be sent to a completion model provider.
Fields§
§preamble: Option<String>
The preamble to be sent to the completion model provider
chat_history: OneOrMany<Message>
The chat history to be sent to the completion model provider. The very last message will always be the prompt (hence why there is always one)
documents: Vec<Document>
The documents to be sent to the completion model provider
tools: Vec<ToolDefinition>
The tools to be sent to the completion model provider
temperature: Option<f64>
The temperature to be sent to the completion model provider
max_tokens: Option<u64>
The max tokens to be sent to the completion model provider
additional_params: Option<Value>
Additional provider-specific parameters to be sent to the completion model provider
Implementations§
Source§impl CompletionRequest
impl CompletionRequest
Sourcepub fn normalized_documents(&self) -> Option<Message>
pub fn normalized_documents(&self) -> Option<Message>
Returns documents normalized into a message (if any).
Most providers do not accept documents directly as input, so it needs to convert into a
Message
so that it can be incorporated into chat_history
as a
Trait Implementations§
Source§impl Clone for CompletionRequest
impl Clone for CompletionRequest
Source§fn clone(&self) -> CompletionRequest
fn clone(&self) -> CompletionRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more