***

title: AgentBase
slug: /reference/python/agents/agent-base
description: The central class for building AI-powered voice agents with SignalWire.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[swmlservice]: /docs/server-sdks/reference/python/agents/swml-service

[ai]: /docs/swml/reference/ai

[swml-reference]: /docs/swml/reference/ai

[agentserver]: /docs/server-sdks/reference/python/agents/agent-server

[add-skill]: /docs/server-sdks/reference/python/agents/agent-base/add-skill

[list-skills]: /docs/server-sdks/reference/python/agents/agent-base/list-skills

[configloader]: /docs/server-sdks/reference/python/agents/configuration/config-loader

[set-native-functions]: /docs/server-sdks/reference/python/agents/agent-base/native-functions

[addanswerverb]: /docs/server-sdks/reference/python/agents/agent-base/add-answer-verb

[addfunctioninclude]: /docs/server-sdks/reference/python/agents/agent-base/add-function-include

[addhint]: /docs/server-sdks/reference/python/agents/agent-base/add-hint

[addhints]: /docs/server-sdks/reference/python/agents/agent-base/add-hints

[addinternalfiller]: /docs/server-sdks/reference/python/agents/agent-base/add-internal-filler

[addlanguage]: /docs/server-sdks/reference/python/agents/agent-base/add-language

[addmcpserver]: /docs/server-sdks/reference/python/agents/agent-base/add-mcp-server

[addpatternhint]: /docs/server-sdks/reference/python/agents/agent-base/add-pattern-hint

[addpostaiverb]: /docs/server-sdks/reference/python/agents/agent-base/add-post-ai-verb

[addpostanswerverb]: /docs/server-sdks/reference/python/agents/agent-base/add-post-answer-verb

[addpreanswerverb]: /docs/server-sdks/reference/python/agents/agent-base/add-pre-answer-verb

[addpronunciation]: /docs/server-sdks/reference/python/agents/agent-base/add-pronunciation

[addskill]: /docs/server-sdks/reference/python/agents/agent-base/add-skill

[addswaigqueryparams]: /docs/server-sdks/reference/python/agents/agent-base/add-swaig-query-params

[asrouter]: /docs/server-sdks/reference/python/agents/agent-base/as-router

[clearpostaiverbs]: /docs/server-sdks/reference/python/agents/agent-base/clear-post-ai-verbs

[clearpostanswerverbs]: /docs/server-sdks/reference/python/agents/agent-base/clear-post-answer-verbs

[clearpreanswerverbs]: /docs/server-sdks/reference/python/agents/agent-base/clear-pre-answer-verbs

[clearswaigqueryparams]: /docs/server-sdks/reference/python/agents/agent-base/clear-swaig-query-params

[definecontexts]: /docs/server-sdks/reference/python/agents/agent-base/define-contexts

[definetool]: /docs/server-sdks/reference/python/agents/agent-base/define-tool

[enabledebugevents]: /docs/server-sdks/reference/python/agents/agent-base/enable-debug-events

[enablemcpserver]: /docs/server-sdks/reference/python/agents/agent-base/enable-mcp-server

[enablesiprouting]: /docs/server-sdks/reference/python/agents/agent-base/enable-sip-routing

[getapp]: /docs/server-sdks/reference/python/agents/agent-base/get-app

[getbasicauthcredentials]: /docs/server-sdks/reference/python/agents/agent-base/get-basic-auth-credentials

[getfullurl]: /docs/server-sdks/reference/python/agents/agent-base/get-full-url

[getname]: /docs/server-sdks/reference/python/agents/agent-base/get-name

[getpostprompt]: /docs/server-sdks/reference/python/agents/agent-base/get-post-prompt

[getprompt]: /docs/server-sdks/reference/python/agents/agent-base/get-prompt

[hasskill]: /docs/server-sdks/reference/python/agents/agent-base/has-skill

[listskills]: /docs/server-sdks/reference/python/agents/agent-base/list-skills

