# AI Actions Twig functions

AI Actions functions allows you to pass information about AI Actions to the Twig templates.

### `ibexa_ai_config()`

The `ibexa_ai_config` function loads the configuration of an Action Type with given identifier.

```
    {% set ai_config = ibexa_ai_config('refine_text') %}
    {% set ai_config2 = ibexa_ai_config('refine_text', { 'some': 'optional data' }) %}

    <div class="hidden" data-ai-config-name="refine_text" data-ai-config="{{ ai_config|json_encode }}"></div>
```

You can use the [ResolveActionConfigurationWidgetConfigEvent](https://doc.ibexa.co/en/latest/api/event_reference/ai_action_events/#others) event to modify the configuration after it's been loaded. The optional data provided in the function call is available in the event object.
