Tool Calling
Connect LLMs to external data and systems.
Examples
tool
accepts a StandardSchemaV1
, automatically infers the type.
For convenience, we use valibot
as an example.
But this package uses xsschema
internally, so it supports any schema library that xsschema supports: e.g. zod
, valibot
, arktype
, etc.
See xsschema for more information.
These below examples require you to install a standard schema to json schema parser (a separate package). As they are not provided by zod or valibot natively.
Read more about them here
rawTool
accepts a JsonSchema
, execute params type to be defined manually.
Object
You can also pass an object directly without installing @xsai/tool
.
Edit on GitHub
Last updated on