[manualsetproxyurl]: /docs/server-sdks/reference/python/agents/agent-base/manual-set-proxy-url

[setnativefunctions]: /docs/server-sdks/reference/python/agents/agent-base/native-functions

[ondebugevent]: /docs/server-sdks/reference/python/agents/agent-base/on-debug-event

[onsummary]: /docs/server-sdks/reference/python/agents/agent-base/on-summary

[promptaddsection]: /docs/server-sdks/reference/python/agents/agent-base/prompt-add-section

[promptaddsubsection]: /docs/server-sdks/reference/python/agents/agent-base/prompt-add-subsection

[promptaddtosection]: /docs/server-sdks/reference/python/agents/agent-base/prompt-add-to-section

[prompthassection]: /docs/server-sdks/reference/python/agents/agent-base/prompt-has-section

[registerroutingcallback]: /docs/server-sdks/reference/python/agents/agent-base/register-routing-callback

[registersipusername]: /docs/server-sdks/reference/python/agents/agent-base/register-sip-username

[registerswaigfunction]: /docs/server-sdks/reference/python/agents/agent-base/register-swaig-function

[removeskill]: /docs/server-sdks/reference/python/agents/agent-base/remove-skill

[run]: /docs/server-sdks/reference/python/agents/agent-base/run

[serve]: /docs/server-sdks/reference/python/agents/agent-base/serve

[serverless]: /docs/server-sdks/reference/python/agents/agent-base/serverless

[setdynamicconfigcallback]: /docs/server-sdks/reference/python/agents/agent-base/set-dynamic-config-callback

[setfunctionincludes]: /docs/server-sdks/reference/python/agents/agent-base/set-function-includes

[setglobaldata]: /docs/server-sdks/reference/python/agents/agent-base/set-global-data

[setinternalfillers]: /docs/server-sdks/reference/python/agents/agent-base/set-internal-fillers

[setlanguages]: /docs/server-sdks/reference/python/agents/agent-base/set-languages

[setparam]: /docs/server-sdks/reference/python/agents/agent-base/set-param

[setparams]: /docs/server-sdks/reference/python/agents/agent-base/set-params

[setpostprompt]: /docs/server-sdks/reference/python/agents/agent-base/set-post-prompt

[setpostpromptllmparams]: /docs/server-sdks/reference/python/agents/agent-base/set-post-prompt-llm-params

[setpostprompturl]: /docs/server-sdks/reference/python/agents/agent-base/set-post-prompt-url

[setpromptllmparams]: /docs/server-sdks/reference/python/agents/agent-base/set-prompt-llm-params

[setpromptpom]: /docs/server-sdks/reference/python/agents/agent-base/set-prompt-pom

[setprompttext]: /docs/server-sdks/reference/python/agents/agent-base/set-prompt-text

[setpronunciations]: /docs/server-sdks/reference/python/agents/agent-base/set-pronunciations

[setupgracefulshutdown]: /docs/server-sdks/reference/python/agents/agent-base/setup-graceful-shutdown

[setwebhookurl]: /docs/server-sdks/reference/python/agents/agent-base/set-web-hook-url

[updateglobaldata]: /docs/server-sdks/reference/python/agents/agent-base/update-global-data

[validatebasicauth]: /docs/server-sdks/reference/python/agents/agent-base/validate-basic-auth

[automapsipusernames]: /docs/server-sdks/reference/python/agents/agent-base/auto-map-sip-usernames

[definetools]: /docs/server-sdks/reference/python/agents/agent-base/define-tools

[enabledebugroutes]: /docs/server-sdks/reference/python/agents/agent-base/enable-debug-routes

[onfunctioncall]: /docs/server-sdks/reference/python/agents/agent-base/on-function-call

[onswmlrequest]: /docs/server-sdks/reference/python/agents/agent-base/on-swml-request

[ref-datamap]: /docs/server-sdks/reference/python/agents/data-map

