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:
@@ -102,6 +102,11 @@ __all__ = [
|
||||
# 工具函数
|
||||
"ManifestValidator",
|
||||
"get_logger",
|
||||
# 依赖管理
|
||||
"get_dependency_manager",
|
||||
"configure_dependency_manager",
|
||||
"get_dependency_config",
|
||||
"configure_dependency_settings",
|
||||
# "ManifestGenerator",
|
||||
# "validate_plugin_manifest",
|
||||
# "generate_plugin_manifest",
|
||||
|
||||
@@ -595,7 +595,6 @@ class PluginManager:
|
||||
def _refresh_anti_injection_skip_list(self):
|
||||
"""插件加载完成后刷新反注入跳过列表"""
|
||||
try:
|
||||
# 异步刷新反注入跳过列表
|
||||
import asyncio
|
||||
from src.chat.antipromptinjector.command_skip_list import skip_list_manager
|
||||
|
||||
|
||||
Reference in New Issue
Block a user