- Initialisation of the EveAI Chat Client.
- Introduction of Tenant Makes
This commit is contained in:
42
common/utils/chat_utils.py
Normal file
42
common/utils/chat_utils.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""
|
||||
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',
|
||||
'logo_url': None,
|
||||
'sidebar_text': None,
|
||||
'welcome_message': 'Hello! How can I help you today?',
|
||||
'team_info': []
|
||||
}
|
||||
|
||||
# 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
|
||||
Reference in New Issue
Block a user