feat: expose additional AI SDK core exports - #12
Conversation
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
There was a problem hiding this comment.
💡 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".
| "name": "veryfront", | ||
| "version": "0.0.66", | ||
| "version": "0.0.67", |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
tooltoaiToolto avoid naming conflict with veryfront's existingtoolexport - 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.
| 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"; |
There was a problem hiding this comment.
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.
16e220e to
1b56e0e
Compare
- 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)
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 modelconvertToModelMessages- Convert UI messages to model-compatible formatembed/embedMany- Embedding generationaiTool- Type-safe tool definition helper (renamed fromtoolto avoid conflict with veryfront's tool)createIdGenerator- Generate consistent message IDssmoothStream- Smooth streaming outputcosineSimilarity- Vector similarity calculationsExperimental Functions (subject to change)
experimental_generateImage- Image generationexperimental_transcribe- Audio to textexperimental_generateSpeech- Text to speechexperimental_createMCPClient- MCP server connectionUsage
Test plan