`AgentBase` is the central class in the SignalWire AI Agents SDK. It provides a
complete framework for building AI-powered voice agents, combining prompt management,
tool definitions, skill loading, speech configuration, and web serving into a single
composable interface.

Extends [`SWMLService`][swmlservice] and composes
functionality from nine mixins: `PromptMixin`, `ToolMixin`, `SkillMixin`, `AIConfigMixin`,
`WebMixin`, `AuthMixin`, `ServerlessMixin`, `StateMixin`, and `MCPServerMixin`.

All setter methods return `self` for fluent method chaining.

<Info>
  AgentBase generates a SWML document with the [`ai`][ai] verb.
  See the [SWML reference][swml-reference] for the full specification of all
  supported parameters and behaviors.
</Info>

## **Properties**

<ParamField path="name" type="str" toc={true}>
  The agent's display name. Set at construction time. Used in logging, SIP username
  mapping, and the default prompt fallback.
</ParamField>

<ParamField path="route" type="str" default="/" toc={true}>
  HTTP route path where this agent is served. Used by
  [`AgentServer`][agentserver] when hosting
  multiple agents on one process.
</ParamField>

<ParamField path="host" type="str" default="0.0.0.0" toc={true}>
  Network interface the web server binds to.
</ParamField>

<ParamField path="port" type="int" toc={true}>
  Port the web server listens on. Defaults to the `PORT` environment variable, falling
  back to `3000`.
</ParamField>

<ParamField path="agent_id" type="str" toc={true}>
  Unique identifier for this agent instance. Auto-generated as a UUID if not provided.
</ParamField>

<ParamField path="pom" type="PromptObjectModel | None" toc={true}>
  The Prompt Object Model instance used for structured prompt building. `None` when
  `use_pom=False`.
</ParamField>

<ParamField path="skill_manager" type="SkillManager" toc={true}>
  Manager instance for loading and unloading skills. Access via
  [`add_skill()`][add-skill] and
  [`list_skills()`][list-skills] rather
  than directly.
</ParamField>

<ParamField path="PROMPT_SECTIONS" type="dict | list | None" default="None" toc={true}>
  Class-level attribute. Subclasses can set this to declaratively define prompt sections
  instead of calling `prompt_add_section()` in the constructor.
</ParamField>

<ParamField path="basic_auth" type="Optional[tuple[str, str]]" toc={true}>
  Explicit `(username, password)` for HTTP Basic Auth on all endpoints. If not set,
  credentials are read from `SWML_BASIC_AUTH_USER` / `SWML_BASIC_AUTH_PASSWORD` env vars,
  or auto-generated on startup.
</ParamField>

<ParamField path="use_pom" type="bool" default="True" toc={true}>
  Enable Prompt Object Model for structured prompt building. Set to `False` to use
  plain text prompts only.
</ParamField>

<ParamField path="token_expiry_secs" type="int" default="3600" toc={true}>
  Expiration time in seconds for SWAIG function authentication tokens.
</ParamField>

<ParamField path="auto_answer" type="bool" default="True" toc={true}>
  Automatically add an `answer` verb before the AI verb in the SWML document.
</ParamField>

<ParamField path="record_call" type="bool" default="False" toc={true}>
  Enable call recording. When `True`, a `record_call` verb is added to the SWML document.
</ParamField>

<ParamField path="record_format" type="str" default="mp4" toc={true}>
  Recording file format. Common values: `"mp4"`, `"wav"`.
</ParamField>

<ParamField path="record_stereo" type="bool" default="True" toc={true}>
  Record in stereo (separate channels for each party) when `True`.
</ParamField>

<ParamField path="default_webhook_url" type="Optional[str]" toc={true}>
  Base URL for SWAIG function webhooks. If not set, the SDK auto-detects from the
  incoming request or uses `SWML_PROXY_URL_BASE`.
</ParamField>

