Implementation:Elevenlabs Elevenlabs python WidgetConfigResponse
| Metadata | Value |
|---|---|
| source | Elevenlabs_Elevenlabs_python |
| domain | Widget Configuration, Conversational AI |
| last_updated | 2026-02-15 |
Overview
Description: WidgetConfigResponse is a Pydantic model that represents the full configuration response for an ElevenLabs conversational AI widget. It encapsulates all visual styling properties (colors, border radius, button styles), behavioral flags (expandable, mic muting, transcript display, text input), localization settings (language, language presets, text contents), and structural options (variant, placement, avatar, feedback mode). This model is returned by the API when retrieving widget configuration for embedding conversational agents.
Usage: This model is used when fetching or working with ElevenLabs widget embed configurations. It provides comprehensive control over the appearance and behavior of the conversational widget, including support for multi-language presets, markdown link allowlisting, terms and conditions display, and WebRTC connection settings.
Code Reference
Source file: src/elevenlabs/types/widget_config_response.py
Class signature:
class WidgetConfigResponse(UncheckedBaseModel):
...
Import statement:
from elevenlabs.types import WidgetConfigResponse
I/O Contract
| Field | Type | Required | Description |
|---|---|---|---|
| variant | Optional[EmbedVariant] | No | The variant of the widget |
| placement | Optional[WidgetPlacement] | No | The placement of the widget on the screen |
| expandable | Optional[WidgetExpandable] | No | Whether the widget is expandable |
| avatar | Optional[WidgetConfigResponseModelAvatar] | No | The avatar of the widget |
| feedback_mode | Optional[WidgetFeedbackMode] | No | The feedback mode of the widget |
| end_feedback | Optional[WidgetEndFeedbackConfig] | No | Configuration for feedback collected at the end of the conversation |
| bg_color | Optional[str] | No | The background color of the widget |
| text_color | Optional[str] | No | The text color of the widget |
| btn_color | Optional[str] | No | The button color of the widget |
| btn_text_color | Optional[str] | No | The button text color of the widget |
| border_color | Optional[str] | No | The border color of the widget |
| focus_color | Optional[str] | No | The focus color of the widget |
| border_radius | Optional[int] | No | The border radius of the widget |
| btn_radius | Optional[int] | No | The button radius of the widget |
| action_text | Optional[str] | No | The action text of the widget |
| start_call_text | Optional[str] | No | The start call text of the widget |
| end_call_text | Optional[str] | No | The end call text of the widget |
| expand_text | Optional[str] | No | The expand text of the widget |
| listening_text | Optional[str] | No | The text to display when the agent is listening |
| speaking_text | Optional[str] | No | The text to display when the agent is speaking |
| shareable_page_text | Optional[str] | No | The text to display when sharing |
| shareable_page_show_terms | Optional[bool] | No | Whether to show terms and conditions on the shareable page |
| terms_text | Optional[str] | No | The text to display for terms and conditions |
| terms_html | Optional[str] | No | The HTML to display for terms and conditions |
| terms_key | Optional[str] | No | The key to display for terms and conditions |
| show_avatar_when_collapsed | Optional[bool] | No | Whether to show the avatar when the widget is collapsed |
| disable_banner | Optional[bool] | No | Whether to disable the banner |
| override_link | Optional[str] | No | The override link for the widget |
| markdown_link_allowed_hosts | Optional[List[AllowlistItem]] | No | List of allowed hostnames for clickable markdown links |
| markdown_link_include_www | Optional[bool] | No | Whether to automatically include www. variants of allowed hosts |
| markdown_link_allow_http | Optional[bool] | No | Whether to allow http:// in addition to https:// for allowed hosts |
| mic_muting_enabled | Optional[bool] | No | Whether to enable mic muting |
| transcript_enabled | Optional[bool] | No | Whether the widget should show the conversation transcript |
| text_input_enabled | Optional[bool] | No | Whether the user should be able to send text messages |
| conversation_mode_toggle_enabled | Optional[bool] | No | Whether to enable the conversation mode toggle in the widget |
| default_expanded | Optional[bool] | No | Whether the widget should be expanded by default |
| always_expanded | Optional[bool] | No | Whether the widget should always be expanded |
| text_contents | Optional[WidgetTextContents] | No | Text contents of the widget |
| styles | Optional[WidgetStyles] | No | Styles for the widget |
| language | str | Yes | The language code for the widget |
| supported_language_overrides | Optional[List[str]] | No | List of supported language override codes |
| language_presets | Optional[Dict[str, WidgetLanguagePresetResponse]] | No | Language presets for the widget |
| text_only | Optional[bool] | No | Whether the agent uses text-only mode |
| supports_text_only | Optional[bool] | No | Whether the agent can be switched to text-only mode |
| first_message | Optional[str] | No | The first message displayed by the widget |
| use_rtc | Optional[bool] | No | Whether to use WebRTC for conversation connections |
Usage Examples
from elevenlabs.types import WidgetConfigResponse
# Accessing widget configuration after retrieval from the API
config = WidgetConfigResponse(
language="en",
bg_color="#ffffff",
text_color="#000000",
btn_color="#3b82f6",
border_radius=8,
transcript_enabled=True,
text_input_enabled=True,
mic_muting_enabled=True,
)
# Check widget display properties
if config.always_expanded:
print("Widget is always expanded")
# Access language presets
if config.language_presets:
for lang_code, preset in config.language_presets.items():
print(f"Language: {lang_code}, First message: {preset.first_message}")