pub struct Request {
pub model: String,
pub max_tokens: usize,
pub system: Option<String>,
pub messages: Vec<Value>,
pub stream: Option<bool>,
pub tools: Option<Vec<Value>>,
pub tool_choice: Option<Value>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
}Expand description
The request body for the Anthropic Messages API.
Fields§
§model: StringThe model identifier.
max_tokens: usizeMaximum tokens to generate.
system: Option<String>System prompt (top-level, not in messages array).
messages: Vec<Value>The messages array (Anthropic content block format).
stream: Option<bool>Whether to stream the response.
tools: Option<Vec<Value>>Tools the model may call.
tool_choice: Option<Value>Tool choice control.
temperature: Option<f64>Temperature.
top_p: Option<f64>Top-p sampling.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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