INNER CODE UNIT · Python
restart
shakedzy/companion · companion.py:445
def restart() -> None:
"""
Restart app
"""
global config
try:
config = Config.from_yml_file(app_cache.config_file)
except FileNotFoundError:
app_cache.server_errors.append("Config file not found. Go to /setup to configure the app.")
config = Config({'bot': {'voice': 'xx-xx'}})
if app_cache.keys_file:
config.update_from_yml_file(app_cache.keys_file)
openai_client = utils.init_openai(config)
config.update(openai={'client': openai_client})
gcs_creds = utils.get_gcs_credentials(config)