Download the PHP package gemini-api-php/laravel without Composer
On this page you can find all versions of the php package gemini-api-php/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gemini-api-php/laravel
More information about gemini-api-php/laravel
Files in gemini-api-php/laravel
Informations about the package laravel
Gemini API Client for Laravel
Gemini API Client for Laravel allows you to use the Google's generative AI models, like Gemini Pro and Gemini Pro Vision in your Laravel application.
Supports PHP 8.1 and Laravel v9, v10.
This library is not developed or endorsed by Google.
- Erdem Köse - github.com/erdemkose
Table of Contents
- Installation
- Configuration
- How to use
- Text Generation
- Text Generation using Image File
- Text Generation using Image Data
- Chat Session (Multi-Turn Conversations)
- Chat Session with History
- Text Embeddings
- Tokens counting
- Listing models
- Accessing the underlying Gemini API client
- Credits
Installation
You need an API key to gain access to Google's Gemini API. Visit Google AI Studio to get an API key.
First step is to install the Gemini API Client for Laravel with Composer.
Configuration
There are two ways to configure the client.
Environment variables
You can set the GEMINI_API_KEY
environment variable with the API key you obtained from Google AI studio.
Add the following line into your .env
file.
Configuration file
You can also run the following command to create a configuration file in your applications config folder.
Now you can edit the config/gemini.php
file to configure the Gemini API client.
How to use
Text Generation
Text Generation Using Image File
Text Generation Using Image Data
Chat Session (Multi-Turn Conversations)
Chat Session with History
Text Embeddings
Tokens counting
Listing models
Accessing the underlying Gemini API client
Credits
This project was inspired by the great work of OpenAI PHP for Laravel and OpenAI PHP client.
We gratefully acknowledge the contributions of OpenAI PHP and its team.
All versions of laravel with dependencies
gemini-api-php/client Version ^1.3.1
illuminate/support Version ^9.0 || ^10.0 || ^11.0
psr/container Version ^1.0 || ^2.0
psr/http-client Version ^1.0