enterprise_ai.packs.tools
Source: sdks/python/src/enterprise_ai/packs/tools.py. Back to the Python SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class ToolMissing
A required external binary is not installed.
RuntimeError
Functions
toolchain_dir
toolchain_dir() -> Path
Directory of the downloaded pack toolchain: EAI_TOOLCHAIN_DIR, default /tmp/toolchains.
This element takes no parameter.
Returns: Path. Path of the toolchain directory.
find_tool
find_tool(name: str) -> str
Path of an external tool of the pack toolchain: EAI_<NAME>_BIN, then $EAI_TOOLCHAIN_DIR/<name>, then PATH.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | str | yes | Name of the binary, such as cosign, oras, trivy, opa, fga or zot. |
Returns: str. Path of the executable; raises ToolMissing when it is found nowhere.
Raises: ToolMissing.
pack_python
pack_python() -> str
Interpreter running the pack code (MCP SDK, pytest): EAI_PACK_PYTHON or the venv of packs/bootstrap.sh.
This element takes no parameter.
Returns: str. Path of the interpreter: EAI_PACK_PYTHON, or else <toolchain_dir>/packs-venv/bin/python; raises ToolMissing when the file does not exist.
Raises: ToolMissing.
run
run(command: list[str], cwd: str | Path | None = None, env: dict[str, str] | None = None, timeout: int = 600, check: bool = True, stdin: str | None = None) -> subprocess.CompletedProcess
Argument list, never a shell; stdout and stderr captured as text.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
command | list[str] | yes | Program and its arguments, run without a shell. | |
cwd | str | Path | None | None | no | Working directory of the process; the current one when omitted. |
env | dict[str, str] | None | None | no | Environment of the process; the current environment when omitted. |
timeout | int | 600 | no | Maximum duration in seconds (default 600). |
check | bool | True | no | Raise RuntimeError with the end of the output when the exit code is not 0 (default True). |
stdin | str | None | None | no | Text written to the standard input of the process. |
Returns: subprocess.CompletedProcess. subprocess.CompletedProcess with returncode, stdout and stderr as text.
Raises: RuntimeError.