Skip to content

Configure AI Actions

AI Actions are available in Ibexa DXP regardless of its edition. To use this feature you must first configure the built-in service connectors or build your own ones.

Next steps

Once the framework is configured, before you can start using AI Actions, you can configure access to Ibexa-made service connectors by following the instructions below, or create your own.

Only then you can restart you application and start working with the AI Actions feature.

Configure access to OpenAI (optional)

To use the built-in connector with the OpenAI service, you need to create an OpenAI account, get an API key, and make sure that you set up a billing method.

Then, in the root folder of your project, modify the .env file: find the OPENAI_API_KEY variable and replace a placeholder value with the API key that you got from the AI service.

1
2
3
###> ibexa/connector-openai ###
OPENAI_API_KEY=<your_api_key>
###< ibexa/connector-openai ###

Sample OpenAI action configurations

The AI actions come with sample AI action configurations to quickly get you started on using the feature.

Based on these examples, which reflect the most common use cases, you can learn to configure your own AI actions with greater ease.

Configure access to Ibexa Connect

First, get the credentials by contacting Ibexa Support.

Create team

In Ibexa Connect, set up the account, and create a team. Navigate to the team details page and note down the numerical value of the Team id variable.

Creating a team matters, because scenarios that process data coming from your AI action are associated with a team. This way, if your organization has more than one Ibexa DXP project, each project can be linked to a different team and so can be scenarios used in those projects.

If specific users from the team are supposed to modify scenario settings, you must assign the right roles to them.

Create token

Navigate to your Ibexa Connect user's profile, and on the API ACCESS tab, create a new token. Select the following scopes to set permissions needed to enable the integration of platforms:

  • custom-property-structures:read
  • custom-property-structures:write
  • hooks:read
  • hooks:write
  • scenarios:read
  • scenarios:write
  • team-variables:read
  • team-variables:write
  • teams:write
  • templates:read
  • templates:write
  • udts:read
  • udts:write

Creating an API token

Copy the token code that appears on the tokens list, next to the label.

Set up credentials

In the root folder of your project, modify the .env file. Replace a placeholder value of the IBEXA_CONNECT_TOKEN variable with the token that you got from Ibexa Connect and provide a value of the IBEXA_CONNECT_TEAM_ID variable.

1
2
3
4
5
6
7
8
9
###> ibexa/connect ###
IBEXA_CONNECT_HOST=https://connect.ibexa.co
IBEXA_CONNECT_API_PATH=/api/v2/
# Token can be created in the user's profile in Ibexa Connect, under the 'API ACCESS' section.
IBEXA_CONNECT_TOKEN=<your_api_token>
# Use the URL below to read more on Ibexa Connect teams.
# https://doc.ibexa.co/projects/connect/en/latest/access_management/teams/
IBEXA_CONNECT_TEAM_ID=2
###< ibexa/connect ###

Initiate integration

Initiate the models provided by the handler by issuing the following command:

1
php bin/console ibexa:connect:init-connect-ai <team_id> <language> <action handler identifiers>

For example:

1
php bin/console ibexa:connect:init-connect-ai 2 en connect-image-to-text connect-text-to-text

Support for multiple Ibexa Connect languages

The language attribute determines the language in which template details such as module names will be displayed in Ibexa Connect's UI.

Then, create the Ibexa AI handler custom property in Ibexa Connect to store the list of available action handlers for this integration. You can do it by running the following command:

1
php bin/console ibexa:connect:init-custom-property-structures <organization-id> <action handler identifiers>

For example:

1
php bin/console ibexa:connect:init-custom-property-structures 4 connect-image-to-text connect-text-to-text

The Ibexa AI handler property attaches to a scenario to store information about the action handler associated with it. When creating a new Ibexa Connect-based AI action, the back office of Ibexa DXP shows only the existing scenarios that work with selected action handler.

Customize templates

Return to the Ibexa Connect dashboard and modify the Template for connect...handler templates by defining the logic needed to process the data.

Once the templates are ready, you can build scenarios from them, either directly in Ibexa Connect or in Ibexa DXP's user interface.