v0.0.19
⏺ Changelog (v0.0.18 → HEAD)
New Features
- Image Generation API - New image() function for generating images with a unified interface across providers
import { image, openai, Image } from '@providerprotocol/ai';
const gen = image({
model: openai('dall-e-3'),
params: { size: '1024x1024', quality: 'hd' }
});
const result = await gen.generate('A sunset over mountains');
console.log(result.images[0].image.toBase64());
- Image Class - New Image class for handling image content from multiple sources
import { Image } from '@providerprotocol/ai';
// From file
const fileImage = await Image.fromPath('./photo.jpg');
// From URL
const urlImage = Image.fromUrl('https://example.com/image.png');
// From bytes
const bytesImage = Image.fromBytes(uint8Array, 'image/png');
- Provider Image Support - Image generation now available for:
- OpenAI (DALL-E 2, DALL-E 3, GPT-image)
- Google (Imagen)
- xAI (Grok image models)Fixes & Improvements
- Google Embeddings - Added autoTruncate parameter support
import { embedding, google } from '@providerprotocol/ai';
const embed = embedding({
model: google('text-embedding-004'),
params: { autoTruncate: false } // Disable automatic truncation
});```
- Documentation Generation - Fixed docgen comment handling
Internal
- Added Claude skill for implementation code review
- Updated UPP spec (v1.2) with image generation proposal
**Full Changelog**: https://github.com/ProviderProtocol/ai/compare/v0.0.18...v0.0.19