ToolProfileStats#

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

class zett_agent.jit_harness.profiling.ToolProfileStats(*, tool_name, call_count=0, completed_count=0, failed_count=0, cancelled_count=0, rejected_count=0, average_duration_ms=None, average_input_chars=None, average_output_chars=None)[source]#

Lifetime totals for one tool in one harness, counting finished attempts.

Averages use measured samples only; unknown lengths never count as zero. Parent duration includes child duration, so summing parent and child times double-counts nested work. Tool updates preserve these lifetime totals.

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:
  • tool_name (str)

  • call_count (int)

  • completed_count (int)

  • failed_count (int)

  • cancelled_count (int)

  • rejected_count (int)

  • average_duration_ms (float | None)

  • average_input_chars (float | None)

  • average_output_chars (float | None)

call_count: int#

Finished attempts observed for this tool.

completed_count: int#

Finished attempts, one field per ToolCallStatus outcome.

average_duration_ms: float | None#

Mean finished-attempt timing in milliseconds; null until one finishes.

average_input_chars: float | None#

Mean measured lengths; unmeasurable attempts contribute no sample, so an average is null when nothing could be measured.

Fields#

tool_name (required)

See the typed model signature for this field.

call_count (optional)

See the typed model signature for this field.

completed_count (optional)

See the typed model signature for this field.

failed_count (optional)

See the typed model signature for this field.

cancelled_count (optional)

See the typed model signature for this field.

rejected_count (optional)

See the typed model signature for this field.

average_duration_ms (optional)

See the typed model signature for this field.

average_input_chars (optional)

See the typed model signature for this field.

average_output_chars (optional)

See the typed model signature for this field.