pub struct CreateMessageParams {Show 18 fields
pub max_tokens: i64,
pub messages: Vec<MessageParam>,
pub model: Model,
pub cache_control: Option<CacheControlEphemeral>,
pub container: Option<String>,
pub inference_geo: Option<String>,
pub metadata: Option<Metadata>,
pub output_config: Option<OutputConfig>,
pub service_tier: Option<CreateMessageParamsServiceTier>,
pub stop_sequences: Option<Vec<String>>,
pub stream: Option<bool>,
pub system: Option<SystemPrompt>,
pub temperature: Option<f32>,
pub thinking: Option<ThinkingConfigParam>,
pub tool_choice: Option<ToolChoice>,
pub tools: Option<Vec<ToolUnion>>,
pub top_k: Option<i64>,
pub top_p: Option<f32>,
}Fields§
§max_tokens: i64生成停止前的最大 token 数。设 0 时仅 prewarm prompt cache, 不产生回复。不同模型上限不同。
messages: Vec<MessageParam>§model: Model§cache_control: Option<CacheControlEphemeral>§container: Option<String>跨请求复用的 container id。
inference_geo: Option<String>指定推理地理区域;不传则用 workspace 的 default_inference_geo。
metadata: Option<Metadata>§output_config: Option<OutputConfig>§service_tier: Option<CreateMessageParamsServiceTier>§stop_sequences: Option<Vec<String>>§stream: Option<bool>是否走 SSE 流。
system: Option<SystemPrompt>§temperature: Option<f32>§thinking: Option<ThinkingConfigParam>§tool_choice: Option<ToolChoice>§tools: Option<Vec<ToolUnion>>§top_k: Option<i64>§top_p: Option<f32>Trait Implementations§
Source§impl Clone for CreateMessageParams
impl Clone for CreateMessageParams
Source§fn clone(&self) -> CreateMessageParams
fn clone(&self) -> CreateMessageParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CreateMessageParams
impl Debug for CreateMessageParams
Source§impl<'de> Deserialize<'de> for CreateMessageParams
impl<'de> Deserialize<'de> for CreateMessageParams
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
Source§impl PartialEq for CreateMessageParams
impl PartialEq for CreateMessageParams
Source§fn eq(&self, other: &CreateMessageParams) -> bool
fn eq(&self, other: &CreateMessageParams) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CreateMessageParams
impl Serialize for CreateMessageParams
impl StructuralPartialEq for CreateMessageParams
Auto Trait Implementations§
impl Freeze for CreateMessageParams
impl RefUnwindSafe for CreateMessageParams
impl Send for CreateMessageParams
impl Sync for CreateMessageParams
impl Unpin for CreateMessageParams
impl UnsafeUnpin for CreateMessageParams
impl UnwindSafe for CreateMessageParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.