- remove allowed_langages from tenant - Correct bugs in Tenant, TenantMake, SpecialistMagicLink - Change chat client customisation elements
46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
"""
|
|
Utility functions for chat customization.
|
|
"""
|
|
|
|
def get_default_chat_customisation(tenant_customisation=None):
|
|
"""
|
|
Get chat customization options with default values for missing options.
|
|
|
|
Args:
|
|
tenant_customization (dict, optional): The tenant's customization options.
|
|
Defaults to None.
|
|
|
|
Returns:
|
|
dict: A dictionary containing all customization options with default values
|
|
for any missing options.
|
|
"""
|
|
# Default customization options
|
|
default_customisation = {
|
|
'primary_color': '#007bff',
|
|
'secondary_color': '#6c757d',
|
|
'background_color': '#ffffff',
|
|
'text_color': '#212529',
|
|
'sidebar_color': '#f8f9fa',
|
|
'sidebar_background': '#2c3e50',
|
|
'gradient_start_color': '#f5f7fa',
|
|
'gradient_end_color': '#c3cfe2',
|
|
'markdown_background_color': 'transparent',
|
|
'markdown_text_color': '#ffffff',
|
|
'sidebar_markdown': '',
|
|
'welcome_message': 'Hello! How can I help you today?',
|
|
}
|
|
|
|
# If no tenant customization is provided, return the defaults
|
|
if tenant_customisation is None:
|
|
return default_customisation
|
|
|
|
# Start with the default customization
|
|
customisation = default_customisation.copy()
|
|
|
|
# Update with tenant customization
|
|
for key, value in tenant_customisation.items():
|
|
if key in customisation:
|
|
customisation[key] = value
|
|
|
|
return customisation
|