0
Fork 0
mirror of https://github.com/TanStack/ai.git synced 2026-11-18 19:34:58 +00:00
ai/docs/reference/functions/parseWithStandardSchema.md
github-actions[bot] 273a212bcc
docs: regenerate API documentation (#1265)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-31 18:34:13 +02:00

853 B

id title
parseWithStandardSchema parseWithStandardSchema

Function: parseWithStandardSchema()

function parseWithStandardSchema<T>(schema, data): T;

Defined in: packages/ai/src/activities/chat/tools/schema-converter.ts:456

Synchronously validates data against a Standard Schema compliant schema. Note: Some Standard Schema implementations may only support async validation. In those cases, this function will throw.

Type Parameters

T

T

Parameters

schema

unknown

Standard Schema compliant schema

data

unknown

Data to validate

Returns

T

Parsed/validated data

Throws

StandardSchemaValidationError if validation fails; Error if the schema only supports async validation.