pub enum Message {
User(Vec<UserContent>),
Assistant {
content: Option<String>,
reasoning: Option<String>,
tool_calls: Vec<ToolCall>,
provider_data: Option<Value>,
},
ToolResult {
call_id: String,
content: Vec<Content>,
},
}Expand description
A single turn in a conversation. Every variant carries exactly the fields it needs — no invalid states are representable.
Variants§
User(Vec<UserContent>)
A message from the human side, supporting text and images.
Assistant
A message produced by the model. content and tool_calls may both be
present; content may be absent when the model only emits tool calls.
Fields
§
provider_data: Option<Value>Opaque per-turn state emitted by the provider (e.g. Anthropic
thinking blocks with signatures). Populated from
LlmEvent::AssistantState and round-tripped verbatim by the
same provider’s request serializer. Always None for providers
that don’t emit state.
ToolResult
The result of a tool invocation, keyed by the call’s ID.
Implementations§
Trait Implementations§
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