> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# set_multilingual

> Let the caller switch languages mid-call by configuring recognizer-driven multilingual mode.

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

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

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

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

Configure recognizer-driven multilingual mode. The speech recognizer runs in
code-switching mode and the agent answers in whichever language the caller
actually spoke; the model doesn't pick the language. The SDK emits the object
as the top-level `multilingual` key of the AI verb.

This is mutually exclusive with [`set_languages()`][set-languages] and
[`add_language()`][add-language]. If both are set, the platform uses
`multilingual` and ignores `languages`.

## Parameters

**`config`** `dict[str, Any]` — required

The multilingual configuration object, passed through unchanged. See the
[SWML `multilingual` reference][swml-multilingual] for its keys, including
the language list, the starting language, and switching thresholds.

---

## Returns

[`AgentBase`][ref-agentbase] -- Returns self for method chaining.

## Example

```python {5-13}
from signalwire import AgentBase

agent = AgentBase(name="dispatch", route="/dispatch")
agent.set_prompt_text("You are Ada, the dispatcher for Bayview Taxi.")
agent.set_multilingual({
    "start_language": "en",
    "allowed": ["en", "es", "fr"],
    "languages": [
        {"language": "default", "voice": "elevenlabs.rachel"},
        {"language": "es", "voice": "elevenlabs.maria"},
        {"language": "fr", "voice": "gcloud.fr-FR-Neural2-B"},
    ],
})
agent.serve()
```