Skip to main content

Generative rich text editor

This content field extension replaces the built in rich text editor with a customizable editor that features embeddable content items, enhanced markdown support and a ChatGPT powered AI assistant.

The AI assistant helps improve your content production and editing workflow, and lets you generate and edit content using natural language. If you know the search terms for which you want to optimize your content, you can use them with the AI assistant to generate keyword optimized content. You might want to use it to get some inspiration to start a blog post, for example, or to rewrite text in a different style, or shorten text to match a word count, there are many possible uses.

Note that you can use the Generative rich text editor extension without the AI assistant by updating the extension parameters.

Labs preview

The AI assistant feature of the Generative rich text editor extension is classified as an Amplience labs preview for you to evaluate and provide feedback. It's provided as is and is unsupported. Each time you use the generate text button you'll use one Amplience credit. Your organization is provided with a bundle of free credits to make it easy to get started with our AI services.

Using the Generative rich text editor extension
Link copied!

When you create some content that uses the extension, the "AI Assistant" button is shown in toolbar as highlighted in the image below. When clicking the button, the AI Assistant dialog is shown and from here you can enter a natural language prompt which is sent to ChatGPT.

Click the AI Assistant button to display the prompt

In this example we're asking the assistant to write a blog post about hats. We can then use this text as a starting point for our own blog.

Generating keyword optimized content

If the Generative rich text editor is configured to generate keyword optimized content, you will have the option to generate keyword optimized content.

At the AI assistant prompt, request the text to be generated

A blog called "The history of hats" is generated and added to the rich text field in the content form. When you select some text you'll notice some shortcuts at the bottom of the text field. You can choose a shortcut to improve, shorten or expand the selected text.

You can use shortcuts on the selected text to improve, expand, shorten or perform a custom operation

You can also enter your own prompt to rewrite the post in a certain number of characters or a certain style, for example. You can also add your own shortcuts.

If you run out of credits when using the Generative rich text editor or Image alt text generator, you'll still be able to use all the rest of the functionality of the extension and enter text yourself, you just won't be able to use the AI features to generate the text.

Schema examples
Link copied!

To make it easier to use the Generative rich text editor extension in your own schemas we've included some schema examples to help get you started.

Two schema examples are included to help you get started with the extension

There are two schema examples included: one that uses a registered extension and one that includes the extension URL directly in the schema. In most cases you will want to register the extension so that you do not have to specify the installation parameters each time you use it in a schema.

Schema example using a registered extension
Link copied!

In order to use this schema you will need to register the extension using the following details:

  • Category: Content field extension
  • Name: rich-text-extension (if you use a different name you will need to change the name in the example schema)
  • URL: https://rich-text.extensions.content.amplience.net
  • Initial height: 500

Permissions
Link copied!

In the permissions section set the "allowSameOrigin" sandbox permission.

Installation parameters
Link copied!

In the installation parameters you can choose to set the language as "markdown" or "json". The example schema is set up to use markdown so include the following in the installation params section:

{
"language": "markdown"
}

Example schema
Link copied!

The schema example using the registered extension is shown below.

{
"$schema":"http://json-schema.org/draft-07/schema#",
"$id":"https://schema-examples.com/generative-rich-text-editor",
"$comment":"Docs: https://amplience.com/developers/docs/ai-services/generative-rich-text-editor/#schema-examples",
"title":"Generative rich text editor extension example",
"description":"Demonstrates how to use the generative rich text editor extension when it has been registered",
"allOf":[
{
"$ref":"http://bigcontent.io/cms/schema/v1/core#/definitions/content"
}
],
"type":"object",
"properties":{
"text":{
"title":"Some text",
"description":"some text",
"type":"string",
"minLength":0,
"maxLength":32000,
"ui:extension":{
"name":"rich-text-extension"
}
}
},
"propertyOrder":[

]
}

Schema using the extension URL
Link copied!

This schema example shows how to include the extension in the schema using its URL. Note that if you are using your own OpenAPI account you will need to include your OpenAI API key in the tools section:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema-examples.com/generative-rich-text-editor-url",
"$comment": "Docs: https://amplience.com/developers/docs/ai-services/generative-rich-text-editor/#schema-examples",
"title": "Generative rich text editor extension example",
"description": "Demonstrates how to use the generative rich text editor extension without registering it",
"allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"
}
],
"type": "object",
"properties": {
"text": {
"title": "Markdown text",
"description": "Markdown text",
"type": "string",
"minLength": 0,
"maxLength": 32000,
"ui:extension": {
"url": "https://rich-text.extensions.content.amplience.net",
"params": {
"language": "markdown"
}
}
}
},
"propertyOrder": []
}

You can also find more details about configuring the extension on GitHub.

Generating keyword optimized content
Link copied!

To generate keyword optimized content, the Generative rich text editor extension must be configured to use a keyword source. Set the keyword source as a parameter, either when registering the extension or within your content type schema.

{
"language": "markdown",
"keywordSource": "/seo-keywords"
}

To tell the AI Assistant where to get the keywords from, the 'keywordSource' parameter must point to a keyword property defined in the schema. An example keyword property is shown below, and is included in the Dynamic Content schema example:

"properties": {
"seo-keywords": {
"title": "SEO Keywords",
"type": "string",
"ui:extension": {
"name": "seo-assistant",
"params": {
"type": "keywords",
"sources": ["/content"]
}
}
},
using a SEO Assistant keyword property

If you're using the SEO Assistant extension, you can use a keyword property from that as the source for generating keyword optimized content. See the SEO Assistant schema examples.

Once the extension is configured you’ll have the ability to enter your SEO keywords. The AI Assistant will then generate content optimized with your set keywords. In the example below, keywords are entered and will be used for generating optimized content.

Generative rich text editor using keywords

Generating with keywords

The AI Assistant only displays the option to use keywords if you have entered keywords in the keyword source field.

Using your own OpenAI account
Link copied!

You can use your own OpenAI account rather than Amplience credits. You'll need to create an API key and add it to installation parameters for the extension. See Generative rich text extension configuration on the GitHub repo for more details.

note

ChatGPT is not affiliated with Amplience and therefore any impact to ChatGPT services such as updates, busy periods, or outages are outside of Amplience control. By using this feature, you are solely responsible for ensuring that AI generated content complies with internal company policies, applicable laws and OpenAI's Terms.

Troubleshooting
Link copied!

The AI assistant dialog is not opened when you click the icon

  • Check that your OpenAI API Key has been added to the extensions's installation parameters for a registered extension, or in the parameters section of the property of the schema that uses the extension. See the Generative rich text extension configuration for full details.

  • Verify that your OpenAI key has sufficient credit. You may need to open a paid OpenAI account to ensure that you have sufficient credits to continue to make requests.

Turning off the AI assistant
Link copied!

If you want to use the Generative rich text editor extension without the AI assistant features, add the following to the extension's installation parameters:

   "tools":{
"ai":{
"disabled":true
}
}

The rich text editor will be displayed, but the AI assistant button will not be shown.

You can turn the AI assistant features off in the extension installation parameters

Extensions overview

Registering extensions

Schema examples

GitHub repository