Skip to content
Open in

AI Features ​

The editor ships two AI-powered tools, both on by default: a text assistant that rewrites existing copy, and metadata generation for the page's meta title, description, and keywords. A third option, aiLabeledElements, adds no AI of its own but tags elements with content hints for your own generation pipeline.

AI requires account-level access

All AI text tools additionally require AI to be enabled on your Topol account (this is returned by the authorization call). disableAiAssistant: false alone does not enable AI if your plan does not include it; the AI icon renders greyed out with an "Only PRO version" tooltip.

The AI text assistant ​

The AI text assistant rewrites existing text, with five actions: Improve, Rephrase, Check grammar, Make longer, and Make shorter. It sits behind the AI icon on the block toolbar that appears when hovering a text block.

The assistant is enabled by default and switched off with the disableAiAssistant option (boolean, default false):

typescript
{
  disableAiAssistant: true, // hides all AI text controls
}

With the assistant disabled, all AI text controls are hidden and text is edited manually only.

AI metadata generation ​

When AI is enabled, a magic-pen button appears in the Settings panel's metadata section. It generates a meta title, description, and keywords from the page's text content, one field at a time. It is gated by the same disableAiAssistant option and account-level AI flag as the text assistant.

Generation runs against Topol's service by default. To route it through your own model instead, set the api.GENERATE_META endpoint; the editor then POSTs there instead:

json
{
  "template": "the page's text content",
  "apiKey": "your Public API key",
  "hostname": "origin",
  "userId": "the authorize.entityId",
  "type": "title"
}

type is "title", "description", or "keywords". Answer with { "data": "generated text" }. The editor gives the request 25 seconds; a timeout or error surfaces as a notification and leaves the field unchanged.

Labeling elements for your own AI pipeline ​

The aiLabeledElements option (boolean, default false) adds a free-text AI content field to every section and block's settings:

typescript
{
  aiLabeledElements: true,
}

The value is stored on the element as aiGenerateContent in the saved template JSON, so your own pipeline can use it for downstream AI generation. The editor itself does nothing with the field.

AI translation of the page ​

Without multilingual pages, the Top Bar shows a Translate button whenever AI is available. Pick a target language and the page is translated in place: texts, labels, image alt/title and the page metadata are replaced by their translation; links and image URLs stay as they are. The language set in the page settings leads the list and is preselected, any other one can be chosen. Synced structures are left out, since their content belongs to the host. The whole translation is one undo step, and the page language in the settings is set to the chosen one. The host can trigger it with translateTemplate(code); hide the button with hideTopbarControls: ["translate"].

A single text block ​

The AI menu of a text block (the sparkle icon in its actions) has a Translate item next to Improve, Rephrase, Make longer and Make shorter. Without languages it asks for the target language, with the page language listed first; on a multilingual page it translates the block into the language being edited right away, so the item reads "Translate to Czech".

AI translation of page languages ​

For a multilingual page, the language dropdown in the Top Bar offers a translate button next to every language and a Translate all button. Texts, labels, image alt/title and the page metadata are translated from the primary language (or from any other language chosen as the source); links and image URLs stay as they are. The same is available to the host through translateLanguage(code, sourceCode?) and translateAllLanguages().