set_system_prompt

View as MarkdownOpen in Claude

Set a new system prompt that takes effect when this context is entered. Triggers a context reset. Cannot be combined with add_system_section() / add_system_bullets().

Parameters

system_prompt
strRequired

New system prompt for this context.

Returns

Context — Self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="my-agent", route="/agent")
4
5contexts = agent.define_contexts()
6support = contexts.add_context("default")
7support.set_system_prompt("You are a patient technical support engineer.")
8support.add_step("greet").set_text("Greet the caller and ask about their issue.")
9
10agent.serve()