Overview
core-ai exports a small set of helpers for schema conversion, assistant message construction, and provider-specific metadata access.zodSchemaToJsonSchema()
Convert a Zod schema to JSON Schema using Zod 4’s native conversion APIs.resultToMessage()
Convert aGenerateResult into an AssistantMessage so you can continue a conversation with the assistant’s full response parts.
Options
includeReasoning: false if you want to drop reasoning parts when reusing the message.
assistantMessage()
Create a simple assistant message from plain text.getProviderMetadata()
Read provider-specific metadata from reasoning parts in a type-safe way.'anthropic', 'google', or 'openai'.