Expand description
Tool argument validation: coerce what models commonly get wrong, then check the JSON schema with TypeBox’s error messages.
Port of packages/ai/src/utils/validation.ts in pi v1.0.0. The checker covers
the JSON Schema keywords tool schemas use. $ref, format and pattern are
accepted without checking.
Functions§
- validate_
tool_ arguments - Validated, coerced arguments for
call, or the error pi reports to the model.