Proveedor API Gemini AI

De MoodleDocs

Nota: Urgente de Traducir. ¡ Anímese a traducir esta muy importante página !.     ( y otras páginas muy importantes que urge traducir)


¡Nueva característica
en Moodle 5.2 !



The Gemini API provider allows you to use Google's Gemini family of models to power Moodle's AI capabilities, such as generating text and images and summarising content.

Requisitos

You need an active Google account, which has access to create an API key in a Google Cloud project (see the Generate a Gemini API key section below for more details).

Configuración de la instancia de proveedor de IA Gemini

To create a provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click 'Create a new provider instance'.
  3. Select Gemini API provider as AI provider plugin, enter a name for this instance, enter your Gemini API key (see below for instructions on how to get a key).
  4. Enable and configure settings for each action.
    1. Enter the API endpoint for the appropriate model.
    2. Enter system instructions.
  5. (Optional) Configure rate limit settings to control the number of requests sent to the Gemini API across the entire site and per user.
  6. Click 'Create instance'.
Creating a Gemini AI API provider instance, showing the name and API key credential fields.

Generar una clave API Gemini

You can create a Google API key from Google AI Studio.

  1. Go to Google AI Studio.
  2. Import an existing Google Cloud project or create a new one.
  • Importing an existing project allows you to use a project that may already have billing enabled for paid tier access.
  • Creating a new project will default to the free tier of the Gemini API.
  1. Once the project is imported, create an API key.
  2. Copy the generated API key and paste it into the Gemini provider settings in Moodle.

To configure the Gemini AI provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click the settings link for Gemini.
  3. Enable/disable actions as required.

For each action, you can customise the model's behaviour via the settings link.

Generate text action settings for the Gemini AI API provider, showing the model endpoint and system instruction fields.

To enable the Gemini AI provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click the toggle to enable the instance.

Consideraciones importantes

Review the Gemini API pricing and Terms of Service to determine which tier is appropriate for your institution's use case. For most educational institutions, the paid tier is recommended due to advanced data privacy protections.

Free tier Paid tier
Cost Free (subject to limits) Pay-as-you-go
Recommended use Testing, small projects, and getting started with the Gemini API Production applications requiring advanced features or privacy protections
Data for Training Google may use your content to improve its products. Google does not use your content for any training purposes.
Model Access Access to standard models. Access to all models, including premium ones.
  • Age Requirements: The Gemini API Terms of Service require users to be 18 years of age or older and this provider does not have the ability to enforce this requirement. Administrators are responsible for managing user roles and permissions to control access and ensure compliance.
  • Data Privacy: As noted above, the free tier of the Gemini API allows content sent from your Moodle instance to be used by Google to improve its services. For advanced data privacy protections, use a paid tier API key.