set_reset_full_reset

View as MarkdownOpen in Claude

Set whether to completely replace the system prompt when this step switches contexts.

Parameters

full_reset
boolRequired

Whether to fully rewrite the system prompt on context switch.

Returns

Step — Self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="my-agent", route="/agent")
4
5contexts = agent.define_contexts()
6ctx = contexts.add_context("default")
7ctx.add_step("greet").set_text("Welcome the caller.")
8transfer = ctx.add_step("transfer")
9transfer.set_text("Transfer the caller to billing.")
10transfer.set_valid_contexts(["billing"])
11transfer.set_reset_full_reset(True)
12transfer.set_reset_system_prompt(
13 "You are a billing specialist. Forget all previous context."
14)
15billing = contexts.add_context("billing")
16billing.add_step("invoice").set_text("Help with billing inquiries.")
17
18agent.serve()