get_context

View as MarkdownOpen in Claude

Retrieve an existing context by name for inspection or modification.

Parameters

name
strRequired

Name of the context to retrieve.

Returns

Context if found, None otherwise.

Example

from signalwire import AgentBase
agent = AgentBase(name="my-agent", route="/agent")
contexts = agent.define_contexts()
default = contexts.add_context("default")
default.add_step("greet").set_text("Greet the caller.")
ctx = contexts.get_context("default")
if ctx is not None:
ctx.add_step("followup").set_text("Ask if there is anything else.")
agent.serve()