#[non_exhaustive]pub struct Step {Show 16 fields
pub id: String,
pub step_index: u32,
pub step_type: StepType,
pub source: StepSource,
pub target: StepTarget,
pub status: StepStatus,
pub content: String,
pub content_delta: String,
pub thinking: String,
pub thinking_delta: String,
pub tool_calls: Vec<ToolCallInfo>,
pub error: String,
pub http_code: u16,
pub is_complete_response: Option<bool>,
pub structured_output: Option<Value>,
pub usage_metadata: Option<UsageMetadata>,
}Expand description
A single step in the agent trajectory, mirroring the SDK’s Step.
§Construction
Step is #[non_exhaustive], so outside this crate it can only be built
with the TypedBuilder. Every field defaults (matching Default), so
callers set only the fields they care about:
use agy_bridge::Step;
let step = Step::builder()
.id("traj:0")
.content("Running command...")
.build();
assert_eq!(step.id, "traj:0");
// Unset fields fall back to their defaults.
assert_eq!(step.step_index, 0);
assert!(step.tool_calls.is_empty());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.id: StringUnique string identifier for the step.
step_index: u32Integer index of the step in the trajectory.
step_type: StepTypeThe high-level type of the step.
source: StepSourceThe source that generated the step.
target: StepTargetThe target of the step interaction.
status: StepStatusThe status of the step.
content: StringThe text content/output of the step.
content_delta: StringIncremental text content added since the last update for this step.
thinking: StringFull model reasoning/thinking text for planner responses.
thinking_delta: StringIncremental thinking text added since the last update for this step.
tool_calls: Vec<ToolCallInfo>List of tool calls associated with the step.
error: StringShort error message if the step failed.
http_code: u16HTTP status code from the harness error, if any (e.g. 400, 429, 503).
The SDK populates this from the harness’s error.http_code field.
Used by error detection in forward_step_to_writer for logging.
is_complete_response: Option<bool>Whether this step is a completed model response directed at the user.
Multiple steps per turn may have this flag set; consumers wanting only the last response should iterate fully.
structured_output: Option<Value>Structured output payload extracted from the FINISH step.
This is serde_json::Value because it contains user-defined schema data
whose shape is not known at compile time.
usage_metadata: Option<UsageMetadata>Token usage for this step’s model invocation.
Implementations§
Source§impl Step
impl Step
Sourcepub fn builder() -> StepBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> StepBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building Step.
On the builder, call .id(...)(optional), .step_index(...)(optional), .step_type(...)(optional), .source(...)(optional), .target(...)(optional), .status(...)(optional), .content(...)(optional), .content_delta(...)(optional), .thinking(...)(optional), .thinking_delta(...)(optional), .tool_calls(...)(optional), .error(...)(optional), .http_code(...)(optional), .is_complete_response(...)(optional), .structured_output(...)(optional), .usage_metadata(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of Step.