MCPcopy Create free account
hub / github.com/ZyphrZero/z.ai2api_python / _validate_directory_path

Function _validate_directory_path

app/admin/api.py:255–265  ·  view source on GitHub ↗
(source_dir: str)

Source from the content-addressed store, hash-verified

253
254
255def _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)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected