(source_dir: str)
| 253 | |
| 254 | |
| 255 | def _validate_directory_path(source_dir: str) -> str: |
| 256 | if not source_dir: |
| 257 | raise ValueError("请先填写服务端可访问的本地目录路径。") |
| 258 | |
| 259 | source_path = Path(source_dir).expanduser() |
| 260 | if not source_path.exists(): |
| 261 | raise ValueError(f"导入目录不存在: {source_path}") |
| 262 | if not source_path.is_dir(): |
| 263 | raise ValueError(f"导入路径不是目录: {source_path}") |
| 264 | |
| 265 | return str(source_path) |
| 266 | |
| 267 | |
| 268 | @router.get("/token-pool", response_class=HTMLResponse) |
no outgoing calls
no test coverage detected