get_context
get_context
Retrieve an existing context by name for inspection or modification.
Parameters
name
Name of the context to retrieve.
Returns
Context if found,
None otherwise.
get_context
Retrieve an existing context by name for inspection or modification.
Name of the context to retrieve.
Context if found,
None otherwise.
1 from signalwire import AgentBase 2 3 agent = AgentBase(name="my-agent", route="/agent") 4 5 contexts = agent.define_contexts() 6 default = contexts.add_context("default") 7 default.add_step("greet").set_text("Greet the caller.") 8 9 ctx = contexts.get_context("default") 10 if ctx is not None: 11 ctx.add_step("followup").set_text("Ask if there is anything else.") 12 13 agent.serve()