pub enum Message {
System {
content: String,
provider_options: Option<ProviderOptions>,
},
User {
content: Vec<UserPart>,
provider_options: Option<ProviderOptions>,
},
Assistant {
content: Vec<AssistantPart>,
provider_options: Option<ProviderOptions>,
},
Tool {
content: Vec<ToolMessagePart>,
provider_options: Option<ProviderOptions>,
},
}Expand description
One turn in a conversation.
Tagged by role on the wire. Each variant carries its own content
shape, mirroring ai-sdk’s per-role part lists.
Variants§
System
System instruction.
Fields
§
provider_options: Option<ProviderOptions>Provider-specific options for this message.
User
User message; multimodal.
Fields
§
provider_options: Option<ProviderOptions>Provider-specific options for this message.
Assistant
Assistant message; can include reasoning and tool calls.
Fields
§
content: Vec<AssistantPart>Ordered parts.
§
provider_options: Option<ProviderOptions>Provider-specific options for this message.
Tool
Tool message carrying tool results back to the model.
Fields
§
content: Vec<ToolMessagePart>Ordered parts.
§
provider_options: Option<ProviderOptions>Provider-specific options for this message.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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