laravel  by google-gemini-php

PHP API client for interacting with the Gemini AI API in Laravel apps

created 1 year ago
466 stars

Top 66.0% on sourcepulse

GitHubView on GitHub
Project Summary

This package provides a community-maintained PHP API client for interacting with the Google Gemini AI API, specifically tailored for Laravel applications. It enables developers to integrate Gemini's text and image generation, chat functionalities, and embedding capabilities into their PHP projects.

How It Works

The client leverages Laravel's service container and facades for easy integration. It abstracts the complexities of API calls, allowing developers to interact with Gemini models like gemini-pro and gemini-pro-vision through a fluent interface. Key features include support for text-only and text-and-image inputs, multi-turn conversational chat, streaming responses, token counting, and customizable generation configurations and safety settings.

Quick Start & Requirements

  • Install via Composer: composer require google-gemini-php/laravel
  • Run Artisan command: php artisan gemini:install
  • Requires PHP 8.1+ and Laravel 9, 10, or 11.
  • API key required from Google AI Studio.
  • Official documentation: google-gemini-php/client

Highlighted Details

  • Supports text and image inputs using gemini-pro-vision.
  • Enables multi-turn conversations with chat history management.
  • Offers streaming responses for interactive applications.
  • Includes an embedding resource for text vectorization.
  • Provides a testing utility with fake client responses and assertion methods.

Maintenance & Community

  • Maintained by Fatih AYDIN.
  • Community-driven development.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The gemini-pro-vision model is noted as not yet optimized for multi-turn conversations.

Health Check
Last commit

2 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
3
Star History
72 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.