AgentsAgentBase

set_function_includes

View as MarkdownOpen in Claude

Replace the entire list of remote SWAIG function includes at once. Each entry must contain a url and a functions list. Invalid entries (missing required keys or non-list functions) are silently dropped.

This maps to the SWML ai.swaig.includes array. See the SWML SWAIG includes reference for details.

Use add_function_include() to append a single include without replacing existing ones.

Parameters

includes
list[dict[str, Any]]Required

List of include objects. Each object must have:

  • url (str) — Remote SWAIG server URL
  • functions (list[str]) — Function names to include

Optional keys like meta_data are passed through unchanged.

Returns

AgentBase — Returns self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="assistant", route="/assistant")
4agent.set_prompt_text("You are a helpful assistant.")
5agent.set_function_includes([
6 {"url": "https://tools.example.com/swaig", "functions": ["lookup_order"]},
7 {"url": "https://billing.example.com/swaig", "functions": ["get_invoice", "process_refund"]},
8])
9agent.serve()