Download the PHP package lingoda/ai-bundle without Composer
On this page you can find all versions of the php package lingoda/ai-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ai-bundle
Lingoda AI Bundle
Symfony bundle for the Lingoda AI SDK, providing seamless integration with Symfony's dependency injection container and configuration system.
Features
- 🎯 Dual Platform Architecture: Multi-provider Platform for flexibility + Single-provider platforms for simplicity
- 🔌 Smart Autowiring: Named parameter injection (
Platform $openaiPlatform) - ⚡ Simple ask() Method:
$platform->ask('question')for minimal code - 🛡️ Data Sanitization: Built-in protection for sensitive information (inherited from AI SDK)
- 🚦 Enhanced Rate Limiting: Built-in Symfony-managed rate limiting (enabled by default)
- 🎭 Full AI SDK Power: Complete access to all AI SDK capabilities and models
- 📦 Simple Setup: Straightforward configuration with environment variables
- 🔧 Full Symfony Integration: DI container, configuration, logging, console commands
Installation
Quick Start
1. Installation
2. Configuration
Create config/packages/lingoda_ai.yaml and add your API keys to .env:
Step 1: Add API keys to .env
Step 2: Create configuration file
Create config/packages/lingoda_ai.yaml:
3. Usage
The bundle provides two usage patterns:
Usage Patterns
Pattern 1: Multi-Provider Platform (Flexible)
Use when you need access to multiple AI providers in the same service:
Pattern 2: Single-Provider Platforms (Simple)
Use when you want dedicated platforms for specific providers:
Advanced AI SDK Features
All AI SDK features work seamlessly:
Rate Limiting
The bundle provides enhanced rate limiting that integrates with Symfony's rate limiter component (enabled by default):
Enhanced Rate Limiting (Enabled by Default)
The Bundle enables enhanced rate limiting by default with sensible provider defaults:
Custom Rate Limits (Optional)
Configure custom limits per provider when needed:
Benefits of Enhanced Rate Limiting (Default):
- Shared State: Multiple app instances share rate limits via Redis
- Provider Defaults: Sensible rate limits for each provider out of the box
- Environment-Specific: Different limits for dev/staging/prod
- Monitoring: Integration with Symfony profiler for debugging
- Custom Limits: Override with provider-specific limits based on your API quotas
When to Keep Enabled (Default):
- ✅ Most production applications (recommended default)
- ✅ Multi-instance deployments (load balanced apps)
- ✅ Applications needing predictable rate limiting behavior
When to Disable:
- ❌ Local development with unlimited API quotas
- ❌ Testing environments where you want to bypass limits
See Rate Limiting Documentation for complete configuration options.
Advanced Configuration
Custom HTTP Clients
You can configure custom HTTP clients per provider for advanced retry logic, timeouts, and request customization:
This gives you full control over:
- Retry strategies for handling rate limits and network errors
- Custom timeouts per provider based on your needs
- Request/response headers for debugging and user-agent identification
- Base URIs if using proxy servers or custom endpoints
Console Commands
The bundle provides helpful console commands:
Development
Code Quality
Requirements
- PHP ^8.3
- Symfony ^6.4|^7.0
- lingoda/ai-sdk
Available Services
The bundle automatically registers these services based on your configured API keys:
Multi-Provider Services
lingoda_ai.platform- Main Platform service with all configured providersLingoda\AiSdk\Platform- Alias to the main Platform serviceLingoda\AiSdk\PlatformInterface- Interface alias to the main Platform service
Single-Provider Services
openaiPlatform- OpenAI-only platform (ifOPENAI_API_KEYconfigured)anthropicPlatform- Anthropic-only platform (ifANTHROPIC_API_KEYconfigured)geminiPlatform- Gemini-only platform (ifGEMINI_API_KEYconfigured)
Autowiring Support
Architecture Benefits
- 🎯 Dual Architecture: Choose multi-provider flexibility OR single-provider simplicity
- 📦 Simple Setup: Straightforward configuration with environment variables
- 🔌 Smart Autowiring: Named parameter injection automatically wires correct providers
- ⚡ Full AI SDK Power: Complete access to all AI SDK features and capabilities
- 🛡️ Built-in Security: Automatic data sanitization inherited from AI SDK
- 🎭 Provider Flexibility: Register only the providers you need
Supported Models & Features
The bundle supports all models and features from the Lingoda AI SDK:
OpenAI Models: GPT-5, GPT-4.1, GPT-4o series, Audio models (Whisper, TTS) Anthropic Models: Claude 4.1, Claude 4.0, Claude 3.7, Claude 3.5 series Google Models: Gemini 2.5 Pro and Flash with 1M context
AI Capabilities: Text generation, conversations, audio synthesis/transcription, parameterized prompts, streaming, vision, tools, reasoning, and more.
See the AI SDK documentation for complete feature documentation.
Getting Help
- 📖 AI SDK Docs: Complete documentation
- 🐛 Issues: Report bugs or request features
- 💬 Discussions: Community discussions
License
MIT License. See LICENSE for details.
All versions of ai-bundle with dependencies
lingoda/ai-sdk Version ^1.2
symfony/config Version ^6.4|^7.0|^8.0
symfony/console Version ^6.4|^7.0|^8.0
symfony/dependency-injection Version ^6.4|^7.0|^8.0
symfony/framework-bundle Version ^6.4|^7.0|^8.0
symfony/lock Version ^6.4|^7.0|^8.0
symfony/rate-limiter Version ^6.4|^7.0|^8.0
symfony/yaml Version ^6.4|^7.0|^8.0
webmozart/assert Version ^1.11