<ParamField path="suppress_logs" type="bool" default="False" toc={true}>
  Suppress SDK log output. Useful in testing or when integrating with external logging.
</ParamField>

<ParamField path="enable_post_prompt_override" type="bool" default="False" toc={true}>
  Allow dynamic per-request override of the post-prompt configuration.
</ParamField>

<ParamField path="check_for_input_override" type="bool" default="False" toc={true}>
  Allow dynamic per-request override of input checking behavior.
</ParamField>

<ParamField path="config_file" type="Optional[str]" toc={true}>
  Path to a JSON config file. If not provided, the SDK searches default paths.
  See [`ConfigLoader`][configloader].
</ParamField>

<ParamField path="native_functions" type="Optional[list[str]]" toc={true}>
  List of native SWAIG function names to enable at construction time (e.g.,
  `["check_time", "wait_for_user"]`). Can also be set later via
  [`set_native_functions()`][set-native-functions].
</ParamField>

<ParamField path="schema_path" type="Optional[str]" toc={true}>
  Path to a custom SWML schema file for validation. If not provided, the SDK searches
  default paths automatically.
</ParamField>

<ParamField path="schema_validation" type="bool" default="True" toc={true}>
  Enable SWML schema validation. Disable with `False` or `SWML_SKIP_SCHEMA_VALIDATION=1`
  env var.
</ParamField>

## **Decorators**

### tool

```python {7}
from signalwire import AgentBase
from signalwire.core.function_result import FunctionResult

agent = AgentBase(name="assistant", route="/assistant")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name=None, description=None, parameters=None, secure=True, fillers=None, webhook_url=None, required=None)
def my_tool(args, raw_data=None):
    return FunctionResult("Done.")

agent.serve()
```

The `@tool` decorator is the recommended way to define SWAIG functions. Use
`@agent.tool()` on a standalone function, or `@AgentBase.tool()` on a method
inside a subclass. Both forms accept the same parameters.

When parameters are not explicitly provided, the decorator automatically infers the
JSON Schema from Python type hints on the function signature.

#### Parameters

<ParamField path="name" type="Optional[str]" toc={true}>
  Function name exposed to the AI. Defaults to the decorated function's `__name__`.
</ParamField>

<ParamField path="description" type="Optional[str]" toc={true}>
  What the function does. The AI reads this to decide when to call it. Defaults to the
  function's docstring, or `"Function {name}"` as a fallback.
</ParamField>

<ParamField path="parameters" type="Optional[dict[str, Any]]" toc={true}>
  Explicit JSON Schema for function parameters. If omitted, the schema is
  automatically inferred from Python type hints on the decorated function.
</ParamField>

<ParamField path="secure" type="bool" default="True" toc={true}>
  Require token validation on tool calls.
</ParamField>

<ParamField path="fillers" type="Optional[dict[str, list[str]]]" toc={true}>
  Filler phrases by language code, spoken while the function runs.
</ParamField>

<ParamField path="webhook_url" type="Optional[str]" toc={true}>
  External webhook URL. If set, SignalWire calls this URL instead of executing locally.
</ParamField>

<ParamField path="required" type="Optional[list[str]]" toc={true}>
  Required parameter names. Auto-inferred from type hints when not specified.
</ParamField>

<ParamField path="**swaig_fields" type="Any" toc={true}>
  Additional SWAIG fields (e.g., `wait_file`, `meta_data`).
</ParamField>

## **Examples**

### Instance decorator with type inference

```python {7}
from signalwire import AgentBase
from signalwire.core.function_result import FunctionResult

agent = AgentBase(name="assistant", route="/assistant")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(description="Look up a customer's order status")
def check_order(args, raw_data=None):
    order_id = args.get("order_id")
    return FunctionResult(f"Order {order_id} shipped March 28.")

agent.serve()
```

### With explicit parameters

