valibotSchema
Helper function for creating Valibot schemas
valibotSchema is a helper function that converts a Valibot schema into a JSON schema object
that is compatible with the AI SDK.
It takes a Valibot schema as input, and returns a typed schema.
You can use it to generate structured data and in tools.
Example
Import
import { valibotSchema } from "@ai-sdk/valibot"
API Signature
Parameters
valibotSchema:
GenericSchema<unknown, T>
The Valibot schema definition.
Returns
A Schema object that is compatible with the AI SDK, containing both the JSON schema representation and validation functionality.