Skip to content

Commit

Permalink
Manual review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Dec 18, 2024
1 parent 8010fce commit 82cc5c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 142 deletions.
81 changes: 0 additions & 81 deletions code_samples/ai_actions/config/packages/ibexa_admin_ui.yaml
Original file line number Diff line number Diff line change
@@ -1,87 +1,6 @@
parameters:
# Admin siteaccess group name
admin_group_name: admin_group

ibexa:
siteaccess:
list: [admin]
groups:
# WARNING: Do not remove or rename this group.
# It's used to distinguish common siteaccesses from admin ones.
# In case of multisite with multiple admin panels, remember to add any additional admin siteaccess to this group.
admin_group: [admin]

system:
admin_group:
# System languages. Note that by default, content, content types, and other data are in eng-GB locale,
# so removing eng-GB from this list may lead to errors or content not being shown, unless you change
# all eng-GB data to other locales first.
# For admin this needs to contain all languages you want to translate content to on the given repository.
languages: [eng-GB]
content_tree_module:
contextual_tree_root_location_ids:
- 2 # Home (Content structure)
- 5 # Users
- 43 # Media
- 48 # Setup
- 55 # Forms
- 56 # Site skeletons
- 60 # Components
- 67 # Dashboards
subtree_paths:
content: /1/2/
media: /1/43/
page_builder:
siteaccess_list: [ site ]
assets:
icon_sets:
streamlineicons: /bundles/ibexaicons/img/all-icons.svg
default_icon_set: streamlineicons
content_type:
about:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#about'
article:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#article'
blog:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#blog'
blog_post:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#blog_post'
editor:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#author'
folder:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#folder'
form:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#form'
place:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#place'
product:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#product'
field:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#field'
user:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#user'
user_group:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#user_group'
file:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#file'
gallery:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#gallery'
image:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#image'
video:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#video'
landing_page:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#landing_page'
default-config:
thumbnail: '/bundles/ibexaicons/img/all-icons.svg#file'
user_content_type_identifier: ['user', 'customer', 'member', 'editor']
user_profile:
enabled: true
content_types: ['editor']
field_groups: ['about', 'contact']
default_page: 'dashboard'
content:
default_ttl: 0
admin_ui_forms:
content_edit:
form_templates:
Expand Down
53 changes: 0 additions & 53 deletions code_samples/ai_actions/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,4 @@
const Encore = require('@symfony/webpack-encore');
const path = require('path');
const getIbexaConfig = require('./ibexa.webpack.config.js');
const ibexaConfig = getIbexaConfig(Encore);
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const customConfigs = require('./ibexa.webpack.custom.configs.js');
const {
isReactBlockPathCreated,
} = require('./ibexa.webpack.config.react.blocks.js');

Encore.reset();
Encore.setOutputPath('public/build/')
.setPublicPath('/build')
.enableStimulusBridge('./assets/controllers.json')
.enableSassLoader()
.enableReactPreset()
.enableSingleRuntimeChunk()
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
pattern: /\.(png|svg)$/,
})

// enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
});

// Welcome page stylesheets
Encore.addEntry('welcome-page-css', [
path.resolve(__dirname, './assets/scss/welcome-page.scss'),
]);

// Welcome page javascripts
Encore.addEntry('welcome-page-js', [
path.resolve(__dirname, './assets/js/welcome.page.js'),
]);

