Run Steps
Internal step/result data structures used by the run loop orchestration. These types are not part of the public SDK surface.
QueueCompleteSentinel
ProcessedResponse
dataclass
ソースコード位置: src/agents/run_internal/run_steps.py
NextStepInterruption
dataclass
Represents an interruption in the agent run due to tool approval requests.
ソースコード位置: src/agents/run_internal/run_steps.py
interruptions
instance-attribute
interruptions: list[ToolApprovalItem]
The list of tool calls awaiting approval.
SingleStepResult
dataclass
ソースコード位置: src/agents/run_internal/run_steps.py
original_input
instance-attribute
original_input: str | list[TResponseInputItem]
The input items i.e. the items before run() was called. May be mutated by handoff input filters.
model_response
instance-attribute
model_response: ModelResponse
The model response for the current step.
pre_step_items
instance-attribute
pre_step_items: list[RunItem]
Items generated before the current step.
new_step_items
instance-attribute
new_step_items: list[RunItem]
Items generated during this current step.
next_step
instance-attribute
next_step: (
NextStepHandoff
| NextStepFinalOutput
| NextStepRunAgain
| NextStepInterruption
)
The next step to take.
tool_input_guardrail_results
instance-attribute
tool_input_guardrail_results: list[ToolInputGuardrailResult]
Tool input guardrail results from this step.
tool_output_guardrail_results
instance-attribute
tool_output_guardrail_results: list[
ToolOutputGuardrailResult
]
Tool output guardrail results from this step.
session_step_items
class-attribute
instance-attribute
session_step_items: list[RunItem] | None = None
Full unfiltered items for session history. When set, these are used instead of new_step_items for session saving and generated_items property.
nested_history_owned_items
class-attribute
instance-attribute
nested_history_owned_items: (
list[NestedHistoryOwnedItem] | None
) = None
Items moved verbatim into SDK-default nested history for this handoff.
None means this step did not replace handoff history. A list means the handoff rewrote
history, so prior ownership must be reconciled against the new input before adding these items.
output_guardrail_results
class-attribute
instance-attribute
output_guardrail_results: list[OutputGuardrailResult] = (
field(default_factory=list)
)
Output guardrail results (populated when a final output is produced).
processed_response
class-attribute
instance-attribute
processed_response: ProcessedResponse | None = None
The processed model response. This is needed for resuming from interruptions.
generated_items
property
generated_items: list[RunItem]
Items generated during the agent run (i.e. everything generated after
original_input). Uses session_step_items when available for full observability.