Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Ai Gemini Platform

Ai Gemini Platform Laravel Package

symfony/ai-gemini-platform

Symfony AI bridge for Google’s Gemini platform. Integrates Gemini generateContent (incl. streaming) and embeddings APIs, linking to official docs and API reference. Includes licensed media fixtures for tests and points to the main Symfony AI repo for issues/PRs.

View on GitHub
Deep Wiki
Context7

Google Gemini platform bridge for Symfony AI

Frequently asked questions about Ai Gemini Platform
How do I install the Symfony AI Gemini bridge in a Laravel 10+ project?
Use Composer to install the package with `composer require symfony/ai-gemini-platform`. Laravel’s autoloader will handle dependencies like Symfony’s HTTP client and Messenger. Configure the API key in `.env` and bind the `ClientInterface` in a service provider for dependency injection.
Does this package support Laravel’s service container for dependency injection?
Yes, the package integrates natively with Laravel’s container. Bind the `ClientInterface` or `ModelClient` in your `AppServiceProvider` or a dedicated service provider. Laravel’s DI will resolve dependencies like configuration and HTTP clients automatically.
Can I use Google Gemini’s streaming responses in Laravel for real-time chatbots?
Absolutely. The package supports streaming via `DeltaInterface`, which you can pair with Laravel Echo or WebSockets (e.g., Pusher) to handle chunked responses in real time. Process each chunk asynchronously using Laravel’s queues for scalability.
What Laravel versions are officially supported by this package?
The package targets Symfony 7+, which aligns with Laravel 10+. For Laravel 9, you may encounter version conflicts with Symfony components. Mitigate this by using standalone Symfony packages or upgrading Laravel to a supported version.
How do I handle file uploads (images, PDFs) for Gemini’s multimodal API in Laravel?
Use Laravel’s `Storage` facade to preprocess files (e.g., convert to base64 or stream directly) before passing them to Gemini’s `generateContent()` or `batchEmbedContents()`. The package supports binary media, but Laravel’s file handling may require adaptation for `MultiPartResult` compatibility.
Are there built-in tools for error handling and retries in Laravel?
Yes, leverage Symfony’s `RetryMiddleware` and `StreamingMiddleware`, which can be adapted for Laravel’s HTTP client stack. The package also provides uniform error handling, allowing Laravel’s exception system to display user-friendly messages for API failures or rate limits.
Can I use this package for background processing, like batch embeddings?
Yes, wrap Gemini’s async operations (e.g., `batchEmbedContents()`) in Laravel’s queues. Dispatch a job to process embeddings in the background, then retrieve results later. This is ideal for performance-critical applications like semantic search or document analysis.
What are the alternatives to this package for Laravel?
For Laravel-specific solutions, consider Spatie’s AI packages or direct Google API client libraries (e.g., `google/cloud-ai`). However, this Symfony bridge offers deeper integration with Laravel’s ecosystem (e.g., service container, Messenger) and multimodal support out of the box.
How do I test the package with the provided fixtures?
The package includes licensed media fixtures (images, audio, PDFs) in `Tests/Fixtures/`. Use them in your tests by loading files via Laravel’s `Storage` or `public_path()` helper. Ensure your test environment has access to these files for multimodal API validation.
What should I do if Google’s Gemini preview models (e.g., gemini-3.1-pro-preview) change or deprecate?
Monitor Google’s [Gemini API changelog](https://ai.google.dev/) for updates. The package’s `Provider` abstraction allows dynamic model routing, so you can configure fallbacks to stable models (e.g., `gemini-3-flash-preview`) in Laravel’s config or service providers.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky