pub struct Step {
pub text: Option<String>,
pub tool_calls: Vec<ToolCall>,
pub finish_reason: FinishReason,
pub usage: Usage,
pub meta: Meta,
}Expand description
The result of exactly one request/response round trip with a provider.
If a request never calls a tool, its TextResponse contains exactly one
Step. If the model calls tools along the way, each round trip through
crate::tool_loop::run_text produces one more Step, and TextResponse
holds the full sequence of them – handy if you want to show a user what the
model did along the way, not just its final answer.
Fields§
§text: Option<String>The text the model generated in this round trip, if any. Often None
when the model’s entire reply was a tool call with no accompanying text.
tool_calls: Vec<ToolCall>Any tools the model asked to call in this round trip.
finish_reason: FinishReasonWhy the model stopped generating on this round trip.
usage: UsageToken usage for this round trip specifically (see TextResponse::usage
for the total across every round trip).
meta: MetaProvider-reported metadata for this round trip (response id, model name, rate-limit info).