Weave 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

Symfony Laravel Package

google-gemini-php/symfony

Symfony integration for Google Gemini PHP, making it easy to configure the Gemini API and use text, chat, and vision features via Symfony services. Lightweight, framework-friendly setup for AI-powered apps.

View on GitHub
Deep Wiki
Context7

Symfony integration for the Google Gemini PHP client, providing a clean bundle to use Gemini’s generative AI models inside Symfony applications. Configure your API key and client options through Symfony configuration, then inject the ready-to-use client via dependency injection.

  • Symfony bundle with autoconfiguration and service registration
  • Flexible configuration for API credentials and client setup
  • Dependency injection support for cleaner, testable code
  • Built on the official google-gemini-php/client
  • Supports common Gemini workflows such as prompts, chat, and embeddings
Frequently asked questions about Symfony
How do I install google-gemini-php/symfony in a Symfony app?
Install it with composer require google-gemini-php/symfony, then register the bundle in config/bundles.php or rely on Symfony Flex auto-discovery if a recipe exists; verify that extra.symfony is declared before assuming auto-discovery. Set GEMINI_API_KEY in the environment, configure the API key, base URL, and default model in the bundle config, and inject the client service where needed. A Symfony developer should be able to get a completion returning in under a day; the harder work is deciding prompt ownership and response validation.
Does google-gemini-php/symfony work with Laravel?
No. google-gemini-php/symfony is a Symfony bundle, not a Laravel package; Laravel applications should use the Laravel sibling package instead of registering this bundle. If you are porting between the two, the config tree and facade semantics are close, so the work is mostly namespaces and service-container wiring. Do not install a Symfony bundle into Laravel just to reuse the Gemini client.
Which Symfony and PHP versions does google-gemini-php/symfony support?
The technical assessment positions it for Symfony 6.4/7.x on PHP 8.2+, which matches a modern LTS baseline, but you should verify the actual composer.json constraints against your lockfile. Check whether the package declares extra.symfony auto-discovery and whether its dependency on google-gemini-php/client pins versions that conflict with your stack. Treat the stated release date as something to verify against tag history before relying on active maintenance.
How do I configure GEMINI_API_KEY for the Symfony bundle?
Set GEMINI_API_KEY via environment and map it into the bundle's configuration tree, which also covers base URL and default model. The bundle is designed to wire the client through the service container so application code injects the facade rather than constructing it manually. Confirm whether configuration is validated at container compile time or only on first call, because that determines whether a missing key fails fast.
Can I autowire the Gemini client into Symfony services?
Yes. The bundle's main value is auto-wired service aliases and DI access to the Gemini client, so controllers and services can inject it instead of building the client themselves. For maintainability, wrap the injected vendor client in your own TextGenerationInterface or similar adapter and inject that interface in domain code. That keeps the vendor client type out of controllers and makes the dependency removable later.
Does google-gemini-php/symfony support streaming Gemini responses?
Streaming is an open question for this wrapper: the assessment explicitly asks whether it exposes SSE streaming or only buffered responses, so do not assume it does. Verify the upstream client and bundle API before designing a streaming UX. If streaming is not exposed, you can keep the bundle for buffered calls and use a separate direct HTTP path for SSE, but isolate that behind your adapter.
How should I test Gemini calls in a Symfony app?
The testing story must be verified: determine whether the client facade is mockable behind an interface or whether you have to stub HTTP. The safer pattern is to define your own adapter interface around Gemini calls and mock that in unit tests, leaving a small integration test for the real client. If you need HTTP-level tests, use Symfony's HTTP client testing tools or the upstream client's supported fake or mock path.
Is google-gemini-php/symfony safe for production?
Treat it as a time-boxed pilot rather than a proven production dependency: the assessment cites about 15 stars, 0 dependents, a community-maintained client, and likely one to two maintainers. It is not an official Google SDK, so you inherit the upstream library's release cadence and security posture. Approve it behind an internal adapter, verify the release and tag history, and make sure you can remove it in an afternoon.
Does the bundle handle timeouts, retries, and 429 errors?
Retry, timeout, and 429 handling are not clearly built into the bundle and should be verified; the assessment flags them as open questions. In practice, configure symfony/http-client timeouts and retries, handle 429 responses in your application layer, and use Cache or Redis for per-tenant rate limiting. Also confirm which PSR-18/HTTPlug discovery path the client uses so symfony/http-client is picked up cleanly.
How do I migrate from raw Guzzle or cURL to google-gemini-php/symfony?
For existing raw cURL or Guzzle calls, put your own adapter interface in front of the current Gemini code first, ship it unchanged, then swap the adapter body to the bundle in a follow-up. For a Laravel sibling package migration, expect mostly namespace and service-container changes because the config tree and facade semantics are close. In all cases, verify the bundle's Composer constraints resolve against your lockfile before committing.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core