Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Elevenlabs Elevenlabs python WidgetLanguagePresetResponse

From Leeroopedia
Metadata Value
source Elevenlabs_Elevenlabs_python
domain Widget Configuration, Localization
last_updated 2026-02-15

Overview

Description: WidgetLanguagePresetResponse is a Pydantic model that represents a language-specific preset configuration for an ElevenLabs conversational AI widget. It allows per-language customization of the first message, all widget text contents, and terms and conditions display, enabling full multilingual support for widget deployments.

Usage: This model is used within WidgetConfigResponse's language_presets dictionary, where each key is a language code (e.g., "en", "es", "fr") mapping to a WidgetLanguagePresetResponse instance. It enables the widget to switch its text content, initial greeting, and legal terms based on the selected language.

Code Reference

Source file: src/elevenlabs/types/widget_language_preset_response.py

Class signature:

class WidgetLanguagePresetResponse(UncheckedBaseModel):
    ...

Import statement:

from elevenlabs.types import WidgetLanguagePresetResponse

I/O Contract

Field Type Required Description
first_message Optional[str] No The initial greeting message for this language
text_contents Optional[WidgetTextContents] No The text contents for the selected language
terms_text Optional[str] No The text to display for terms and conditions in this language
terms_html Optional[str] No The HTML to display for terms and conditions in this language
terms_key Optional[str] No The key to display for terms and conditions in this language

Usage Examples

from elevenlabs.types import WidgetLanguagePresetResponse, WidgetTextContents

# Create a language preset for French
french_preset = WidgetLanguagePresetResponse(
    first_message="Bonjour! Comment puis-je vous aider?",
    text_contents=WidgetTextContents(
        main_label="Parlez a notre assistant",
        start_call="Demarrer l'appel",
        end_call="Terminer l'appel",
    ),
    terms_text="En continuant, vous acceptez nos conditions d'utilisation.",
)

# Access preset fields
print(french_preset.first_message)
if french_preset.text_contents:
    print(french_preset.text_contents.main_label)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment