core.config_validator
配置验证模块
该模块提供配置文件结构验证、参数合法性检查和配置一致性验证功能。
Functions
生成默认配置 |
|
|
验证配置文件 |
Classes
配置验证器类 |
- class core.config_validator.ConfigValidator[source]
Bases:
object配置验证器类
- CONFIG_SCHEMA = {'properties': {'connectors': {'type': 'object'}, 'llm': {'properties': {'api_key': {'type': 'string'}, 'api_url': {'type': 'string'}, 'embedding_model': {'type': 'string'}, 'model': {'type': 'string'}, 'settings': {'type': 'object'}, 'type': {'type': 'string'}}, 'type': 'object'}, 'logging': {'properties': {'file': {'type': 'string'}, 'format': {'type': 'string'}, 'level': {'enum': ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], 'type': 'string'}}, 'type': 'object'}, 'processors': {'patternProperties': {'^[a-zA-Z_][a-zA-Z0-9_]*$': {'properties': {'class': {'type': 'string'}, 'config': {'type': 'object'}, 'enabled': {'type': 'boolean'}, 'module': {'type': 'string'}}, 'required': ['enabled'], 'type': 'object'}}, 'type': 'object'}, 'rag_settings': {'properties': {'prompt_template': {'type': 'string'}, 'threshold': {'maximum': 1.0, 'minimum': 0.0, 'type': 'number'}, 'top_k': {'maximum': 100, 'minimum': 1, 'type': 'integer'}}, 'type': 'object'}, 'storage': {'properties': {'base_path': {'type': 'string'}, 'output_path': {'type': 'string'}}, 'required': ['base_path', 'output_path'], 'type': 'object'}}, 'required': ['storage', 'processors'], 'type': 'object'}
- PROCESSOR_NAME_MAPPING = {'ClassificationProcessor': 'classification_processor', 'EmbeddingProcessor': 'embedding_processor', 'FormatConverter': 'format_converter', 'OCRProcessor': 'ocr_processor', 'PreProcessor': 'pre_processor', 'StructureProcessor': 'structure_processor', 'classification_processor': 'classification_processor', 'embedding_processor': 'embedding_processor', 'format_converter': 'format_converter', 'ocr_processor': 'ocr_processor', 'pre_processor': 'pre_processor', 'structure_processor': 'structure_processor'}
- REQUIRED_PROCESSORS = ['pre_processor', 'ocr_processor', 'structure_processor', 'embedding_processor']