```python
from signalwire import AgentBase
from signalwire.core.function_result import FunctionResult

agent = AgentBase(name="assistant", route="/assistant")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(
    name="search_products",
    description="Search the product catalog",
    parameters={
        "type": "object",
        "properties": {
            "query": {"type": "string", "description": "Search query"},
            "category": {"type": "string", "description": "Product category"}
        }
    },
    required=["query"],
    fillers={"en-US": ["Searching...", "Let me find that..."]}
)
def search_products(args, raw_data=None):
    query = args.get("query")
    return FunctionResult(f"Found 3 results for '{query}'.")

agent.serve()
```

### Class decorator (subclass)

```python
from signalwire import AgentBase
from signalwire.core.function_result import FunctionResult

class SupportAgent(AgentBase):
    @AgentBase.tool(description="Transfer to a human agent")
    def transfer_to_human(self, args, raw_data=None):
        return FunctionResult("Transferring now.").connect("+15551234567")

agent = SupportAgent(name="support", route="/support")
agent.serve()
```

### Typed parameters (auto-inferred schema)

```python
from signalwire import AgentBase
from signalwire.core.function_result import FunctionResult

agent = AgentBase(name="assistant", route="/assistant")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(description="Calculate shipping cost")
def calculate_shipping(weight_kg: float, destination: str, express: bool = False):
    cost = weight_kg * 2.50 if not express else weight_kg * 5.00
    return FunctionResult(f"Shipping to {destination}: ${cost:.2f}")

agent.serve()
```

### Basic agent with a tool

```python {4}
from signalwire import AgentBase
from signalwire.core.function_result import FunctionResult

agent = AgentBase(name="support-agent", route="/support")

agent.add_language("English", "en-US", "rime.spore")
agent.set_prompt_text("You are a friendly customer support agent.")
agent.add_hints(["SignalWire", "SWML", "SWAIG"])
agent.set_params({"temperature": 0.7, "end_of_speech_timeout": 1000})

@agent.tool(description="Look up an order by ID")
def lookup_order(args, raw_data=None):
    order_id = args.get("order_id")
    return FunctionResult(f"Order {order_id} shipped on March 28.")

agent.run()
```

## **Methods**

