Documentation
¶
Overview ¶
Package toolargs repairs the one argument mistake a model cannot repair by itself: sending a single value where the tool spec declares an array.
gollem validates a call's arguments against the ToolSpec before the tool runs and rejects the whole call on a mismatch ("expected array type"), so a tool never gets the chance to interpret what it was sent. That rejection is fed back to the model, but in production (memo__apply_memo_changes, ARGUS-8S) the model answered it by re-emitting the same call, and the writes the call carried were never applied while the run reported success.
Two readings need no guessing: a lone value where an array is required is the batch of one the model meant, and a string holding a JSON array is that array double-encoded. Nothing else is interpreted, and the repair is kept only when it makes the whole call valid — otherwise the call goes to gollem exactly as the model sent it, so the rejection and the shape toolArgsFeedbackMiddleware (pkg/agent/kernel) reports describe what the model actually did, not a half-applied guess at it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Coerce ¶
func Coerce(tools []gollem.Tool, call gollem.FunctionCall) gollem.FunctionCall
Coerce returns call with the argument shapes above rewritten into what the tool declares, descending into declared object properties and array items. The call is returned unchanged when nothing needs rewriting, when the rewrite does not make the call valid, or when no tool of that name is present. The input arguments are never mutated, because the call is held on a Strategy's checkpointed state and a replayed transition coerces the same original again.
Types ¶
This section is empty.