feat(config): persist model selections via config_manager
- Add models.text, models.evil, models.japanese to restore_runtime_settings - Add model keys to reset_to_defaults with CONFIG defaults - Include model info in runtime_state for API visibility
This commit is contained in:
@@ -112,11 +112,14 @@ class ConfigManager:
|
||||
|
||||
# Map: config_runtime.yaml key path -> (globals attribute, converter)
|
||||
_SETTINGS_MAP = {
|
||||
"discord.language_mode": ("LANGUAGE_MODE", str),
|
||||
"autonomous.debug_mode": ("AUTONOMOUS_DEBUG", bool),
|
||||
"voice.debug_mode": ("VOICE_DEBUG_MODE", bool),
|
||||
"memory.use_cheshire_cat": ("USE_CHESHIRE_CAT", bool),
|
||||
"gpu.prefer_amd": ("PREFER_AMD_GPU", bool),
|
||||
"discord.language_mode": ("LANGUAGE_MODE", str),
|
||||
"autonomous.debug_mode": ("AUTONOMOUS_DEBUG", bool),
|
||||
"voice.debug_mode": ("VOICE_DEBUG_MODE", bool),
|
||||
"memory.use_cheshire_cat": ("USE_CHESHIRE_CAT", bool),
|
||||
"gpu.prefer_amd": ("PREFER_AMD_GPU", bool),
|
||||
"models.text": ("TEXT_MODEL", str),
|
||||
"models.evil": ("EVIL_TEXT_MODEL", str),
|
||||
"models.japanese": ("JAPANESE_TEXT_MODEL", str),
|
||||
}
|
||||
|
||||
restored = []
|
||||
@@ -253,6 +256,9 @@ class ConfigManager:
|
||||
"voice.debug_mode": ("VOICE_DEBUG_MODE", CONFIG.voice.debug_mode),
|
||||
"memory.use_cheshire_cat": ("USE_CHESHIRE_CAT", CONFIG.cheshire_cat.enabled),
|
||||
"gpu.prefer_amd": ("PREFER_AMD_GPU", CONFIG.gpu.prefer_amd),
|
||||
"models.text": ("TEXT_MODEL", CONFIG.models.text),
|
||||
"models.evil": ("EVIL_TEXT_MODEL", CONFIG.models.evil),
|
||||
"models.japanese": ("JAPANESE_TEXT_MODEL", CONFIG.models.japanese),
|
||||
}
|
||||
|
||||
reset_items = []
|
||||
@@ -308,6 +314,9 @@ class ConfigManager:
|
||||
"bipolar_mode": getattr(g, "BIPOLAR_MODE", False),
|
||||
"language_mode": getattr(g, "LANGUAGE_MODE", "english"),
|
||||
"current_gpu": self._current_gpu,
|
||||
"text_model": getattr(g, "TEXT_MODEL", "llama3.1"),
|
||||
"evil_text_model": getattr(g, "EVIL_TEXT_MODEL", "darkidol"),
|
||||
"japanese_text_model": getattr(g, "JAPANESE_TEXT_MODEL", "swallow"),
|
||||
}
|
||||
|
||||
def get_state(self, key: str, default: Any = None) -> Any:
|
||||
|
||||
Reference in New Issue
Block a user