hosseinhezami/laravel-gemini
Laravel package for integrating Google Gemini into your app. Send prompts, manage chats and responses, and work with text generation via a clean, developer-friendly API. Ideal for quickly adding AI features to Laravel projects.
Gemini::text(), Gemini::image(), etc.) mirrors Laravel’s Eloquent query builder, reducing cognitive load for developers.predictLongRunning for videos) behind simple methods like generate() or save(), abstracting polling, retries, and error handling. This reduces boilerplate and risk for teams unfamiliar with Gemini’s API.Files API simplifies use cases like document analysis or multimodal prompts, which are critical for advanced AI workflows.composer require and .env configuration, with optional vendor:publish for customization. No database migrations or schema changes are needed for basic use.Gemini::setApiKey()), which is valuable for multi-tenant or per-request key rotation. Falls back gracefully to .env if not set.veo-3.0-fast-generate-001 may change). The package mitigates this with:
config/gemini.php.->model().response->usage()) and integrate with tools like Laravel Horizon for monitoring.->stream()) requires server-side event handling (SSE) and proper buffering. Poor implementation could lead to memory leaks or client disconnections.
stream.chunk_size in config).Gemini::files() could strain server storage or memory.
Gemini::files()->upload() in a job) and validate file sizes early.setApiKey()) needed for multi-tenancy, or will .env suffice?laravel-echo.composer require hosseinhezami/laravel-gemini.php artisan vendor:publish --tag=gemini-config..env.Gemini::text()) into a non-critical feature (e.g., chatbot).Gemini::image(), Gemini::video()) as needed.Gemini facade or service container.Gemini::text() for chatbots, summaries, or structured output.Gemini::image() and Gemini::files() for document analysis.Gemini::video() and Gemini::audio() for media-rich workflows.Gemini::embeddings() for semantic search or recommendations.config/gemini.php simplify updates (e.g., model changes, timeouts)..env) allow per-environment customization.composer update cautiously; test changes in staging first.logging: true in config for debugging API interactions.Gemini::text()->generate() errors).Gemini::setApiKey() for runtime debugging with test keys.How can I help you explore Laravel packages today?