Developer YAML-API

Generate text buttons for any text fields

As a developer, you can use NEOSidekick to add a "Generate with Sidekick" button for any text field and configure it with your individual prompt

A typical example is the meta description. Editors can create a description based on the content of the current page with just one mouse click.

As an application example, I show in the tutorial how we did this for the page meta description.

The NEOSidekick YAML API

'Neos.Seo:SeoMetaTagsMixin':
properties:
metaDescription:
ui:
inspector:
editor: 'NEOSidekick.AiAssistant/Inspector/Editors/MagicTextAreaEditor'
editorOptions:
placeholder: 'Neos.Seo:NodeTypes.SeoMetaTagsMixin:properties.metaDescription.textAreaEditor.placeholder'
module: 'meta_description'
arguments:
title: 'SidekickClientEval:documentTitle'
content: 'SidekickClientEval:documentContent'

 

The feature was implemented with these few lines of code. We replace the TextAreaEditor with the MagicTextAreaEditor for the meta description field and use the NEOSidekick module meta_description and then we add the page title and content. To do this, we have extended the normal ClientEval and also support documentTitle, documentContent and an AssetUri function. It was that simple, and meta descriptions can be created automatically.

Generating an alternative text for images is also often not much fun, and we would like to automate this. There is a separate NEOSidekick module image_alt_text for this.

And would you be able to write a better alternative text in the first version? I find this very helpful.

The NEOSidekick YAML API

With these few lines you can implement your own NodeType with image and alternative text:

'Vendor.Site:Content.Image':
superTypes:
'Neos.Neos:Content': true
ui:
label: Image
properties:
image:
type: Neos\Media\Domain\Model\ImageInterface
ui:
label: 'Image'
reloadIfChanged: true
showInCreationDialog: true
inspector:
group: general
position: 50
alternativeText:
type: string
ui:
label: 'Alternative Text'
reloadIfChanged: false
inspector:
hidden: 'ClientEval:node.properties.image ? false : true'
group: general
position: 100
editor: 'NEOSidekick.AiAssistant/Inspector/Editors/MagicTextFieldEditor'
editorOptions:
module: 'image_alt_text'
arguments:
url: 'SidekickClientEval: AssetUri(node.properties.image)'

 

We create a NodeType with image and alternative text. For the alternative text we use the MagicTextAreaEditor and configure the image_alt_text module, as an argument we send a link to the image that is to be analyzed.

The NEOSidekick YAML API

Do you need an API key?

Since GPT-4 is associated with considerable costs, we cannot publish the interface unprotected on the Internet. You can buy a 14-day trial version via our store or contact us via support@neosidekick.com, then we can create an API key for testing and demos.

What else is in the API?

Available editors:

  • NEOSidekick.AiAssistant/Inspector/Editors/MagicTextAreaEditor
  • NEOSidekick.AiAssistant/Inspector/Editors/MagicTextFieldEditor


Modules for the Inspector property text generation:

  • image_alt_text
    Arguments: url (string, required)
    Generate an alternative text from an image.
  • free_conversation
    Arguments: content (string, required)
    Describe in a separate prompt which content is to be created.
  • meta_description
    Arguments: title (string, required), content (string, required)
    Generate a meta description based on the title and content


Available writing styles:

  • academically_complex
  • concise_descriptions
  • extreme_motivation
  • literary_masterpiece
  • marketing_genius
  • storytelling_genius
  • tech_advocate
  • visionary_marketing

You can feed the free_conversation with your own prompts. You can find very good examples on the Inline text generation page when creating the content element.

Let your creativity run wild! Design and configure your own buttons, we look forward to seeing what use cases you come up with.

Please give us feedback!

Is the naming consistent and clear? Do you understand the use cases? What would you like to develop with it?

Or on Slack #neos-general and mention @rolandschuetz