You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($value === null || !$this->shouldGenerateAltText($value)) {
82
-
$output->writeln(sprintf('Image %s has the image field empty or the alternative text is already specified. Skipping.', $content->getName()));
83
+
$output->writeln(sprintf('Image %s has the image field empty, the file cannot be accessed, or the alternative text is already specified. Skipping.', $content->getName()));
83
84
continue;
84
85
}
85
86
@@ -124,12 +125,10 @@ private function getSuggestedAltText(string $imageEncodedInBase64, string $langu
Copy file name to clipboardExpand all lines: docs/ai_actions/extend_ai_actions.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ month_change: false
5
5
6
6
# Extend AI Actions
7
7
8
-
By extending AI Actions, you can make regular content management and editing tasks more appealing and less demanding.
8
+
By extending [AI Actions](ai_actions_guide.md), you can make regular content management and editing tasks more appealing and less demanding.
9
9
You can start by integrating additional AI services to the existing action types or develop custom ones that impact completely new areas of application.
10
10
For example, you can create a handler that connects to a translation model and use it to translate your website on-the-fly, or generate illustrations based on a body of an article.
11
11
@@ -14,7 +14,7 @@ For example, you can create a handler that connects to a translation model and u
14
14
You can execute AI Actions by using the [ActionServiceInterface](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionServiceInterface.html) service, as in the following example:
The `GenerateAltTextAction` is a built-in action that implements the [ActionInterface](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionInterface.html), takes an [Image](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-Action-DataType-Image.html) as an input, and generates the alternative text in the response.
@@ -43,7 +43,7 @@ You can influence the execution of an Action with two events:
43
43
Below you can find the full example of a Symfony Command, together with a matching service definition.
44
44
The command finds the images modified in the last 24 hours, and adds the alternative text to them if it's missing.
@@ -146,10 +146,14 @@ The created Form Type adds the `system_prompt` field to the Form.
146
146
Use the `Ibexa\Bundle\ConnectorAi\Form\FormMapper\ActionConfiguration\ActionHandlerOptionsFormMapper` class together with the `ibexa.connector_ai.action_configuration.form_mapper.options` service tag to make it part of the Action Handler options form.
147
147
Pass the Action Handler identifier (`LLaVATextToText`) as the type when tagging the service.
148
148
149
-
The Action Handler and Action Type options are rendered in the back office using the built-in Twig option formatter.
149
+
The Action Handler and Action Type options are rendered in the back office using the built-in Twig options formatter.
150
+
151
+

152
+
153
+
150
154
You can create your own formatting by creating a class implementing the [OptionsFormatterInterface](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-ActionConfiguration-OptionsFormatterInterface.html) interface and aliasing it to `Ibexa\Contracts\ConnectorAi\ActionConfiguration\OptionsFormatterInterface`.
151
155
152
-
The following service definition switches the options rendering to the other built-in option formatter, displaying the options as JSON.
156
+
The following service definition switches the options rendering to the other built-in options formatter, displaying the options as JSON.
@@ -192,7 +196,7 @@ See the built-in Action Types like Generate Alt Text or Refine Text for an examp
192
196
193
197
### Create custom Data classes
194
198
195
-
The `TranscribeAudio` Action Type requires adding two data classes that exists in its definition:
199
+
The `TranscribeAudio` Action Type requires adding two data classes that exist in its definition:
196
200
197
201
- an `Audio` class, implementing the [DataType interface](../api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorAi-DataType.html), to store the input data for the Action
0 commit comments