pub struct StepMeta {
pub name: String,
pub max_turns: usize,
pub journal: bool,
pub input_schema: Option<Schema>,
pub output_schema: Option<Schema>,
pub distribution: Distribution,
}Expand description
What the compiler and runtime need to know about a step without running it.
Fields§
§name: StringThe step type’s name, for events and error messages.
max_turns: usizeCap on turns before the runtime gives up.
Not a safety net so much as a budget: an agent that has not finished in this many turns is looping, and the honest response is to stop and say so rather than burn tokens.
journal: boolMay this step’s effects be written to the journal?
Journaling is what makes a run replayable, but it also means prompts
land on disk under $SOMA_CACHE_DIR. Turn it off for a step handling
anything that must not be persisted.
input_schema: Option<Schema>What it accepts (None = anything).
output_schema: Option<Schema>What it produces (None = unknown).
distribution: DistributionWhere it may run.
Implementations§
Source§impl StepMeta
impl StepMeta
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Defaults: a 24-turn budget, journaling on, schemas undeclared, runs locally.
Sourcepub fn with_max_turns(self, n: usize) -> Self
pub fn with_max_turns(self, n: usize) -> Self
Set the turn budget — see StepMeta::max_turns for what running
out means.
Sourcepub fn without_journal(self) -> Self
pub fn without_journal(self) -> Self
Keep this step’s effects out of the journal — and give up replay for it in exchange.
Sourcepub fn with_input_schema(self, schema: Schema) -> Self
pub fn with_input_schema(self, schema: Schema) -> Self
Declare what this step accepts, so an impossible edge into it fails at compile rather than mid-run.
Sourcepub fn with_output_schema(self, schema: Schema) -> Self
pub fn with_output_schema(self, schema: Schema) -> Self
Declare what this step produces, for its successors’ input checks.