pub struct MessageCreateParams {
pub model: String,
pub max_tokens: u32,
pub messages: Vec<MessageParam>,
pub system: Option<String>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub top_k: Option<u32>,
pub stop_sequences: Option<Vec<String>>,
pub stream: Option<bool>,
pub tools: Option<Vec<Tool>>,
pub tool_choice: Option<ToolChoice>,
pub metadata: Option<HashMap<String, String>>,
}
Expand description
Parameters for creating a new message
Fields§
§model: String
The model to use for completion
max_tokens: u32
Maximum number of tokens to generate
messages: Vec<MessageParam>
Input messages for the conversation
system: Option<String>
System prompt (optional)
temperature: Option<f32>
Amount of randomness (0.0 to 1.0)
top_p: Option<f32>
Use nucleus sampling
top_k: Option<u32>
Only sample from top K options
stop_sequences: Option<Vec<String>>
Custom stop sequences
stream: Option<bool>
Whether to stream the response
tools: Option<Vec<Tool>>
Tools available for the model to use
tool_choice: Option<ToolChoice>
Tool choice strategy
metadata: Option<HashMap<String, String>>
Additional metadata
Trait Implementations§
Source§impl Clone for MessageCreateParams
impl Clone for MessageCreateParams
Source§fn clone(&self) -> MessageCreateParams
fn clone(&self) -> MessageCreateParams
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 MessageCreateParams
impl Debug for MessageCreateParams
Source§impl<'de> Deserialize<'de> for MessageCreateParams
impl<'de> Deserialize<'de> for MessageCreateParams
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 MessageCreateParams
impl RefUnwindSafe for MessageCreateParams
impl Send for MessageCreateParams
impl Sync for MessageCreateParams
impl Unpin for MessageCreateParams
impl UnwindSafe for MessageCreateParams
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