Skip to content

feat: expose additional AI SDK core exports - #12

Merged
kwakayama merged 5 commits into
mainfrom
feat/expose-ai-sdk-core-exports
Dec 10, 2025
Merged

feat: expose additional AI SDK core exports#12
kwakayama merged 5 commits into
mainfrom
feat/expose-ai-sdk-core-exports

Conversation

@kwakayama

Copy link
Copy Markdown
Contributor

Summary

Adds re-exports for commonly used AI SDK functions that were previously missing from veryfront/ai:

Core Functions

  • streamObject - Stream structured data from a model
  • convertToModelMessages - Convert UI messages to model-compatible format
  • embed / embedMany - Embedding generation
  • aiTool - Type-safe tool definition helper (renamed from tool to avoid conflict with veryfront's tool)
  • createIdGenerator - Generate consistent message IDs
  • smoothStream - Smooth streaming output
  • cosineSimilarity - Vector similarity calculations

Experimental Functions (subject to change)

  • experimental_generateImage - Image generation
  • experimental_transcribe - Audio to text
  • experimental_generateSpeech - Text to speech
  • experimental_createMCPClient - MCP server connection

Usage

import { 
  streamText, 
  streamObject,
  convertToModelMessages,
  embed,
  createIdGenerator,
  openai 
} from 'veryfront/ai';

// Convert UI messages for model consumption
const result = streamText({
  model: openai('gpt-4o'),
  messages: convertToModelMessages(messages),
});

Test plan

  • Build npm package successfully
  • Verify exports are included in built output

Add re-exports for commonly used AI SDK functions:
- streamObject: Stream structured data from a model
- convertToModelMessages: Convert UI messages to model-compatible format
- embed/embedMany: Embedding generation
- aiTool: Type-safe tool definition helper (renamed from 'tool' to avoid conflict)
- createIdGenerator: Generate consistent message IDs
- smoothStream: Smooth streaming output
- cosineSimilarity: Vector similarity calculations

Also includes experimental functions (subject to change):
- experimental_generateImage
- experimental_transcribe
- experimental_generateSpeech
- experimental_createMCPClient

Bumps version to 0.0.67
Copilot AI review requested due to automatic review settings December 10, 2025 10:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread deno.json
Comment on lines 2 to +3
"name": "veryfront",
"version": "0.0.66",
"version": "0.0.67",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep npm and deno package versions in sync

Bumping the deno manifest to 0.0.67 while npm/package.json still declares 0.0.66 leaves the npm build advertising the old version; when running the release tasks (deno task build:npm/npm publish) the new AI exports cannot be published because npm will reject re-publishing 0.0.66, so npm consumers will miss the added exports until the npm version is bumped.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the AI SDK integration by re-exporting commonly used functions from the ai package through veryfront/ai. The main change adds structured data generation, message conversion, embeddings, utilities, and experimental features to complement the existing generateText and streamText exports.

Key Changes:

  • Added core AI SDK exports: streamObject, convertToModelMessages, embed, embedMany, and utilities (createIdGenerator, smoothStream, cosineSimilarity)
  • Renamed tool to aiTool to avoid naming conflict with veryfront's existing tool export
  • Added experimental AI SDK exports for image generation, transcription, speech synthesis, and MCP client creation
  • Bumped package version from 0.0.66 to 0.0.67

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/ai/index.ts Expanded AI SDK re-exports with structured comments organizing functions by category (text generation, embeddings, utilities, experimental)
deno.json Incremented package version to reflect new feature additions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ai/index.ts
Comment on lines +150 to +173
export {
// Text generation
generateText,
streamText,
// Structured data generation
generateObject,
streamObject,
// Message conversion
convertToModelMessages,
// Embeddings
embed,
embedMany,
// Tool helper
tool as aiTool, // Renamed to avoid conflict with veryfront's tool
// Utilities
createIdGenerator,
smoothStream,
cosineSimilarity,
// Experimental (subject to change)
experimental_generateImage,
experimental_transcribe,
experimental_generateSpeech,
experimental_createMCPClient,
} from "ai";

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aiTool export (renamed from tool to avoid conflict with veryfront's tool) is not documented in the README.md file. The AI SDK Integration section in the README should be updated to include documentation for this export and the other newly added exports (streamObject, convertToModelMessages, embed, embedMany, createIdGenerator, smoothStream, cosineSimilarity, and the experimental functions).

This would help users discover and understand how to use these new exports, especially the renamed aiTool function which could be confusing without proper documentation.

Copilot uses AI. Check for mistakes.
@kwakayama
kwakayama force-pushed the feat/expose-ai-sdk-core-exports branch from 16e220e to 1b56e0e Compare December 10, 2025 11:42
@kwakayama
kwakayama merged commit a4cf6ac into main Dec 10, 2025
1 check passed
@kwakayama
kwakayama deleted the feat/expose-ai-sdk-core-exports branch January 4, 2026 00:40
kojiwakayama added a commit that referenced this pull request Jan 28, 2026
- Validate entry integrity in getCachedTransformAsync (discard empty code)
- Store content-length hash instead of bare Date.now() in getOrComputeTransform
- Resolves architecture audit item #12 (Cache Hit Validation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants