create_simple_context

View as MarkdownOpen in Claude

Helper function that creates a standalone Context object without requiring a ContextBuilder. Useful for quick prototyping or when you need a single context outside of the builder pattern.

This is a module-level function, not a method on ContextBuilder. Import it directly: from signalwire import create_simple_context.

Parameters

name
strDefaults to default

Context name. Defaults to "default", which is the required name for single-context agents.

Returns

Context — A new Context object ready for adding steps.

Example

1from signalwire import create_simple_context
2
3ctx = create_simple_context()
4ctx.add_step("greet").set_text("Welcome the caller and ask how you can help.")
5ctx.add_step("farewell").set_text("Thank the caller and end the conversation.")