pub enum MessageContent {
Text(String),
AssistantWithToolCalls {
text: Option<String>,
tool_calls: Vec<ToolCall>,
reasoning_content: Option<String>,
thinking_blocks: Vec<ThinkingBlock>,
},
ToolResult(ToolResult),
ToolResultRef(ToolResultRef),
MultiPart {
text: Option<String>,
images: Vec<ImagePart>,
},
}Variants§
Text(String)
AssistantWithToolCalls
Fields
reasoning_content: Option<String>Thinking-model reasoning captured alongside the tool_calls. Some
provider APIs (Moonshot Kimi K2-thinking / K2.6, MiniMax-M2 when
reasoning_split is on) require the historical reasoning_content
to be echoed back on every assistant tool_call message or they
reject the next request with a 400. DeepSeek-R1 is the opposite —
it rejects the request if this field is echoed back. The send-side
ReasoningPolicy (per-provider) decides whether to emit.
Always captured on the receive side so we don’t lose data.
thinking_blocks: Vec<ThinkingBlock>Anthropic-style extended-thinking blocks received alongside this
turn. Carries the cryptographic signature that Claude (and
Anthropic-compatible proxies routing models like deepseek-v4-pro
through claude.rs) require us to echo verbatim on every
subsequent request. Empty when the upstream isn’t Anthropic
or thinking was disabled. provider/claude.rs::format_messages
emits these as the first elements of the content array.
ToolResult(ToolResult)
ToolResultRef(ToolResultRef)
Lightweight reference to a tool result whose full output is cached on disk.
Used for new tool results; old ToolResult variant kept for backward compat.
MultiPart
User message with text and/or image attachments (vision models).
Trait Implementations§
Source§impl Clone for MessageContent
impl Clone for MessageContent
Source§fn clone(&self) -> MessageContent
fn clone(&self) -> MessageContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageContent
impl Debug for MessageContent
Source§impl<'de> Deserialize<'de> for MessageContent
impl<'de> Deserialize<'de> for MessageContent
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>,
Auto Trait Implementations§
impl Freeze for MessageContent
impl RefUnwindSafe for MessageContent
impl Send for MessageContent
impl Sync for MessageContent
impl Unpin for MessageContent
impl UnsafeUnpin for MessageContent
impl UnwindSafe for MessageContent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 more