PythonToolSource#

Create, compose, unload, and save session-local Python tools. See the guide.

class zett_agent.jit_harness.snapshot.PythonToolSource(*, name, source, entrypoint, description, parameters, guidelines, snippet='', execution_mode=ToolExecutionMode.PARALLEL, files=<factory>)[source]#

Trusted source and the tool definition validated when it was registered.

Reading this record does not execute Python. Activation recompiles the source and regenerates the schema; stored metadata is descriptive only. source is the entry point module, which is also the package root, so files holds the other modules of the package, imported relative to it.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • name (str)

  • source (Annotated[str, MinLen(min_length=1)])

  • entrypoint (Annotated[str, MinLen(min_length=1)])

  • description (Annotated[str, MinLen(min_length=1)])

  • parameters (dict[str, Any])

  • guidelines (Annotated[tuple[str, ...], MinLen(min_length=1)])

  • snippet (str)

  • execution_mode (ToolExecutionMode)

  • files (dict[str, str])

files: dict[str, str]#

Additional modules, keyed by relative path such as helpers.py.

Fields#

name (required)

See the typed model signature for this field.

source (required)

See the typed model signature for this field.

entrypoint (required)

See the typed model signature for this field.

description (required)

See the typed model signature for this field.

parameters (required)

See the typed model signature for this field.

guidelines (required)

See the typed model signature for this field.

snippet (optional)

See the typed model signature for this field.

execution_mode (optional)

See the typed model signature for this field.

files (optional)

See the typed model signature for this field.