Refactor config system to use Pydantic validation

Refactored configuration classes to inherit from a new ValidatedConfigBase using Pydantic for robust validation and error reporting. Updated api_ada_configs.py, config.py, config_base.py, and official_configs.py to replace dataclasses with Pydantic models, add field validation, and improve error messages. This change enhances configuration reliability and developer feedback for misconfigurations. Also includes minor code cleanups and removal of unused variables in other modules.
This commit is contained in:
雅诺狐
2025-08-19 15:33:43 +08:00
committed by Windpicker-owo
parent 97ece6524c
commit bb4592846c
19 changed files with 717 additions and 1288 deletions

View File

@@ -95,7 +95,7 @@ class MainSystem:
from random import choices
# 分离彩蛋和权重
egg_texts, weights = zip(*phrases)
egg_texts, weights = zip(*phrases, strict=False)
# 使用choices进行带权重的随机选择
selected_egg = choices(egg_texts, weights=weights, k=1)