From 123454cbb4c927b4d4152d8abcd4ea9af5472404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85browski?= <64841871+dabrt@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:42:10 +0100 Subject: [PATCH 1/5] IBX-10998: Document Gemini connector --- docs/ai_actions/ai_actions_guide.md | 2 +- docs/ai_actions/configure_ai_actions.md | 108 ++++++++++++++++++++++++ docs/ai_actions/extend_ai_actions.md | 61 +++++++++++++ 3 files changed, 170 insertions(+), 1 deletion(-) diff --git a/docs/ai_actions/ai_actions_guide.md b/docs/ai_actions/ai_actions_guide.md index 9c4fa86ba0..3b1ac01406 100644 --- a/docs/ai_actions/ai_actions_guide.md +++ b/docs/ai_actions/ai_actions_guide.md @@ -12,7 +12,7 @@ Wherever you look, artificial intelligence becomes more and more important by en AI Actions is an extensible solution for integrating features provided by AI services into your workflows, all managed through a user-friendly interface. Out-of-the-box, AI Actions solution includes two essential components: a framework package and an OpenAI connector package. -The Anthropic connector is also available - as an [LTS update](editions.md#lts-updates). +The Anthropic and Gemini connectors are also available - as [LTS updates](editions.md#lts-updates). AI Actions can integrate with [[[= product_name_connect =]]]([[= connect_doc =]]/general/ibexa_connect/), to give you an opportunity to build complex data transformation workflows without having to rely on custom code. From the developer's perspective, the integration removes the burden of maintaining third-party AI handlers, and accelerates the deployment of AI-based solutions. diff --git a/docs/ai_actions/configure_ai_actions.md b/docs/ai_actions/configure_ai_actions.md index 7c64f9e344..0be4277e2b 100644 --- a/docs/ai_actions/configure_ai_actions.md +++ b/docs/ai_actions/configure_ai_actions.md @@ -77,6 +77,114 @@ ibexa_connector_anthropic: ``` You can now use the Anthropic connector in your project. +## Install Google Gemini connector [[% include 'snippets/lts-update_badge.md' %]] + +Run the following command to install the package: + +``` bash +composer require ibexa/connector-gemini +``` + +This command adds the feature code, including basic handlers that let you refine text or generate alternative text for images. + +### Get API key + +To use the connector with the Gemini services, you need to create an account, set up billing, enable Gemini API and get an API key. + +#### Create the Google Cloud project + +1. Sign in to the [Google Cloud Console](https://console.cloud.google.com/). +1. In the top bar, click **Default Gemini Project** to open a project picker. +1. Click **New project** and provide project details: + 1. Add project name, for example, "My project". + 1. Modify the automatically generated **Project ID** if necessary. + 1. Select location: choose your organization. +1. Click **Create**. + +#### Configure billing + +1. Navigate to the Google Cloud Console's **Billing** page. +1. If you do not have one, click **Add billing account** and add a payment method. +1. In **Your projects** tab, locate your project, and in it's line, from the **Actions** menu, select **Change billing**. +1. Select your active billing account, and click **Set account**. + +#### Enable the Gemini API + +1. Navigate to the Google Cloud Console's **APIs & Services** page. +1. From the left-hand menu, select **Library** and search for the Generative Language API. +1. In the API's details page, click **Enable**. + +#### Generate the API key + +1. Go to [Google AI Studio](https://aistudio.google.com/app/api-keys)'s **API keys** page, and click **Create API key**. +1. Provide a name for the API key, select "My project" from a list of projects and click **Create key**. +1. Back inn the **API keys** list, in your project's line, copy the API key. + +### Set API key in configuration + +Then, in the root folder of your project, modify the `.env` file: add an `GEMINI_API_KEY` variable and populate its value with the API key that you got from the AI service. + +```bash +###> ibexa/connector-gemini ### +GEMINI_API_KEY= +###< ibexa/connector-gemini ### +``` + +!!! note "Different API keys for different SiteAccesses" + + If there are multiple SiteAccesses in your installation, you can set different API keys for each SiteAccess. + To do it, set the keys under the `ibexa.system.` [configuration key](configuration.md#configuration-files), like so: + + ```yaml + ibexa: + system: + default: + connector_gemini: + gemini: + api_key: '%env(GEMINI_API_KEY)%' + base_url: 'https://generativelanguage.googleapis.com/v1beta/' + ``` + +### Configure default models + +By default, when reaching out for responses, the Gemini connector uses the Gemini Pro [model](https://ai.google.dev/gemini-api/docs/models) for text refinement and Gemini Flash model for alternative text generation. +Users can override this setting at runtime when they [edit or create an AI action]([[= user_doc =]]/ai_actions/work_with_ai_actions/#edit-existing-ai-actions). +You can also change the default values globally. +To do it, in `config/packages` folder, create a YAML file similar to this example: + +```yaml + ibexa_connector_gemini: + text_to_text: + models: + gemini-pro-latest: + label: 'Gemini Pro Latest' + max_tokens: 4096 + gemini-flash-latest: + label: 'Gemini Flash Latest' + max_tokens: 4096 + default_model: gemini-pro-latest + default_max_tokens: 4096 # must be <= the model’s max_tokens + default_temperature: 0.8 + image_to_text: + models: + gemini-flash-latest: + label: 'Gemini Flash Latest' + max_tokens: 4096 + default_model: gemini-flash-latest + default_max_tokens: 4096 + default_temperature: 1.0 +``` + +When setting up models, make sure that you follow these rules: + +- `default_model` must reference a configured model +- `default_max_tokens` must not exceed the model’s limit +- If you use the same model for different action types, settings must be consistent + +You can now use the Gemini connector in your project. + +For more information, see [Extend AI actions](extend_ai_actions.md#extend-gemini-connector). + ## Configure access to [[= product_name_connect =]] First, get the credentials by contacting [Ibexa Support](https://support.ibexa.co). diff --git a/docs/ai_actions/extend_ai_actions.md b/docs/ai_actions/extend_ai_actions.md index 5674155151..75404b80b8 100644 --- a/docs/ai_actions/extend_ai_actions.md +++ b/docs/ai_actions/extend_ai_actions.md @@ -374,3 +374,64 @@ See [configuring assets from main project files](importing_assets_from_bundle.md Your custom Action Type is now fully integrated into the back office UI and can be used by the Editors. ![Transcribe Audio Action Type integrated into the back office](img/transcribe_audio.png "Transcribe Audio Action Type integrated into the back office") + +## Extend Gemini connector [[% include 'snippets/lts-update_badge.md' %]] + +The Gemini connector provides several extension points that allow you to customize available models, behavior, validation, and response handling, while remaining compatible with the AI Actions framework. + +The connector builds Gemini requests in an options provider and formats responses through a response formatter. +Both components can be replaced or extended to customize how requests are constructed and how responses are normalized. + +### Add or customize models + +You can register additional Gemini models or customize existing ones by extending the connector’s model [configuration](configure_ai_actions.md#configure-default-models). + +Extend the models map by defining: + +- a human-readable label +- a `max_tokens` limit + +Optionally, you can set the default model that would be used for the action type that you're modifying, the default allowed tokens limit and the default temperature. +Default values must stay within the limits supported by the [Gemini API](https://ai.google.dev/gemini-api/docs/models). + +### Add a custom action handler + +To introduce a new Gemini-based AI action: + +1. Create a handler that extends `Ibexa\Contracts\ConnectorAi\Action\AbstractActionHandler`. +1. Register the handler in `services/ai_action_handlers.yaml`. +1. Provide supporting components as needed: + - a prompt factory + - a form type for configuration + - validators for action options + +This follows the same extension mechanism as other [custom AI actions](#create-custom-action-handler). + +### Add custom response formatting + +To change how Gemini responses are post-processed or normalized: + +1. Implement the `GeminiResponseFormatterInterface` class. +1. Alias your implementation in the service container to override the default formatter. + +### Add custom validation + +Add extra validation rules for Gemini action configuration options by tagging custom validators: + +- For `text-to-text` actions: + + ``` yaml + ibexa.connector_ai.action_configuration.options.validator.gemini_text_to_text + ``` + +- For `image-to-text` actions: + + ``` yaml + ibexa.connector_ai.action_configuration.options.validator.gemini_image_to_text + ``` + +### Replace the Gemini client impplementation + +To get full control over the low-level API communication without modifying the connector itself, you can swap the Gemini client implementation enetirely with your own: + +- Use dependency injection to bind your own implementation to `Ibexa\ConnectorGemini\Client\GeminiClientInterface`. From 1c74adaa94be1f3f07e857c46de1bde42432c839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85browski?= <64841871+dabrt@users.noreply.github.com> Date: Fri, 23 Jan 2026 13:25:04 +0100 Subject: [PATCH 2/5] Update docs/ai_actions/extend_ai_actions.md Co-authored-by: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> --- docs/ai_actions/extend_ai_actions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ai_actions/extend_ai_actions.md b/docs/ai_actions/extend_ai_actions.md index 75404b80b8..6f5d2ae40b 100644 --- a/docs/ai_actions/extend_ai_actions.md +++ b/docs/ai_actions/extend_ai_actions.md @@ -432,6 +432,6 @@ Add extra validation rules for Gemini action configuration options by tagging cu ### Replace the Gemini client impplementation -To get full control over the low-level API communication without modifying the connector itself, you can swap the Gemini client implementation enetirely with your own: +To get full control over the low-level API communication without modifying the connector itself, you can swap the Gemini client implementation entirely with your own: - Use dependency injection to bind your own implementation to `Ibexa\ConnectorGemini\Client\GeminiClientInterface`. From 1b1d23f3497bb7f6dd4736ef55a2ea18c496d526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85browski?= <64841871+dabrt@users.noreply.github.com> Date: Mon, 26 Jan 2026 15:30:57 +0100 Subject: [PATCH 3/5] Implement reviewer comments --- docs/ai_actions/configure_ai_actions.md | 18 +++++++++--------- docs/ai_actions/extend_ai_actions.md | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/ai_actions/configure_ai_actions.md b/docs/ai_actions/configure_ai_actions.md index 0be4277e2b..424ec2337c 100644 --- a/docs/ai_actions/configure_ai_actions.md +++ b/docs/ai_actions/configure_ai_actions.md @@ -105,7 +105,7 @@ To use the connector with the Gemini services, you need to create an account, se 1. Navigate to the Google Cloud Console's **Billing** page. 1. If you do not have one, click **Add billing account** and add a payment method. -1. In **Your projects** tab, locate your project, and in it's line, from the **Actions** menu, select **Change billing**. +1. In **Your projects** tab, locate your project, and in its line, from the **Actions** menu, select **Change billing**. 1. Select your active billing account, and click **Set account**. #### Enable the Gemini API @@ -113,8 +113,8 @@ To use the connector with the Gemini services, you need to create an account, se 1. Navigate to the Google Cloud Console's **APIs & Services** page. 1. From the left-hand menu, select **Library** and search for the Generative Language API. 1. In the API's details page, click **Enable**. - -#### Generate the API key + +#### Generate the API key 1. Go to [Google AI Studio](https://aistudio.google.com/app/api-keys)'s **API keys** page, and click **Create API key**. 1. Provide a name for the API key, select "My project" from a list of projects and click **Create key**. @@ -138,11 +138,11 @@ GEMINI_API_KEY= ```yaml ibexa: system: - default: - connector_gemini: - gemini: - api_key: '%env(GEMINI_API_KEY)%' - base_url: 'https://generativelanguage.googleapis.com/v1beta/' + default: + connector_gemini: + gemini: + api_key: '%env(GEMINI_API_KEY)%' + base_url: 'https://generativelanguage.googleapis.com/v1beta/' # Google Gemini's API endpoint ``` ### Configure default models @@ -163,7 +163,7 @@ To do it, in `config/packages` folder, create a YAML file similar to this exampl label: 'Gemini Flash Latest' max_tokens: 4096 default_model: gemini-pro-latest - default_max_tokens: 4096 # must be <= the model’s max_tokens + default_max_tokens: 4096 # Must be <= the model’s max_tokens default_temperature: 0.8 image_to_text: models: diff --git a/docs/ai_actions/extend_ai_actions.md b/docs/ai_actions/extend_ai_actions.md index 75404b80b8..eb4be44aba 100644 --- a/docs/ai_actions/extend_ai_actions.md +++ b/docs/ai_actions/extend_ai_actions.md @@ -394,7 +394,7 @@ Extend the models map by defining: Optionally, you can set the default model that would be used for the action type that you're modifying, the default allowed tokens limit and the default temperature. Default values must stay within the limits supported by the [Gemini API](https://ai.google.dev/gemini-api/docs/models). -### Add a custom action handler +### Add a custom Action Handler To introduce a new Gemini-based AI action: @@ -411,7 +411,7 @@ This follows the same extension mechanism as other [custom AI actions](#create-c To change how Gemini responses are post-processed or normalized: -1. Implement the `GeminiResponseFormatterInterface` class. +1. Implement the `GeminiResponseFormatterInterface` interface. 1. Alias your implementation in the service container to override the default formatter. ### Add custom validation @@ -430,7 +430,7 @@ Add extra validation rules for Gemini action configuration options by tagging cu ibexa.connector_ai.action_configuration.options.validator.gemini_image_to_text ``` -### Replace the Gemini client impplementation +### Replace the Gemini client implementation To get full control over the low-level API communication without modifying the connector itself, you can swap the Gemini client implementation enetirely with your own: From c01701721e16cefa4c75664764d1a4a5eeec7491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85browski?= <64841871+dabrt@users.noreply.github.com> Date: Tue, 27 Jan 2026 13:43:57 +0100 Subject: [PATCH 4/5] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marek Nocoń --- docs/ai_actions/configure_ai_actions.md | 2 +- docs/ai_actions/extend_ai_actions.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ai_actions/configure_ai_actions.md b/docs/ai_actions/configure_ai_actions.md index 424ec2337c..80b8e760f1 100644 --- a/docs/ai_actions/configure_ai_actions.md +++ b/docs/ai_actions/configure_ai_actions.md @@ -118,7 +118,7 @@ To use the connector with the Gemini services, you need to create an account, se 1. Go to [Google AI Studio](https://aistudio.google.com/app/api-keys)'s **API keys** page, and click **Create API key**. 1. Provide a name for the API key, select "My project" from a list of projects and click **Create key**. -1. Back inn the **API keys** list, in your project's line, copy the API key. +1. Back in the **API keys** list, in your project's line, copy the API key. ### Set API key in configuration diff --git a/docs/ai_actions/extend_ai_actions.md b/docs/ai_actions/extend_ai_actions.md index 89327358bc..ce5429e9c6 100644 --- a/docs/ai_actions/extend_ai_actions.md +++ b/docs/ai_actions/extend_ai_actions.md @@ -411,7 +411,7 @@ This follows the same extension mechanism as other [custom AI actions](#create-c To change how Gemini responses are post-processed or normalized: -1. Implement the `GeminiResponseFormatterInterface` interface. +1. Implement the `Ibexa\ConnectorGemini\Response\GeminiResponseFormatterInterface` interface. 1. Alias your implementation in the service container to override the default formatter. ### Add custom validation From b3bfe14d5d96f121e7ccf2fc47d65f5267e05e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85browski?= <64841871+dabrt@users.noreply.github.com> Date: Tue, 27 Jan 2026 17:54:40 +0100 Subject: [PATCH 5/5] Add RN entry --- docs/ai_actions/configure_ai_actions.md | 2 +- docs/ai_actions/extend_ai_actions.md | 2 +- docs/ibexa_products/editions.md | 1 + docs/release_notes/ibexa_dxp_v5.0.md | 10 ++++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/ai_actions/configure_ai_actions.md b/docs/ai_actions/configure_ai_actions.md index 80d46f9645..8b924d6864 100644 --- a/docs/ai_actions/configure_ai_actions.md +++ b/docs/ai_actions/configure_ai_actions.md @@ -189,7 +189,7 @@ When setting up models, make sure that you follow these rules: You can now use the Gemini connector in your project. -For more information, see [Extend AI actions](extend_ai_actions.md#extend-gemini-connector). +For more information, see [Extend Gemini connector](extend_ai_actions.md#extend-google-gemini-connector). ## Configure access to [[= product_name_connect =]] diff --git a/docs/ai_actions/extend_ai_actions.md b/docs/ai_actions/extend_ai_actions.md index ce5429e9c6..e6976f7bc8 100644 --- a/docs/ai_actions/extend_ai_actions.md +++ b/docs/ai_actions/extend_ai_actions.md @@ -375,7 +375,7 @@ Your custom Action Type is now fully integrated into the back office UI and can ![Transcribe Audio Action Type integrated into the back office](img/transcribe_audio.png "Transcribe Audio Action Type integrated into the back office") -## Extend Gemini connector [[% include 'snippets/lts-update_badge.md' %]] +## Extend Google Gemini connector [[% include 'snippets/lts-update_badge.md' %]] The Gemini connector provides several extension points that allow you to customize available models, behavior, validation, and response handling, while remaining compatible with the AI Actions framework. diff --git a/docs/ibexa_products/editions.md b/docs/ibexa_products/editions.md index bbc686efa5..be01207d3d 100644 --- a/docs/ibexa_products/editions.md +++ b/docs/ibexa_products/editions.md @@ -67,4 +67,5 @@ The features brought by LTS Updates become standard parts of the next LTS releas | Feature | [[= product_name_headless =]] | [[= product_name_exp =]] | [[= product_name_com =]] | |-----------------|-----------------|-----------------|-----------------| | [Anthropic connector](configure_ai_actions.md#install-anthropic-connector) | ✔ | ✔ | ✔ | +| [Google Gemini connector](configure_ai_actions.md#install-google-gemini-connector) | ✔ | ✔ | ✔ | | [Integrated help](integrated_help.md) | ✔ | ✔ | ✔ | diff --git a/docs/release_notes/ibexa_dxp_v5.0.md b/docs/release_notes/ibexa_dxp_v5.0.md index 074b312180..26db48efd8 100644 --- a/docs/release_notes/ibexa_dxp_v5.0.md +++ b/docs/release_notes/ibexa_dxp_v5.0.md @@ -10,6 +10,16 @@ month_change: false
+[[% set version = 'v5.0.6' %]] + +[[= release_note_entry_begin("Google Gemini connector " + version, '2026-02-03', ['Headless', 'Experience', 'Commerce', 'LTS Update', 'New feature']) =]] + +This release introduces a new AI connector that allows you to integrate [AI Actions](ai_actions.md) with [Google Gemini](https://gemini.google/overview/#what-gemini-is). + +For more information, see how to [install and configure the Google Gemini connector](configure_ai_actions.md#install-google-gemini-connector). + +[[= release_note_entry_end() =]] + [[% set version = 'v5.0.5' %]] [[= release_note_entry_begin("Ibexa DXP " + version, '2026-01-15', ['Headless', 'Experience', 'Commerce']) =]]