#[non_exhaustive]pub struct DebugMessage {
pub text: Option<String>,
pub thinking: Option<String>,
pub thinking_redacted: bool,
pub tool_calls: Vec<DebugToolCall>,
pub tool_results: Vec<DebugToolResult>,
pub stop_reason: Option<String>,
pub input_tokens: Option<u64>,
pub output_tokens: Option<u64>,
}Expand description
A single assistant turn captured during a verbose invocation.
Each DebugMessage represents one assistant response, which may contain
free-form text, tool calls, or both.
§Examples
use ironflow_core::prelude::*;
let provider = ClaudeCodeProvider::new();
let result = Agent::new()
.prompt("List files in src/")
.verbose()
.run(&provider)
.await?;
if let Some(messages) = result.debug_messages() {
for msg in messages {
println!("{msg}");
}
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: Option<String>Free-form text produced by the assistant in this turn, if any.
thinking: Option<String>Extended thinking blocks produced by the model in this turn.
Available only when the model emits thinking content blocks
(Opus 4.7 adaptive thinking, Claude 3.7+ extended thinking, etc.).
The blocks are joined in arrival order.
thinking_redacted: booltrue when the model emitted a thinking content block but the
text was redacted (only a signature is provided).
Opus 4.7 adaptive thinking and the display: "omitted" setting both
produce signature-only thinking blocks: the model proves it reasoned
without exposing the chain of thought. The UI should still show a
badge so the user knows thinking happened.
tool_calls: Vec<DebugToolCall>Tool calls made by the assistant in this turn.
tool_results: Vec<DebugToolResult>Tool results received from the user/runtime for the preceding tool calls.
In the Claude stream-json format, tool results come as "type":"user"
messages whose content is a list of tool_result blocks. We attach
them to the turn that emitted the matching tool_use so the timeline
stays compact.
stop_reason: Option<String>The model’s stop reason for this turn (e.g. "end_turn", "tool_use").
input_tokens: Option<u64>Input tokens consumed by this turn, if reported.
output_tokens: Option<u64>Output tokens generated by this turn, if reported.
Trait Implementations§
Source§impl Clone for DebugMessage
impl Clone for DebugMessage
Source§fn clone(&self) -> DebugMessage
fn clone(&self) -> DebugMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DebugMessage
impl Debug for DebugMessage
Source§impl<'de> Deserialize<'de> for DebugMessage
impl<'de> Deserialize<'de> for DebugMessage
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>,
Source§impl Display for DebugMessage
impl Display for DebugMessage
Auto Trait Implementations§
impl Freeze for DebugMessage
impl RefUnwindSafe for DebugMessage
impl Send for DebugMessage
impl Sync for DebugMessage
impl Unpin for DebugMessage
impl UnsafeUnpin for DebugMessage
impl UnwindSafe for DebugMessage
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.