# Generate AI content

## Overview

You can use a built-in AI toolset to get AI-generated text in content blocks.\
The AI toolset enables you to:

* Compose new text (ASP.NET, Next.js and MVC)
* Summarize text (ASP.NET, Next.js and MVC)
* Improve writing (ASP.NET, Next.js and MVC)
* Personalize text (ASP.NET and Next.js only)

All text generated by AI is marked as such. Depending on the rules and regulations related to AI you have to follow, you might need that distinction between AI generated text and a text written by a human author.

> info  **NOTE**: The generated text depends on the prompts. Providing similar or identical prompts might result or similar or identical text generation for multiple users.

## Compose text

To compose text with AI:

1. Click on the *AI* button and from the drop-down menu select *Compose new text*.
2. In the key points text area, list key points, one per line, that will be used to generate the prompt to the *AI* service.
3. In the *Audience* text field, describe the audience to provide the AI service with context to generate better text.
4. In the *Tone* field describe the tone of the text. For instance, enter `formal` or `friendly`.
5. In the *Text length* number box, provide the maximum number of words that can be generated for the text.
6. Click *Compose*.

The generated text is displayed and you have the option to:

* *Insert* – add it to the text editor
* *Copy* – copy it to clipboard
* *Compose again* – generate a new text if the previous result is not satisfactory. Depending on your AI service subscription plan if you generate too many texts or too quickly you might receive an error message.

## Summarize text

To summarize text with AI:

1. Select the text you want to summerize. If you don't select text, the selection menu is not available and the prompt works with the entire text in the content block.
2. Either:
   * Click on the *Use AI* button from the selection menu that appears.
   * Click on the *Use AI* button from the text editor ribbon tab.
3. Click *Summeriz* e text.
4. Wait for the text to be generated.
5. Click *Replace* to keep the proposed text or *Discard* to cancel the changes.
6. Click *Save* to save your changes.

Once the summary is generated, you can:

* Compare it with the original
* Insert it in the text editor
* Copy it to clipboard
* Generate a new summary if you are not satisfied with the results. Depending on your AI service subscription plan, if you generate too many texts or too quickly you might receive an error message.

## Improve writing

To improve your writing with AI:

1. Select the text you want to improve. If you don't select text, the selection menu is not available and the prompt works with the entire text in the content block.
2. Either:
   * Click on the *Use AI* button from the selection menu that appears.
   * Click on the *Use AI* button from the text editor ribbon tab.
3. Click *Improve writing*.
4. Wait for the text to be generated.
5. Click *Replace* to keep the proposed text or *Discard* to cancel the changes.
6. Click *Save* to save your changes.

Once the improved text is generated, you have the option to:

* Compare it with the original
* Replace the original text in the text editor
* Copy it to clipboard
* Generate a new improved text if you are not satisfied with the results. Depending on your AI service subscription plan if you generate too many texts or too quickly you might receive an error message.

## Personalize text

To personalize text with AI:

1. Click the AI button and select the *Personalize text* option.
2. In the *Audience* text field, describe the audience to provide the AI service with context to generate better text.
3. In the *Tone* field describe the tone of the text. For instance, enter `formal` or `friendly`.
4. In the *Text length* number box, provide the maximum number of words that can be generate for the text.
5. Click *Personalize*.

The personalized text is displayed and you can:

* Compare it with the original
* Replace the original text in the text editor
* Copy it to clipboard
* Generate a new personalized text if you are not satisfied with the results. Depending on your AI service subscription plan if you generate too many texts or too quickly you might receive an error message.

## Make text shorter or longer

To use AI to make a text shorter or longer:

1. Select the text you want to extend or shorten. If you don't select text, the selection menu is not available and the prompt works with the entire text in the content block.
2. Either:
   * Click on the *Use AI* button from the selection menu that appears.
   * Click on the *Use AI* button from the text editor ribbon tab.
3. Select one of the options: *Make shorter* or *Make longer*, depending on your needs.
4. Wait for the text to be generated.
5. Click *Replace* to keep the proposed text or *Discard* to cancel the changes.
6. Click *Save* to save your changes.

## Custom actions

With Sitefinity CMS, you can create custom prompts in advanced settings without any code. For example, let's create a custom prompt that removes all Oxford commas from a text.

1. Navigate to *Administration » Settings » Advanced settings » AIservices*.
2. Expand your service client.
3. Expand Actions to modify the actions available in the rich-text editor.
4. Click *Create new*.
5. Provide a *Name* for the action. This is the developer name. For instance, `Make compliant`.
6. Provide a *FriendlyTitle*. This is the name of the action visible in the UI. For instance, `Remove Oxford commas`.
7. Provide the name of the icon to be used for the action.
8. In the *Prompt* field, add the prompt to be sent to the AI service. For instance, `Remove Oxford commas from this text: """{Content}""". Keep all text formatting and length identical except for changing the commas`*.*\
   """{Content}""" stands for the text selected in the content editor, but we also need to add the *Content* parameter to the action.
9. *Save changes*.
10. Expand the action you just created.
11. Click *Parameters*.
12. Click *Create new*.
13. In the *Name* field, add a name for the parameter, in this case, `Content`.
14. Change the *FieldType* from the dropdown menu to *TextArea*.
15. Save changes.

This action is now available in the *AI* menu in the content editor or from the selection menu when text is selected.
