GadgetExample
Defined in: gadgets/types.ts:20
Example of gadget usage to help LLMs understand proper invocation.
Examples are rendered alongside the schema in getInstruction() to provide
concrete usage patterns for the LLM.
Example
Section titled “Example”const calculator = createGadget({ schema: z.object({ a: z.number(), b: z.number() }), examples: [ { params: { a: 5, b: 3 }, output: "8", comment: "Addition example" } ], // ...});Type Parameters
Section titled “Type Parameters”TParams
Section titled “TParams”TParams = Record<string, unknown>
Inferred parameter type from Zod schema (defaults to Record<string, unknown>)
Properties
Section titled “Properties”comment?
Section titled “comment?”
optionalcomment:string
Defined in: gadgets/types.ts:28
Optional description explaining what this example demonstrates
output?
Section titled “output?”
optionaloutput:string
Defined in: gadgets/types.ts:25
Optional expected output/result string
params
Section titled “params”params:
TParams
Defined in: gadgets/types.ts:22
Example parameter values (typed to match schema)