Skip to main content

Gemini Provider

Google Gemini AI models integration addon for AI Core.

Features

  • Google Gemini Integration - Full integration with Google's Gemini AI models
  • Model Selection - Choose from available Gemini models (Pro, Ultra, etc.)
  • API Configuration - Easy setup with Google Cloud credentials
  • Multi-Modal Support - Support for text, image, and document inputs
  • Streaming Responses - Real-time streaming for long-form content

Requirements

RequirementDetails
DependenciesAICore
PHP Version8.2+
Google CloudValid Google Cloud account with Gemini API access

Installation

  1. Ensure AI Core module is installed and enabled
  2. Enable the Gemini Provider module in Settings > Modules
  3. Configure your Google Cloud API credentials

Configuration

Navigate to Settings > AI Core > Providers > Gemini to configure:

  • API Key - Your Google Cloud API key with Gemini access
  • Default Model - Select default Gemini model
  • Safety Settings - Configure content safety thresholds
  • Region - Select preferred Google Cloud region

Usage

Using Gemini as Provider

use Modules\AICore\Services\AIService;

$aiService = app(AIService::class);

$response = $aiService->complete([
'provider' => 'gemini',
'model' => 'gemini-3-flash',
'prompt' => 'Analyze this business report...',
]);

Multi-Modal Request

$response = $aiService->complete([
'provider' => 'gemini',
'model' => 'gemini-3-pro',
'prompt' => 'Describe this image',
'images' => [$imageBase64],
]);

Supported Models

Gemini 3 Series (Latest)

ModelContextDescription
gemini-3-pro1M tokensMost intelligent model with frontier intelligence
gemini-3-flash1M tokensDefault model with fast performance and thinking
gemini-3-deep-think1M tokensAdvanced reasoning for complex problems

Gemini 2.5 Series (Stable)

ModelContextDescription
gemini-2.5-pro1M tokensSuperior reasoning with thinking mode
gemini-2.5-flash1M tokensPrice-performance optimized
gemini-2.5-flash-lite1M tokensMost cost-efficient option

Gemini 2.0 Series

ModelContextDescription
gemini-2.0-flash1M tokensFast multimodal model

Notes

  • Requires valid Google Cloud billing account
  • Usage is tracked through AI Core's usage monitoring
  • Supports all Gemini API features including function calling
  • Automatic retry with exponential backoff on rate limits