pub struct MessagesRequest {Show 13 fields
pub model: String,
pub messages: Vec<Message>,
pub max_tokens: u64,
pub metadata: Option<Metadata>,
pub stop_sequences: Option<Vec<String>>,
pub stream: Option<bool>,
pub system: Option<String>,
pub temperature: Option<f64>,
pub tool_choice: Option<ToolChoice>,
pub tools: Option<Vec<Tool>>,
pub top_k: Option<u32>,
pub top_p: Option<f64>,
pub credentials: Option<Credentials>,
}Expand description
Request to the Anthropic Messages API.
This struct represents a complete request to the Messages API, including all parameters that control generation behavior.
Fields§
§model: StringThe model to use (e.g., “claude-3-7-sonnet-20250219”).
messages: Vec<Message>The conversation messages.
max_tokens: u64Maximum number of tokens to generate.
metadata: Option<Metadata>Optional metadata.
stop_sequences: Option<Vec<String>>Sequences where generation should stop.
stream: Option<bool>Whether to stream the response.
system: Option<String>System prompt to guide the assistant’s behavior.
temperature: Option<f64>Sampling temperature (0.0 to 1.0).
tool_choice: Option<ToolChoice>Tool choice specification.
tools: Option<Vec<Tool>>Tools the assistant can use.
top_k: Option<u32>Top-k sampling parameter.
top_p: Option<f64>Top-p (nucleus) sampling parameter.
credentials: Option<Credentials>Credentials for authentication (not serialized).
Trait Implementations§
Source§impl Clone for MessagesRequest
impl Clone for MessagesRequest
Source§fn clone(&self) -> MessagesRequest
fn clone(&self) -> MessagesRequest
Returns a copy 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 MessagesRequest
impl Debug for MessagesRequest
Auto Trait Implementations§
impl Freeze for MessagesRequest
impl RefUnwindSafe for MessagesRequest
impl Send for MessagesRequest
impl Sync for MessagesRequest
impl Unpin for MessagesRequest
impl UnwindSafe for MessagesRequest
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