pub struct AgentStepSpec {
pub task_id: String,
pub agent: String,
pub description: String,
pub prompt: String,
pub max_steps: Option<usize>,
pub parent_session_id: Option<String>,
pub output_schema: Option<Value>,
}Expand description
A single unit of orchestrated agent work — what to run, independent of where it runs.
Serializable on purpose: a host (书安OS) may ship it to another node, and
a future workflow checkpoint persists it. The orchestration layer assigns
task_id; everything else mirrors a delegated task.
Fields§
§task_id: StringStable id for this step. Flows into lifecycle events (and, later, workflow checkpoints) so a step can be correlated and resumed.
agent: StringRegistry key of the agent to run (e.g. "explore", "review").
description: StringShort human label for display/tracking.
prompt: StringThe instruction handed to the child agent.
max_steps: Option<usize>Optional per-step tool-round cap.
parent_session_id: Option<String>Parent session id, for lifecycle-event correlation.
output_schema: Option<Value>When set, the step must return a value conforming to this JSON Schema.
The executor fulfills it (the local default coerces the step’s output
with the structured-output machinery); the validated object lands in
StepOutcome::structured.
Implementations§
Source§impl AgentStepSpec
impl AgentStepSpec
Sourcepub fn new(
task_id: impl Into<String>,
agent: impl Into<String>,
description: impl Into<String>,
prompt: impl Into<String>,
) -> Self
pub fn new( task_id: impl Into<String>, agent: impl Into<String>, description: impl Into<String>, prompt: impl Into<String>, ) -> Self
A step that runs agent with prompt, identified by task_id.
pub fn with_max_steps(self, max_steps: usize) -> Self
pub fn with_parent_session_id( self, parent_session_id: impl Into<String>, ) -> Self
Sourcepub fn with_output_schema(self, schema: Value) -> Self
pub fn with_output_schema(self, schema: Value) -> Self
Require this step to return a value conforming to schema.
Trait Implementations§
Source§impl Clone for AgentStepSpec
impl Clone for AgentStepSpec
Source§fn clone(&self) -> AgentStepSpec
fn clone(&self) -> AgentStepSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentStepSpec
impl Debug for AgentStepSpec
Source§impl<'de> Deserialize<'de> for AgentStepSpec
impl<'de> Deserialize<'de> for AgentStepSpec
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 PartialEq for AgentStepSpec
impl PartialEq for AgentStepSpec
Source§fn eq(&self, other: &AgentStepSpec) -> bool
fn eq(&self, other: &AgentStepSpec) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AgentStepSpec
impl Serialize for AgentStepSpec
impl StructuralPartialEq for AgentStepSpec
Auto Trait Implementations§
impl Freeze for AgentStepSpec
impl RefUnwindSafe for AgentStepSpec
impl Send for AgentStepSpec
impl Sync for AgentStepSpec
impl Unpin for AgentStepSpec
impl UnsafeUnpin for AgentStepSpec
impl UnwindSafe for AgentStepSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more