pub struct MessageRequest {
pub model: String,
pub max_tokens: u32,
pub system: Option<String>,
pub messages: Vec<MessageParameter>,
pub tools: Option<Vec<Value>>,
pub tool_choice: Option<Value>,
pub stop_sequences: Option<Vec<String>>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<u32>,
pub thinking: Option<Value>,
pub metadata: Map<String, Value>,
}Expand description
Request to create a message
Fields§
§model: StringThe model to use
max_tokens: u32Maximum tokens to generate
system: Option<String>System prompt (optional)
messages: Vec<MessageParameter>Messages in the conversation
tools: Option<Vec<Value>>Tools available to the model (optional)
tool_choice: Option<Value>Tool choice (optional)
stop_sequences: Option<Vec<String>>Stop sequences (optional)
temperature: Option<f32>Temperature for sampling (optional)
top_p: Option<f32>Top P for nucleus sampling (optional)
top_k: Option<u32>Top K for sampling (optional)
thinking: Option<Value>Whether to use extended thinking
metadata: Map<String, Value>Metadata for the request
Trait Implementations§
Source§impl Clone for MessageRequest
impl Clone for MessageRequest
Source§fn clone(&self) -> MessageRequest
fn clone(&self) -> MessageRequest
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 MessageRequest
impl Debug for MessageRequest
Source§impl<'de> Deserialize<'de> for MessageRequest
impl<'de> Deserialize<'de> for MessageRequest
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 MessageRequest
impl RefUnwindSafe for MessageRequest
impl Send for MessageRequest
impl Sync for MessageRequest
impl Unpin for MessageRequest
impl UnwindSafe for MessageRequest
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