function setTheme(theme = null, forceAssistantResponseThemeChange = true) {
  const effectiveTheme = getEffectiveTheme(theme || assistantConfig.theme);
  const themeLabel = effectiveTheme === 'light' ? 'light-theme' : 'dark-theme';

  Object.keys(themes[themeLabel]).forEach((cssVariable) => {
    document.documentElement.style.setProperty(
      cssVariable,
      themes[themeLabel][cssVariable],
    );
  });

  console.log(...consoleMessage(
    `Setting theme: ${effectiveTheme} (${assistantConfig.theme})`,
  ));

  if (
    forceAssistantResponseThemeChange
    && document.querySelector('.assistant-markup-response')
  ) {
    displayScreenData(history[historyHead]['screen-data']);
  }

  document
    .querySelector('#master-bg')
    .setAttribute('data-theme', effectiveTheme);
}
Sets the theme based on the given `theme`.

@param {"dark" | "light" | "system"} theme
The theme which you want to switch to.
Ignore this parameter, if you want to set
the theme based on `assistantConfig.theme`

@param {boolean} forceAssistantResponseThemeChange
Change theme for Assistant Response screen.
_(Defaults to `true`)_