configuration
langroid/utils/configuration.py
SettingsProxy
¶
A proxy for the settings that returns a thread‐local override if set, or else falls back to the global settings.
update_global_settings(cfg, keys)
¶
Update global settings so that modules can later access them via, e.g.,
from langroid.utils.configuration import settings
if settings.debug: ...
This updates the global default.
Source code in langroid/utils/configuration.py
set_global(key_vals)
¶
temporary_settings(temp_settings)
¶
Temporarily override the settings for the calling thread.
Within the context, any access to "settings" will use the provided temporary settings. Once the context is exited, the thread reverts to the global settings.
Source code in langroid/utils/configuration.py
quiet_mode(quiet=True)
¶
Temporarily override settings.quiet for the current thread. This implementation builds on the thread‑local temporary_settings context manager. The effective quiet mode is merged: if quiet is already True (from an outer context), then it remains True even if a nested context passes quiet=False.
Source code in langroid/utils/configuration.py
set_env(settings_instance)
¶
Set environment variables from a BaseSettings instance.
Each field in the settings is written to os.environ.