pub struct Step {
pub idx: u32,
pub kind: StepKind,
pub name: Option<String>,
pub prompt_tokens: Option<u32>,
pub completion_tokens: Option<u32>,
pub cost_usd: Option<f64>,
pub input: Value,
pub output: Value,
pub error: Option<String>,
pub latency: Duration,
pub span_id: Option<String>,
}Expand description
One unit of agent work — either an LLM call or a tool call.
Fields§
§idx: u32Zero-based index of the step within the run.
kind: StepKindDiscriminator.
name: Option<String>Tool name (for ToolCall) or model name (for LlmCall); None if unknown.
prompt_tokens: Option<u32>Prompt-side token count for an LlmCall step; None for other kinds or
when the provider did not report a split.
completion_tokens: Option<u32>Completion-side token count for an LlmCall step; None for other kinds
or when the provider did not report a split.
cost_usd: Option<f64>Estimated USD cost for an LlmCall step, computed by
project_with_price_table from the
step’s LlmIo and a PriceTable. None for other kinds, when the
provider/model/token split is unknown, or when no price matched.
input: ValueJSON inputs (tool args, prompt structure).
output: ValueJSON outputs (tool result, completion text).
error: Option<String>Error message if this step failed (None on success).
latency: DurationWall-clock latency serialised as milliseconds.
span_id: Option<String>Tracing span id (stringly-typed for now; richer linkage is a Wave 7 carryover).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Step
impl<'de> Deserialize<'de> for Step
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 JsonSchema for Step
impl JsonSchema for Step
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more