Documentation | Guava

set_language_mode()

Configures the voice agent to understand and respond in additional languages beyond English. The agent starts in the primary language and switches to a secondary language when the caller requests it or speaks in that language.

Signature

call.set_language_mode(
    primary: Language = "english",
    secondary: list[Language] | None = None,
)
Parameter Type Default Description
primary Language "english" The language the agent starts the conversation in.
secondary list[Language] None Additional languages the agent can switch to when the caller requests them.

The Language type is defined as:

Literal["english", "spanish", "french", "german", "italian"]

Return value: None / Promise<void>

Example: single secondary language

@agent.on_call_start
def on_call_start(call: guava.Call):
    call.set_persona(organization_name="Harper Valley Property Insurance")
    call.set_language_mode(primary="english", secondary=["spanish"])
    call.set_task(
        task_id="intro",
        objective="Answer questions regarding property insurance policy."
    )

Example: multiple secondary languages

call.set_language_mode(
    primary="english",
    secondary=["spanish", "french", "german"]
)

Transcript behavior

Edge cases

Compliance: English and Spanish are currently supported for HITRUST / PCI-compliant deployments. All languages other than English and Spanish are not. Support for other languages is planned.