ToDoAgent / LLM /todogen_LLM /path_validator.py
Siyu Wang
updated to KK_Server
84ed1d1
raw
history blame contribute delete
499 Bytes
# 统一路径验证机制
from pathlib import Path
from config_loader import get_paths
def validate_paths():
paths = get_paths()
required_dirs = [
paths['base_dir'],
paths['data_dir'],
paths['logging_dir']
]
for dir_path in required_dirs:
if not dir_path.exists():
dir_path.mkdir(parents=True, exist_ok=True)
if not dir_path.is_dir():
raise NotADirectoryError(f"路径配置错误: {dir_path}")