- Can I use this package in a Laravel app without Symfony AI?
- No, this package requires `symfony/ai-platform:^0.9`, which may not natively integrate with Laravel. If you’re not using Symfony AI, consider alternatives like `spatie/laravel-ai` or direct OpenAI SDKs. For Laravel-only stacks, you’d need to wrap Symfony components manually, which adds complexity.
- How do I migrate from raw OpenAI SDK calls to this package?
- Replace direct OpenAI SDK calls with the `Provider` abstraction (e.g., `OpenResponsesProvider`). Refactor your AI service classes to use the standardized `OpenResponses` contract. Test responses against the [Open Responses spec](https://www.openresponses.org/specification) to ensure compliance.
- Does this package support streaming responses in Laravel?
- Yes, via the `DeltaInterface` introduced in v0.7.0. For Laravel, you’ll need to adapt Symfony’s streaming logic to Laravel’s event system or use a queue-based approach. Check the [Symfony AI docs](https://symfony.com/doc/current/ai.html) for integration examples.
- What Laravel versions are supported?
- Laravel 10+ is officially supported due to PHP 8.2+ requirements. Laravel 9 may work with backported Symfony dependencies, but test thoroughly. For older versions, consider upgrading or using a different package like `spatie/laravel-ai`.
- How do I configure multi-provider routing (e.g., OpenAI + Anthropic)?
- Use the `Provider` abstraction to route requests dynamically. Define providers in your config (e.g., `openai`, `anthropic`) and let the package handle switching. Example: `new OpenResponsesProvider(new OpenAIClient(), new AnthropicClient())`. See the [Symfony AI docs](https://symfony.com/doc/current/ai.html) for provider setup.
- Will this package break existing AI logic in my Laravel app?
- Potentially, if your app uses custom AI handlers or non-standard response formats. Audit your AI services to ensure they comply with the [Open Responses spec](https://www.openresponses.org/specification). Refactor non-compliant logic to use the `Provider` abstraction or wrap legacy APIs.
- Is there a performance overhead for using this package?
- Minimal overhead for basic use cases, but multi-provider routing may introduce slight latency. Benchmark your AI endpoints to compare raw SDK calls vs. this package. Streaming responses (`DeltaInterface`) could add complexity but not necessarily latency.
- Can I use this with Laravel’s spatie/laravel-ai package?
- Yes, if `spatie/laravel-ai` uses Symfony AI under the hood. Replace OpenAI-specific logic in your app with the `OpenResponsesProvider`. Ensure both packages share the same Symfony AI version (`^0.9`) to avoid conflicts.
- How do I test multi-provider routing in CI?
- Mock the `Provider` abstraction in PHPUnit to simulate different AI providers (e.g., OpenAI, Anthropic). Use dependency injection to swap providers during tests. Example: `app()->bind(ProviderInterface::class, MockProvider::class)`. Validate responses against the Open Responses spec.
- Are there alternatives for Laravel if I don’t want Symfony dependencies?
- Yes, consider `spatie/laravel-ai` (OpenAI-focused) or direct OpenAI SDKs (`openai-php/client`). For multi-provider support without Symfony, you’d need to build a custom abstraction layer. This package is ideal if you’re already using Symfony AI or want Open Responses standardization.