zodTool
Call Signature
Section titled “Call Signature”function zodTool<I, O, R>(spec): Tool<I, O>;Defined in: core/src/zod.ts:218
A zod tool that checks its results too. It returns what output makes of run’s result, so
run can return unknown, or the string a transform turns into a Date.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
I |
O |
R |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
spec |
ZodToolSpec<I, O, R> & object |
Returns
Section titled “Returns”Tool<I, O>
Call Signature
Section titled “Call Signature”function zodTool<I, O>(spec): Tool<I, O>;Defined in: core/src/zod.ts:226
A tool whose arguments are validated by zod, with the failure reported to
the model in words it can act on. topic: expected string, received number
beats a stack trace it cannot read.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
I |
O |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
spec |
ZodToolSpec<I, O> |
Returns
Section titled “Returns”Tool<I, O>