refactor: add type hints and FileParser.is_supported() helper

- Add return type annotation (list[str]) to Config.validate()
- Add type annotations (msg: str, -> None) to logger convenience functions
- Add FileParser.is_supported() classmethod for checking file format support
This commit is contained in:
lllopic
2026-05-23 14:57:46 +08:00
parent fa0f6519b1
commit daec4b6be4
3 changed files with 21 additions and 7 deletions

View File

@@ -64,9 +64,9 @@ class Config:
REPORT_AGENT_TEMPERATURE = float(os.environ.get('REPORT_AGENT_TEMPERATURE', '0.5'))
@classmethod
def validate(cls):
def validate(cls) -> list[str]:
"""验证必要配置"""
errors = []
errors: list[str] = []
if not cls.LLM_API_KEY:
errors.append("LLM_API_KEY 未配置")
if not cls.ZEP_API_KEY: