pub struct ChatRequest {
pub messages: Vec<ChatMessage>,
pub tools: Vec<Value>,
pub reasoning: Option<ReasoningConfig>,
pub response_format: Option<ResponseFormat>,
}Expand description
Unified chat request format.
Fields§
§messages: Vec<ChatMessage>Message list (supports multimodal content)
tools: Vec<Value>Available tools
reasoning: Option<ReasoningConfig>Reasoning/thinking configuration
response_format: Option<ResponseFormat>Response format configuration
Implementations§
Source§impl ChatRequest
impl ChatRequest
Sourcepub fn new(messages: Vec<ChatMessage>) -> ChatRequest
pub fn new(messages: Vec<ChatMessage>) -> ChatRequest
Create a simple text request.
Sourcepub fn with_tools(self, tools: Vec<Value>) -> ChatRequest
pub fn with_tools(self, tools: Vec<Value>) -> ChatRequest
Add tools.
Sourcepub fn with_reasoning(self, reasoning: ReasoningConfig) -> ChatRequest
pub fn with_reasoning(self, reasoning: ReasoningConfig) -> ChatRequest
Add reasoning configuration.
Sourcepub fn with_response_format(self, format: ResponseFormat) -> ChatRequest
pub fn with_response_format(self, format: ResponseFormat) -> ChatRequest
Set response format.
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 (const: unstable) · 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 UnsafeUnpin 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