pub struct CompletionRequest {
pub model: String,
pub messages: Vec<Message>,
pub system: Option<String>,
pub tools: Option<Vec<ToolDefinition>>,
pub tool_choice: Option<ToolChoice>,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub stop: Option<Vec<String>>,
pub stream: bool,
pub metadata: Metadata,
}Fields§
§model: String§messages: Vec<Message>§system: Option<String>§tools: Option<Vec<ToolDefinition>>§tool_choice: Option<ToolChoice>§max_tokens: Option<u32>§temperature: Option<f32>§top_p: Option<f32>§stop: Option<Vec<String>>§stream: bool§metadata: MetadataImplementations§
Source§impl CompletionRequest
impl CompletionRequest
pub fn new(model: impl Into<String>, messages: Vec<Message>) -> Self
pub fn with_system(self, system: impl Into<String>) -> Self
pub fn with_tools(self, tools: Vec<ToolDefinition>) -> Self
pub fn with_tool_choice(self, choice: ToolChoice) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_top_p(self, top_p: f32) -> Self
pub fn with_stop(self, stop: Vec<String>) -> Self
pub fn streaming(self) -> Self
Trait Implementations§
Source§impl Clone for CompletionRequest
impl Clone for CompletionRequest
Source§fn clone(&self) -> CompletionRequest
fn clone(&self) -> CompletionRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletionRequest
impl Debug for CompletionRequest
Source§impl<'de> Deserialize<'de> for CompletionRequest
impl<'de> Deserialize<'de> for CompletionRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompletionRequest
impl RefUnwindSafe for CompletionRequest
impl Send for CompletionRequest
impl Sync for CompletionRequest
impl Unpin for CompletionRequest
impl UnwindSafe for CompletionRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more