Step

View as MarkdownOpen in Claude

A Step represents a single phase within a Context. Each step has its own prompt text, completion criteria, available functions, and navigation rules. The AI advances through steps automatically when criteria are met.

You create steps by calling add_step() on a Context object. All setter methods return self for fluent method chaining.

Properties

name
strRequired

Step name. Must be unique within the parent context.

Methods

Example

from signalwire import AgentBase
agent = AgentBase(name="my-agent", route="/agent")
contexts = agent.define_contexts()
ctx = contexts.add_context("default")
step = ctx.add_step("collect_info")
# Structured prompt with POM sections
step.add_section("Task", "Collect the caller's account information.")
step.add_bullets("Required Information", [
"Full legal name",
"Account number (10 digits)",
"Reason for calling"
])
# Completion criteria
step.set_step_criteria(
"Complete when all three pieces of information have been collected "
"and confirmed with the caller."
)
# Only allow relevant functions
step.set_functions(["lookup_account", "verify_identity"])
# Navigation
step.set_valid_steps(["process_request", "escalate"])
agent.serve()