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.
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
To install Gemini PHP, you can use Composer. Run the following command:
composer require rpurinton/gemini-php
Please see example.php for a basic command-line example.
For more detailed usage instructions, please refer to the Gemini PHP documentation.
This project is licensed under the MIT License. See the LICENSE file for details.