ibexaConfigManager.add({
ibexaConfig,
Expand All @@ -44,19 +7,3 @@ ibexaConfigManager.add({
path.resolve(__dirname, './assets/js/addAudioModule.js')
],
});

if (isReactBlockPathCreated) {
// React Blocks javascript
Encore.addEntry('react-blocks-js', './assets/js/react.blocks.js');
}

Encore.addEntry('app', './assets/app.js');

const projectConfig = Encore.getWebpackConfig();

projectConfig.name = 'app';

module.exports = [ibexaConfig, ...customConfigs, projectConfig];

// uncomment this line if you've commented-out the above lines
// module.exports = [ eZConfig, ibexaConfig, ...customConfigs ];
16 changes: 8 additions & 8 deletions docs/ai_actions/extend_ai_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ This action is parameterized with the [RuntimeContext](../api/php_api/php_api_re

| Type of context | Type of options | Usage | Example |
|---|---|---|---|
| Runtime Context | Runtime options | Set additional parameters that are relevant to the specific action that is currently executed | Information about the language of the content that is being processed |
| Runtime Context | Runtime options | Sets additional parameters that are relevant to the specific action that is currently executed | Information about the language of the content that is being processed |
| Action Context | Action Type options | Sets additional parameters for the Action Type | Information about the expected response length |
| Action Context | Action Handler options |Set additional parameters for the Action Handler | Information about the model, temperature, prompt, and max tokens allowed. |
| Action Context | System options | Set additional information, not matching the other option collections | Information about the fallback locale |
| Action Context | Action Handler options | Sets additional parameters for the Action Handler | Information about the model, temperature, prompt, and max tokens allowed |
| Action Context | System options | Sets additional information, not matching the other option collections | Information about the fallback locale |

Both `ActionContext` and `RuntimeContext` are passed to the Action Handler (an object implementing the [ActionHandlerInterface](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-Action-ActionHandlerInterface.html)) to execute the action. The Action Handler is responsible for combining all the options together, sending them to the AI service and returning an [ActionResponse](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionResponseInterface.html).

Check failure on line 31 in docs/ai_actions/extend_ai_actions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/ai_actions/extend_ai_actions.md#L31

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/ai_actions/extend_ai_actions.md", "range": {"start": {"line": 31, "column": 170}}}, "severity": "ERROR"}

Expand Down Expand Up @@ -65,9 +65,9 @@ To manage Action Configurations through the PHP API, you need to use the [Action

You can manage them using the following methods:

- Create them with `ActionConfigurationServiceInterface::createActionConfiguration()`, passing the [ActionConfigurationCreateStruct](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionConfiguration-ActionConfigurationCreateStruct.html).
- Update them with `ActionConfigurationServiceInterface::updateActionConfiguration()`, passing the [ActionConfigurationUpdateStruct](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionConfiguration-ActionConfigurationUpdateStruct.html).
- Delete them with `ActionConfigurationServiceInterface::deleteActionConfiguration()`, passing the [ActionConfigurationInterface](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionConfigurationInterface.html).
- Creating them with `ActionConfigurationServiceInterface::createActionConfiguration()` by passing the [ActionConfigurationCreateStruct](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionConfiguration-ActionConfigurationCreateStruct.html).

Check failure on line 68 in docs/ai_actions/extend_ai_actions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/ai_actions/extend_ai_actions.md#L68

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/ai_actions/extend_ai_actions.md", "range": {"start": {"line": 68, "column": 179}}}, "severity": "ERROR"}
- Updating them with `ActionConfigurationServiceInterface::updateActionConfiguration()` by passing the [ActionConfigurationUpdateStruct](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionConfiguration-ActionConfigurationUpdateStruct.html).

Check failure on line 69 in docs/ai_actions/extend_ai_actions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/ai_actions/extend_ai_actions.md#L69

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/ai_actions/extend_ai_actions.md", "range": {"start": {"line": 69, "column": 179}}}, "severity": "ERROR"}
- Deleting them with `ActionConfigurationServiceInterface::deleteActionConfiguration()` by passing the [ActionConfigurationInterface](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionConfigurationInterface.html).

Check failure on line 70 in docs/ai_actions/extend_ai_actions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/ai_actions/extend_ai_actions.md#L70

[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= product_name_base =]]' instead of 'Ibexa'", "location": {"path": "docs/ai_actions/extend_ai_actions.md", "range": {"start": {"line": 70, "column": 176}}}, "severity": "ERROR"}

See the [AI Actions event reference](ai_action_events.md#action-configurations-management) for a list of events related to these operations.

Expand Down Expand Up @@ -326,7 +326,7 @@ This template embeds the AI component, but only if a dedicated `transcript` fiel

And add it to the SiteAccess configuration for the `admin_group`:
``` yaml
[[= include_file('code_samples/ai_actions/config/packages/ibexa_admin_ui.yaml', 4, 5) =]][[= include_file('code_samples/ai_actions/config/packages/ibexa_admin_ui.yaml', 13, 15) =]][[= include_file('code_samples/ai_actions/config/packages/ibexa_admin_ui.yaml', 84) =]]
[[= include_file('code_samples/ai_actions/config/packages/ibexa_admin_ui.yaml') =]]
```

The configuration of the AI component takes the following parameters:
Expand Down Expand Up @@ -362,7 +362,7 @@ And include it into the back office using Webpack Encore.
See [configuring assets from main project files](importing_assets_from_bundle.md#configuration-from-main-project-files) to learn more about this mechanism.

``` js
[[= include_file('code_samples/ai_actions/webpack.config.js', 39, 47) =]]
[[= include_file('code_samples/ai_actions/webpack.config.js') =]]
```

Your custom Action Type is now fully integrated into the back office UI and can be used by the Editors.
Expand Down

0 comments on commit 82cc5c4

Please sign in to comment.