client  by google-gemini-php

PHP API client for interacting with the Gemini AI API

created 1 year ago
302 stars

Top 89.3% on sourcepulse

GitHubView on GitHub
Project Summary

This PHP client library provides a community-maintained interface for interacting with the Google Gemini AI API. It enables PHP developers to integrate advanced AI capabilities, including text generation, image understanding, and text embeddings, into their applications.

How It Works

The client leverages PSR-18 for HTTP client compatibility, allowing flexibility in choosing underlying HTTP libraries like Guzzle. It abstracts the complexities of API requests, offering a fluent interface for model selection, parameter configuration, and handling responses, including streaming. The library supports both text-only and multimodal inputs (text and images).

Quick Start & Requirements

  • Install via Composer: composer require google-gemini-php/client
  • Requires PHP 8.1+.
  • A Google AI Studio API key is necessary.
  • For beta features: composer require google-gemini-php/client:1.0.4-beta
  • Official documentation: https://github.com/google-gemini-php/client

Highlighted Details

  • Supports text and image inputs for multimodal models.
  • Enables multi-turn conversational chat history management.
  • Provides streaming capabilities for faster response handling.
  • Includes methods for token counting and text embedding generation.
  • Offers comprehensive testing utilities with fake client implementations and assertion methods.

Maintenance & Community

  • Community-maintained by Fatih AYDIN.
  • Active development indicated by the presence of beta features.

Licensing & Compatibility

  • The specific license is not explicitly stated in the README. Compatibility for commercial use or closed-source linking would require license verification.

Limitations & Caveats

The README notes that the gemini-pro-vision model is not yet optimized for multi-turn conversations. Users should verify the license for commercial use implications.

Health Check
Last commit

3 weeks ago

Responsiveness

1 day

Pull Requests (30d)
4
Issues (30d)
4
Star History
70 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.