This package integrates the Cobot for NEOS CMS. It offers text and image generation with the OpenAI API and the Flux API.
To install the package, you can use composer. Run the following command in your terminal:
composer require ujamii/neos-cobot
After the installation, you need to run the following command to update your database schema:
./flow doctrine:update
You need to add the API key for the Cobot API to your Settings.yaml
.
You get the API key from your Cobot account settings.
# Configuration/Settings.yaml
Ujamii:
Cobot:
services:
# The API key for the Cobot API
# You can get it from your Cobot account settings
apiKey: <your-api-key>
To enable Cobot Text Generation functionality within your node, add the following configuration to your YAML file. This will display the Cobot inline editing options directly in the RichTextToolbar, allowing for AI-powered content generation within text fields.
Neos.NodeTypes:Text:
properties:
text:
ui:
inline:
formatting:
cobot: true
The Cobot Image Generation feature is enabled by default, displaying the ImageGeneration button in all image editors. If you prefer to disable this feature, you can add the following configuration to your YAML file and set enabled to false.
Ujamii:
Cobot:
ImageEditorExtension:
enabled: true
If you create alt texts in the backend, these are saved in an extra entity. To use these alt texts and bring them to the frontend, you must implement an eel helper for this. Here is an example of how you can do this:
<Neos.Neos:ImageTag asset={asset} attributes.alt={ImageExtension.getAltText(asset)} />
The method ImageExtension.getAltText
is an eel helper that accepts an ImageInterface
and returns the alt text.
Disable the alt text generation
If you not want to use the alt text generation, you can disable it in the settings:
Neos:
Neos:
modules:
management:
submodules:
altTextModule:
enabled: false