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

1from signalwire import AgentBase
2
3agent = AgentBase(name="my-agent", route="/agent")
4
5contexts = agent.define_contexts()
6ctx = contexts.add_context("default")
7
8step = ctx.add_step("collect_info")
9
10# Structured prompt with POM sections
11step.add_section("Task", "Collect the caller's account information.")
12step.add_bullets("Required Information", [
13 "Full legal name",
14 "Account number (10 digits)",
15 "Reason for calling"
16])
17
18# Completion criteria
19step.set_step_criteria(
20 "Complete when all three pieces of information have been collected "
21 "and confirmed with the caller."
22)
23
24# Only allow relevant functions
25step.set_functions(["lookup_account", "verify_identity"])
26
27# Navigation
28step.set_valid_steps(["process_request", "escalate"])
29
30agent.serve()