Note
A theme is a collection of static resources including images, fonts, and color palettes that you can utilize to personalize the appearance of your AI DIAL Chat application. These resources can be stored anywhere and accessed by the chat application via the internet. We provide the AI DIAL Chat Themes service as a convenient method for hosting these static resources and making them accessible for the chat application(s). However, you have the flexibility to choose your own method for accomplishing this.
This approach, having static resources externally, enables developers and designers to work concurrently and implement changes to themes without having to rebuild the chat application Docker image.
Important
Note: after making changes into themes, it is necessary to restart the chat application to apply changes.
Tip
Chat application users can then select themes in user settings.
The HTTP server is run in Docker container. All you need is to install the latest Docker engine.
Run the build command to build a Docker image with the tag dial-chat-themes:latest
make buildExecute this command to run the Docker container and bind the container port 8080 to the host network interface localhost:80
make run- You can deploy AI DIAL Chat Themes service using a common dial Helm chart or using a stand-alone chart dial-extension.
Tip
Refer to AI DIAL Helm to learn about the deployment options and view the examples of charts.
-
In the config.json file, you can define and configure custom themes or use (edit) default ones. Images can be stored in the static folder as well. However, you can store images anywhere and provide URLs in the config file.
-
Further, it is necessary to configure AI DIAL Chat to access the static resources and the themes configuration. To do that, add
THEMES_CONFIG_HOSTto the chat configuration - refer to documentation for details.THEMES_CONFIG_HOSTenvironment variable contains the URL to your nginx server with the configuration and images (this is the case when you use AI DIAL Chat Themes to provide static resoures for the chat application). This ensures that the application fetches your configuration file during loading. If the environment variable is not provided, default themes and model icons will be applied. -
After applying changes, it is necessary to redeploy the themes server. Changes will take effect automatically on the chat UI after 24hrs or upon the page reload. All the configured themes will be available in the chat application in user settings.
Note
In the config.json file you can find two default themes: light☀️ and dark🌒 (default theme).
Tip
To declare a new theme, create an object inside the themes property and fill all the required fields as shown on the example:
Important
Note: if you create a list of custom themes, the first theme in the themes array will be used as a default one for new users. For other users, the theme will be fetched from a local storage.
// defined themes as an array
"themes": [
{
"displayName": "Light", // Displayed name in settings modal on UI
"id": "light", // Some kebab case id name
"app-logo": "logo.svg", // URL for website logo displayed
"colors": {
// Semantic colors which commonly used across entire application.
// See default configuration to check available colors
},
"font-family":"Inter" //Font for the theme
},
// Other themes
],The URL for app-logo will be recognized as a relative URL and transformed into {{host}}/app-logo.svg. You can also specify a full path to your images like https://some-path.svg, if you are hosting them at the external source.
Note
You can provide image URLs in the configuration file config.json. To achieve this, create the following structure:
{
"themes": [
// defined themes as an array
],
"images": {
// common for all themes image urls
"default-model": "", //default icon for applications without a custom icon configured
"default-addon": "", //default icon for addons without a custom icon configured
"favicon": "favicon.png" // Chat application favicon
}
}Important
Specify a full path to your images (e.g. https://some-path.svg) if you are hosting them at the external source; otherwise, a path will be recognized as a relative URL and transformed into {{host}}/app-logo.svg.
Note
Specify a hex value in colors. Refer to Hex Color for reference.
You can customize color palettes in the colors property for each object in the list of themes:
Important
Note, in the config.json file you can find default color palettes for both dark and light themes.
{
"themes": [
{
"displayName": "Dark",
"colors": {...}
},
{
"displayName": "Light",
"colors": {...}
}
]
}Note
The authColors property allows you to define custom color palettes specifically for the Sign in page. These colors can be used to style login, registration, and other authentication screens.
{
"themes": [
{
"displayName": "Dark",
"colors": {...}
},
"authColors": {
"bg-auth-layer-0": "#FFFFFF",
"bg-auth-layer-1": "#EFEFEF"
}
]
}Note
To customize banner images, you can provide image URLs inside the desired theme object:
- Locate or create the
bannersproperty inside the desired theme object in config.json. - Update or add values for
my-workspace-bannerandmarketplace-bannerwith the relative path or full URL of your custom images.
{
"themes": [
{
"displayName": "Dark",
"colors": {...}
},
"banners":{
"my-workspace-banner": "welcome-dark-my-apps.jpg",
"marketplace-banner": "welcome-dark.jpg"
}
]
}