Universal TypeScript library for interacting with multiple LLM providers through a unified interface. Supports 600+ models across 8 major providers with built-in cost calculation, streaming, and advanced features.
Status: In Progress - Updating to latest @google/genai SDK patterns Priority: Focus on Imagen models for image generation, latest Gemini 2.0 models for text
- Base Structure: BaseAdapter pattern with provider-specific implementations
- Testing: Real API call validation with comprehensive test suite
- Type Safety: Full TypeScript with proper type definitions
GoogleAdapter.ts- Text generation with Gemini modelsGeminiImageAdapter.ts- Image generation with Imagen modelsGoogleModels.ts- Model specifications and pricing
@google/genai: ^1.9.0- Latest Google Gen AI SDK- TypeScript 5.4.5
- Jest for testing
- PREPARE Phase: Analyzed current implementation and latest API docs
- ARCHITECT Phase: Planned separation of text vs image generation
- CODE Phase: Currently implementing updates to use latest API patterns
- ✅ Update GoogleAdapter.ts - latest text generation API
- ✅ Update GeminiImageAdapter.ts - Imagen API pattern
- ✅ Update GoogleModels.ts - latest Imagen models and pricing
- ✅ Update tests - real API validation with Imagen
- Text: Updated to use
ai.models.generateContent()pattern - Images: Implemented
ai.models.generateImages()withresponse.generatedImages[].image.imageBytes - Focus on Imagen models:
imagen-4.0-generate-preview-06-06,imagen-4-ultra
- ✅ GeminiImageAdapter: Updated to use exact user-specified API pattern
- ✅ GoogleAdapter: Updated to latest SDK patterns for text generation
- ✅ GoogleModels: Kept existing text models, updated image model specs
- ✅ Tests: Updated integration tests for Imagen 4 and 4 Ultra with realistic scenarios
- ✅ Imagen 4 support with multiple image generation (1-4 images)
- ✅ Imagen 4 Ultra support (single image, higher quality)
- ✅ Proper aspect ratio control (square, portrait, landscape, widescreen, fullscreen)
- ✅ Person generation control (allow/block)
- ✅ Cost calculation ($0.04 per image for Imagen 4, $0.06 for Ultra)
- ✅ Validation for model-specific constraints
- ✅ Base64 image response handling