<CardGroup cols={3}>
  <Card title="add_answer_verb" href="/docs/server-sdks/reference/python/agents/agent-base/add-answer-verb">
    Configure the answer verb that connects the call.
  </Card>

  <Card title="add_function_include" href="/docs/server-sdks/reference/python/agents/agent-base/add-function-include">
    Add a remote function include to the SWAIG configuration.
  </Card>

  <Card title="add_hint" href="/docs/server-sdks/reference/python/agents/agent-base/add-hint">
    Add a single speech recognition hint to improve transcription accuracy.
  </Card>

  <Card title="add_hints" href="/docs/server-sdks/reference/python/agents/agent-base/add-hints">
    Add multiple speech recognition hints at once.
  </Card>

  <Card title="add_internal_filler" href="/docs/server-sdks/reference/python/agents/agent-base/add-internal-filler">
    Add filler phrases for a specific native function and language.
  </Card>

  <Card title="add_language" href="/docs/server-sdks/reference/python/agents/agent-base/add-language">
    Add a language configuration with voice settings for multilingual conversations.
  </Card>

  <Card title="add_mcp_server" href="/docs/server-sdks/reference/python/agents/agent-base/add-mcp-server">
    Add an external MCP server for tool discovery and invocation.
  </Card>

  <Card title="add_pattern_hint" href="/docs/server-sdks/reference/python/agents/agent-base/add-pattern-hint">
    Add a speech recognition hint with pattern matching and replacement.
  </Card>

  <Card title="add_post_ai_verb" href="/docs/server-sdks/reference/python/agents/agent-base/add-post-ai-verb">
    Add a SWML verb to run after the AI conversation ends.
  </Card>

  <Card title="add_post_answer_verb" href="/docs/server-sdks/reference/python/agents/agent-base/add-post-answer-verb">
    Add a SWML verb to run after the call is answered but before the AI starts.
  </Card>

  <Card title="add_pre_answer_verb" href="/docs/server-sdks/reference/python/agents/agent-base/add-pre-answer-verb">
    Add a SWML verb to run before the call is answered.
  </Card>

  <Card title="add_pronunciation" href="/docs/server-sdks/reference/python/agents/agent-base/add-pronunciation">
    Add a pronunciation rule to correct how the AI speaks a specific word or phrase.
  </Card>

  <Card title="add_skill" href="/docs/server-sdks/reference/python/agents/agent-base/add-skill">
    Load and activate a skill on the agent.
  </Card>

  <Card title="add_swaig_query_params" href="/docs/server-sdks/reference/python/agents/agent-base/add-swaig-query-params">
    Append query parameters to all SWAIG webhook URLs.
  </Card>

  <Card title="as_router" href="/docs/server-sdks/reference/python/agents/agent-base/as-router">
    Get the agent's endpoints as a FastAPI APIRouter for mounting in larger applications.
  </Card>

  <Card title="auto_map_sip_usernames" href="/docs/server-sdks/reference/python/agents/agent-base/auto-map-sip-usernames">
    Automatically register SIP usernames derived from the agent's name and route.
  </Card>

  <Card title="clear_post_ai_verbs" href="/docs/server-sdks/reference/python/agents/agent-base/clear-post-ai-verbs">
    Remove all post-AI verbs from the call flow.
  </Card>

  <Card title="clear_post_answer_verbs" href="/docs/server-sdks/reference/python/agents/agent-base/clear-post-answer-verbs">
    Remove all post-answer verbs from the call flow.
  </Card>

  <Card title="clear_pre_answer_verbs" href="/docs/server-sdks/reference/python/agents/agent-base/clear-pre-answer-verbs">
    Remove all pre-answer verbs from the call flow.
  </Card>

  <Card title="clear_swaig_query_params" href="/docs/server-sdks/reference/python/agents/agent-base/clear-swaig-query-params">
    Remove all SWAIG query parameters from the agent.
  </Card>

  <Card title="define_contexts" href="/docs/server-sdks/reference/python/agents/agent-base/define-contexts">
    Define multi-step conversation contexts and workflows for complex agent interactions.
  </Card>

  <Card title="define_tool" href="/docs/server-sdks/reference/python/agents/agent-base/define-tool">
    Programmatically define a SWAIG tool that the AI can invoke during conversations.
  </Card>

  <Card title="define_tools" href="/docs/server-sdks/reference/python/agents/agent-base/define-tools">
    Override hook that returns the list of SWAIG tools available to the AI.
  </Card>

  <Card title="enable_debug_events" href="/docs/server-sdks/reference/python/agents/agent-base/enable-debug-events">
    Enable real-time debug event webhooks from the AI module during calls.
  </Card>

  <Card title="enable_debug_routes" href="/docs/server-sdks/reference/python/agents/agent-base/enable-debug-routes">
    Enable debug and testing routes on the agent's HTTP server.
  </Card>

  <Card title="enable_mcp_server" href="/docs/server-sdks/reference/python/agents/agent-base/enable-mcp-server">
    Expose the agent's tools as an MCP server endpoint.
  </Card>

  <Card title="enable_sip_routing" href="/docs/server-sdks/reference/python/agents/agent-base/enable-sip-routing">
    Enable SIP-based call routing for this agent.
  </Card>

  <Card title="get_app" href="/docs/server-sdks/reference/python/agents/agent-base/get-app">
    Get the FastAPI application instance for use with deployment adapters.
  </Card>

  <Card title="get_basic_auth_credentials" href="/docs/server-sdks/reference/python/agents/agent-base/get-basic-auth-credentials">
    Retrieve the agent's Basic Auth credentials and their origin.
  </Card>

  <Card title="get_full_url" href="/docs/server-sdks/reference/python/agents/agent-base/get-full-url">
    Get the full URL for this agent's endpoint, including host, port, and route.
  </Card>

  <Card title="get_name" href="/docs/server-sdks/reference/python/agents/agent-base/get-name">
    Get the agent's display name.
  </Card>

  <Card title="get_post_prompt" href="/docs/server-sdks/reference/python/agents/agent-base/get-post-prompt">
    Retrieve the current post-prompt text.
  </Card>

  <Card title="get_prompt" href="/docs/server-sdks/reference/python/agents/agent-base/get-prompt">
    Retrieve the current prompt configured on the agent.
  </Card>

  <Card title="has_skill" href="/docs/server-sdks/reference/python/agents/agent-base/has-skill">
    Check whether a specific skill is currently loaded on the agent.
  </Card>

  <Card title="list_skills" href="/docs/server-sdks/reference/python/agents/agent-base/list-skills">
    List the names of all currently loaded skills on the agent.
  </Card>

  <Card title="manual_set_proxy_url" href="/docs/server-sdks/reference/python/agents/agent-base/manual-set-proxy-url">
    Manually set the proxy URL base for webhook callbacks.
  </Card>

  <Card title="set_native_functions" href="/docs/server-sdks/reference/python/agents/agent-base/native-functions">
    Enable built-in native functions that execute directly on the SignalWire platform.
  </Card>

  <Card title="on_debug_event" href="/docs/server-sdks/reference/python/agents/agent-base/on-debug-event">
    Register a callback for debug events received at the /debug\_events endpoint.
  </Card>

  <Card title="on_function_call" href="/docs/server-sdks/reference/python/agents/agent-base/on-function-call">
    Override hook called when a SWAIG function is invoked during a conversation.
  </Card>

  <Card title="on_summary" href="/docs/server-sdks/reference/python/agents/agent-base/on-summary">
    Handle post-prompt summaries generated after a conversation ends.
  </Card>

  <Card title="on_swml_request" href="/docs/server-sdks/reference/python/agents/agent-base/on-swml-request">
    Override hook for customizing the SWML document on a per-request basis.
  </Card>

  <Card title="prompt_add_section" href="/docs/server-sdks/reference/python/agents/agent-base/prompt-add-section">
    Add a new section to the agent's structured prompt.
  </Card>

  <Card title="prompt_add_subsection" href="/docs/server-sdks/reference/python/agents/agent-base/prompt-add-subsection">
    Add a subsection to an existing prompt section.
  </Card>

  <Card title="prompt_add_to_section" href="/docs/server-sdks/reference/python/agents/agent-base/prompt-add-to-section">
    Append content to an existing prompt section or create it if it does not exist.
  </Card>

  <Card title="prompt_has_section" href="/docs/server-sdks/reference/python/agents/agent-base/prompt-has-section">
    Check whether a named section exists in the agent's prompt.
  </Card>

  <Card title="register_routing_callback" href="/docs/server-sdks/reference/python/agents/agent-base/register-routing-callback">
    Register a callback for dynamic request routing based on SIP URIs or POST data.
  </Card>

  <Card title="register_sip_username" href="/docs/server-sdks/reference/python/agents/agent-base/register-sip-username">
    Register a specific SIP username to route calls to this agent.
  </Card>

  <Card title="register_swaig_function" href="/docs/server-sdks/reference/python/agents/agent-base/register-swaig-function">
    Register a raw SWAIG function dictionary, typically from a DataMap.
  </Card>

  <Card title="remove_skill" href="/docs/server-sdks/reference/python/agents/agent-base/remove-skill">
    Unload a skill from the agent.
  </Card>

  <Card title="run" href="/docs/server-sdks/reference/python/agents/agent-base/run">
    Smart entry point that auto-detects the runtime environment and starts the agent accordingly.
  </Card>

  <Card title="serve" href="/docs/server-sdks/reference/python/agents/agent-base/serve">
    Start a FastAPI/uvicorn web server to serve this agent's SWML and SWAIG endpoints.
  </Card>

  <Card title="handle_serverless_request" href="/docs/server-sdks/reference/python/agents/agent-base/serverless">
    Handle requests in serverless environments like AWS Lambda, Google Cloud Functions, and Azure Functions.
  </Card>

  <Card title="set_dynamic_config_callback" href="/docs/server-sdks/reference/python/agents/agent-base/set-dynamic-config-callback">
    Set a callback for per-request dynamic agent configuration.
  </Card>

  <Card title="set_function_includes" href="/docs/server-sdks/reference/python/agents/agent-base/set-function-includes">
    Set the complete list of remote function includes.
  </Card>

  <Card title="set_global_data" href="/docs/server-sdks/reference/python/agents/agent-base/set-global-data">
    Merge data into the global data dictionary available to the AI throughout a conversation.
  </Card>

  <Card title="set_internal_fillers" href="/docs/server-sdks/reference/python/agents/agent-base/set-internal-fillers">
    Set filler phrases for native SWAIG functions.
  </Card>

  <Card title="set_languages" href="/docs/server-sdks/reference/python/agents/agent-base/set-languages">
    Replace all language configurations at once with a list of raw language dictionaries.
  </Card>

  <Card title="set_param" href="/docs/server-sdks/reference/python/agents/agent-base/set-param">
    Set a single AI parameter by key.
  </Card>

  <Card title="set_params" href="/docs/server-sdks/reference/python/agents/agent-base/set-params">
    Configure AI model parameters such as temperature, timeouts, and speech recognition settings.
  </Card>

  <Card title="set_post_prompt" href="/docs/server-sdks/reference/python/agents/agent-base/set-post-prompt">
    Set the post-prompt used for generating call summaries after a conversation ends.
  </Card>

  <Card title="set_post_prompt_llm_params" href="/docs/server-sdks/reference/python/agents/agent-base/set-post-prompt-llm-params">
    Set LLM parameters specifically for the post-prompt.
  </Card>

  <Card title="set_post_prompt_url" href="/docs/server-sdks/reference/python/agents/agent-base/set-post-prompt-url">
    Override the default URL where post-prompt summaries are delivered.
  </Card>

  <Card title="set_prompt_llm_params" href="/docs/server-sdks/reference/python/agents/agent-base/set-prompt-llm-params">
    Set LLM parameters specifically for the main prompt.
  </Card>

  <Card title="set_prompt_pom" href="/docs/server-sdks/reference/python/agents/agent-base/set-prompt-pom">
    Set the prompt using a raw Prompt Object Model dictionary structure.
  </Card>

  <Card title="set_prompt_text" href="/docs/server-sdks/reference/python/agents/agent-base/set-prompt-text">
    Set the agent's system prompt as a raw text string.
  </Card>

  <Card title="set_pronunciations" href="/docs/server-sdks/reference/python/agents/agent-base/set-pronunciations">
    Replace all pronunciation rules at once with a list of raw rule dictionaries.
  </Card>

  <Card title="setup_graceful_shutdown" href="/docs/server-sdks/reference/python/agents/agent-base/setup-graceful-shutdown">
    Register signal handlers for graceful shutdown in containerized deployments.
  </Card>

  <Card title="set_web_hook_url" href="/docs/server-sdks/reference/python/agents/agent-base/set-web-hook-url">
    Override the default webhook URL used for SWAIG function calls in the SWML document.
  </Card>

  <Card title="update_global_data" href="/docs/server-sdks/reference/python/agents/agent-base/update-global-data">
    Update the global data dictionary with new values.
  </Card>

  <Card title="validate_basic_auth" href="/docs/server-sdks/reference/python/agents/agent-base/validate-basic-auth">
    Validate HTTP Basic Auth credentials against the agent's stored credentials.
  </Card>
</CardGroup>