pub struct ChatRequest {
pub messages: Vec<ChatMessage>,
pub model: String,
pub max_output_tokens: u32,
pub sampling: Option<SamplingParameters>,
pub tools: Option<Vec<ToolDefinition>>,
pub response_schema: Option<Value>,
}Fields§
§messages: Vec<ChatMessage>§model: String§max_output_tokens: u32§sampling: Option<SamplingParameters>§tools: Option<Vec<ToolDefinition>>§response_schema: Option<Value>Implementations§
Source§impl ChatRequest
impl ChatRequest
pub fn new( messages: Vec<ChatMessage>, model: impl Into<String>, max_output_tokens: u32, ) -> ChatRequest
pub const fn with_sampling(self, sampling: SamplingParameters) -> ChatRequest
pub fn with_tools(self, tools: Vec<ToolDefinition>) -> ChatRequest
pub fn with_response_schema(self, schema: Value) -> ChatRequest
Trait Implementations§
Source§impl Clone for ChatRequest
impl Clone for ChatRequest
Source§fn clone(&self) -> ChatRequest
fn clone(&self) -> ChatRequest
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 moreAuto Trait Implementations§
impl Freeze for ChatRequest
impl RefUnwindSafe for ChatRequest
impl Send for ChatRequest
impl Sync for ChatRequest
impl Unpin for ChatRequest
impl UnwindSafe for ChatRequest
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