rpurinton / gemini-php
A PHP client for the Gemini API.
Installs: 2 217
Dependents: 0
Suggesters: 0
Security: 0
Stars: 19
Watchers: 1
Forks: 8
Open Issues: 3
Requires
- php: ^8.0
- google/auth: ^1.33
- mehrab-wj/tiktoken-php: ^1.0
Requires (Dev)
- phpunit/phpunit: ^10.5
README
Gemini PHP is a PHP library for interacting with the Gemini AI platform. It provides a client for making requests to the Gemini API and a response class for handling the API responses.
Prerequisites
PHP 8.2+ Composer
- Create a Google Cloud Project if you don't already have one.
- Add the Vertex AI API to your project.
- Create a Service Account in your project with Basic permissions.
- Add an API Key and download the credentials JSON.
- Save your credentials somewhere like /home/you/.google/myproject.json
Installation
To install Gemini PHP, you can use Composer. Run the following command:
composer require rpurinton/gemini-php
Usage
Please see example.php for a basic command-line example.
Table of Contents
For more detailed usage instructions, please refer to the Gemini PHP documentation.
License
This project is licensed under the MIT License. See the LICENSE file for details.