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

from signalwire import AgentBase
agent = AgentBase(name="my-agent", route="/agent")
contexts = agent.define_contexts()
ctx = contexts.add_context("default")
greet = ctx.add_step("greet")
greet.set_text("Welcome the caller.")
greet.set_functions("none")
verify = ctx.add_step("verify")
verify.set_text("Verify the caller's identity.")
verify.set_functions(["lookup_account", "verify_identity"])
agent.serve()