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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel

Gemini API Client for Laravel - Examples

Total Downloads Latest Version License

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.

Table of Contents

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

PHP Build Version
Package Version
Requires php Version ^8.1
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gemini-api-php/laravel contains the following files

Loading the files please wait ....