set_functions

View as MarkdownOpen in Claude

Set which SWAIG functions are available during this step. Restricting functions per step prevents the AI from calling irrelevant tools.

Parameters

functions
str | list[str]Required

Either "none" to disable all functions, or a list of function names to allow.

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")
7greet = ctx.add_step("greet")
8greet.set_text("Welcome the caller.")
9greet.set_functions("none")
10verify = ctx.add_step("verify")
11verify.set_text("Verify the caller's identity.")
12verify.set_functions(["lookup_account", "verify_identity"])
13
14agent.serve()