Documentation
¶
Overview ¶
Package toolagent provides a reference harness that lets the model call tools, each one gated on a human decision. Every call it makes is REQUIRES_APPROVAL: the host parks the turn, and only an approved call reaches the host's tool executor. The harness never runs a tool itself, holds no credentials, and keeps no state beyond the journal, so it is STATELESS_REPLAY.
Mediation is fixed by the harness, not by per-execution config: a caller that could choose it could also skip the approval.
Index ¶
Constants ¶
const MaxModelCalls = 8
MaxModelCalls bounds the model calls in one turn, so a model that keeps calling tools cannot loop forever. A turn that reaches it fails.
Variables ¶
var ErrInvalidToolCall = errors.New("toolagent: model tool call needs a unique ID")
ErrInvalidToolCall is returned for a model tool call the harness cannot gate: no call ID, or an ID the turn already used. The host would refuse the call anyway; this names the cause.
var ErrTooManyModelCalls = errors.New("toolagent: too many model calls in one turn")
ErrTooManyModelCalls is returned when a turn reaches MaxModelCalls without a final answer.
Functions ¶
func PublishTool ¶
func PublishTool() api.ToolDefinition
PublishTool is the tool the documented executor example (docs/tool-executor-example.py) serves: publish one text. harnessnode offers it with HARNESS_KIND=tool. Each call returns a new value, so no caller can change another's schema.
Types ¶
type Harness ¶
type Harness struct {
Model string
// Tools are offered to the model in this order. Each name needs a host executor route for an
// approved call to run.
Tools []api.ToolDefinition
}
Harness offers Tools to the model on every call, turns each tool call in a completion into a REQUIRES_APPROVAL ToolCall, and feeds the result back until the model answers without one.
func (Harness) Describe ¶
Describe declares the model, the gated tools and the stateless replay contract.