#[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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more