pub struct CreateMessageRequest {Show 16 fields
pub model: String,
pub messages: Vec<InputMessage>,
pub max_tokens: u32,
pub metadata: Option<Metadata>,
pub service_tier: Option<ServiceTier>,
pub stop_sequences: Option<Vec<String>>,
pub stream: Option<bool>,
pub system: Option<SystemContent>,
pub temperature: Option<f64>,
pub thinking: Option<ThinkingConfig>,
pub tool_choice: Option<ToolChoice>,
pub tools: Option<Vec<Tool>>,
pub top_k: Option<u32>,
pub top_p: Option<f64>,
pub container: Option<ContainerConfig>,
pub mcp_servers: Option<Vec<McpServerConfig>>,
}Expand description
Request to create a message using the Anthropic Messages API.
This is the main request type for /v1/messages endpoint.
Fields§
§model: StringThe model that will complete your prompt.
messages: Vec<InputMessage>Input messages for the conversation.
max_tokens: u32The maximum number of tokens to generate before stopping.
metadata: Option<Metadata>An object describing metadata about the request.
service_tier: Option<ServiceTier>Service tier for the request (auto or standard_only).
stop_sequences: Option<Vec<String>>Custom text sequences that will cause the model to stop generating.
stream: Option<bool>Whether to incrementally stream the response using server-sent events.
system: Option<SystemContent>System prompt for providing context and instructions.
temperature: Option<f64>Amount of randomness injected into the response (0.0 to 1.0).
thinking: Option<ThinkingConfig>Configuration for extended thinking.
tool_choice: Option<ToolChoice>How the model should use the provided tools.
tools: Option<Vec<Tool>>Definitions of tools that the model may use.
top_k: Option<u32>Only sample from the top K options for each subsequent token.
top_p: Option<f64>Use nucleus sampling.
container: Option<ContainerConfig>Container configuration for code execution (beta).
mcp_servers: Option<Vec<McpServerConfig>>MCP servers to be utilized in this request (beta).
Implementations§
Trait Implementations§
Source§impl Clone for CreateMessageRequest
impl Clone for CreateMessageRequest
Source§fn clone(&self) -> CreateMessageRequest
fn clone(&self) -> CreateMessageRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more