Edit online

Functionality and Features

The Oxygen AI Positron Assistant add-on uses the advanced Oxygen AI Positron service to support technical documentation writers throughout their content creation process.

Accessing AI-Powered Actions

Once you log in to the server, a variety of AI actions are available in:
  • The Actions drop-down menu at the top of the AI Positron Assistant side view.
  • The main chat panel where you can start a new conversation or discuss with the AI and refine the results of an AI action.
  • The AI Positron Assistant submenu that is available in the contextual menu when right-clicking in the main editor.
  • The AI main menu at the top of the application.

In addition, some of the most useful AI actions for creating and improving the structure and content of the current document are also available in the AI Positron Assistant Widget.

The progress and results of triggering an action are displayed in the main chat pane.

AI Positron Assistant View

The add-on provides access to the AI Positron Assistant side-view. If the view is not displayed, it can be opened by selecting it from Window > Show View.

Figure 1. AI Positron Assistant View

To clear the information in the chat pane and start a new chat, click the New Chat button in the far-left side of the view's header.

The chat History drop-down toolbar button makes it easy to go back to previous conversations and continue them.

The Actions drop-down menu at the top of the AI Positron Assistant view contains the available AI-powered actions that can be used to generate and refine content. The AI actions are also available as buttons in the main chat pane when you first log in or when the recent chat is cleared. Simply select the action to trigger it. You can hover the mouse cursor over an action to see a description of what the action does. A set of 5 recently used actions are also available in the Actions drop-down menu. The Record button located in the Actions drop down menu allows you to create custom actions or prompts by recording changes.

A drop-down button on the right side of the view's header allows you to select the AI model to be used for chat purposes and for the processing of actions.

There is also a user drop-down menu on the far-right side of the view's header that contains the following:
  • My account - Opens a webpage where you can see your current subscription package and credit status.
  • Disconnect - Disconnects Oxygen from the Oxygen Positron Service.
  • Preferences - Opens the Oxygen AI Positron Assistant preferences page where you can configure the AI Positron service address and provide a Context for the user that the AI will use to create more relevant and personalized responses.

The main chat pane presents the results after processing an action and allows you to further refine the responses by sending messages to the Positron service platform. When an AI Positron action is triggered, the chat pane displays the progress and results.

You can also start chatting with the AI directly in the chat input box at the bottom of the view. In this case, if there is content selected in the main editor area when a chat is initiated, the selection is passed to the AI along with the document type as context for the conversation.
Tip:
You can invoke an existing action directly from the chat input box by providing general instructions to the AI. For example, to invoke the Correct Grammar action, you could type something similar to the following in the chat input box:
Invoke the action to correct grammar in the current document and update the document based on the results

The response is received from the server in streaming mode (the AI sends chunks of the response as it is being generated rather than waiting to send the entire response after it is generated). When the AI returns XML, Markdown, or JSON content, the response area has the appropriate syntax highlights, depending on the type of content received. You can open links from the response area in a web browser by hovering over the links, then hold the Control/Command key and mouse click.

Note:
When working with Oxygen versions 27 and newer, after the entire response is received, if it contains well-formed XML content and the current document is in the Author visual editing mode, the response is presented in a visual manner by default, without showing the XML tags. A small toggle button located in the response area allows you to choose between visual or plain XML text for the presentation of the response.
Once the entire response is received from the server, the following actions could be available under or next to the response (depending on the type of AI action):
  • Create document - Available only for the actions that generate an entire DITA topic, this action opens the topic in a new editor.
  • Insert/Replace - Inserts the response at the cursor location within the document (or replaces the selected content).
  • Preview - Opens the built-in file comparison tool where you to preview the content that would be inserted at the cursor location within the document. You can choose to preview the comparison in either Text or Author mode.
  • Copy - Copies the response to the system clipboard.
  • Regenerate - Requests the AI to give another response. You can also use the drop-down arrow to decide which engine model to use.
  • Review documents and approve AI modifications - Available for actions that save changes to disk, this opens a pop-up that lists the files that are being modified by the AI operation and offers options for reviewing the changes. You can click See changes to open a visual comparison of the changes. Click Accept changes to accept the modifications or click Reject changes to revert all the modifications.

Tip:
You can also partially select content from the response area, then right-click to open the contextual menu, and use the Insert/Replace, Preview, or Copy actions on that partially selected content.

You can use the bottom chat input area to refine the response by sending a message to the AI platform and it will generate a new response based upon your message. You can edit your message by clicking the Edit button that appears to the right of your message in the response area. You would then edit your message and click Submit to regenerate the response. For multiple edited messages, you can use the Next/Previous buttons to navigate between chat threads.

You can create your own favorite prompts and use supported variables to specify the content that is sent to the platform. You can use the Favorites drop-down button to store a favorite prompt. You can use the Insert Variables drop-down button to select one of the supported variables:
  • ${selection} - Expands to the currently selected content.
  • ${selection-original} - Expands to the currently selected content. If the current selected content contains track changes, they are rejected, resulting in the original version of the text.
  • ${selection-final} - Expands to the currently selected content. If the current selected content contains track changes, they are accepted, resulting in the final version of the text.
  • ${document} - Expands to the content of the entire document.
  • ${attach(filePath)} - Attaches a specified image (in png or jpeg format) or XML, Markdown, text, Word (.docx), Powerpoint (.pptx), or PDF file to the conversation. For Word and PDF files, the included images are also sent to the AI engine.
Tip:
There are easier ways to attach files to the conversation. You can drag (or copy) files from your system file browser and drop (or paste) them in the chat input area, or you can use the dedicated Attach action.
The Start recording prompt using the microphone button allows you to record your voice, which is converted to a text prompt using the AI engine. After starting the recording, the button is changed to a Stop action that you use to stop the recording.
Note:
This button may not be available or may require setting extra connector-specific parameters in the Enterprise version of the add-on.
Figure 2. Search actions

To invoke an action from the filtered list, either double-click on the item or press Enter.

Export and Import Chats

A conversation with the AI can be exported to a JSON file using the Export Chat action (available in the Actions menu). The exported file includes helpful information such as details about the invoked action, its parameters, the tools available, the tool calls, the user and assistant messages, and, if applicable, the content that the action was invoked on.

You can import a conversation from a JSON file using the Import Chat action, allowing you to continue the conversation from that point.

These actions are particularly useful for debugging purposes. For instance, you can export a conversation and share it with the developer of a custom action to help them investigate any issues encountered. Once the issue is resolved, you can import the previous conversation and resume from where you left off.

AI Positron Assistant Widget

When documents are open in the Author visual editing mode, the AI Positron Assistant drop-down widget is displayed in the top-right corner of the editor. This drop-down list contains some of the most useful AI actions for creating and improving the structure and content of the current document. It can also be accessed while editing by using the Ctrl - Alt - Enter (Windows) or Ctrl - Enter (Mac) keyboard shortcuts. In this case, the drop-down list is displayed in a floating dialog box close to the cursor location.

In addition to popular AI actions that are available in all of the various AI Positron menus, this drop-down list also contains the following other actions:
  • New chat - Clears the information in the chat pane and starts a new chat.
  • Rewrite content - Opens a floating input box where you can provide the AI with instructions on how to rewrite the selected content (or the current paragraph if there is no current selection). It can be accessed easily by using the Ctrl - Alt - R (Windows) or Cmd - Alt - R (Mac) keyboard shortcut.
    The Start recording prompt using the microphone button allows you to record your voice, which is converted to a text prompt using the AI engine. After starting the recording, the button is changed to a Stop action that you use to stop the recording.
    Note:
    This button may not be available or may require setting extra connector-specific parameters in the Enterprise version of the add-on.
  • Preferences - Opens the Oxygen AI Positron Assistant preferences page where you can configure the AI Positron service address and provide a Context for the user that the AI will use to create more relevant and personalized responses.

All the actions invoked from the AI Positron Assistant widget take effect immediately without the need to use the Preview or Replace actions from the AI Positron Assistant view.

Notice:
For a custom AI action to appear in the AI Positron Assistant widget's drop-down list, it needs to have the "embed-assist": true property set in the JSON configuration file for the particular action.
Tip:
You can disable the AI Positron Assistant widget by deselecting the Embed AI Assistant in Author page option in the Actions preferences page.

Built-in AI Actions

Accessibility
  • Generate Image Alternate Text - Generates an alternate text for an image that is selected in the main editing area when working with DITA XML content in the Author visual editing mode.
    Tip:
    Conveniently access this action by clicking the Generate Alternate Text button that is available from the floating toolbar that appears when you select an image.
Content Generation
  • Generate Documentation Draft - Generates a documentation draft of a DITA XML topic based on a configuration file that fine tunes the generation process by specifying the context, audience, summary, instructions, images, and a similar topic to help the AI generate the draft content.
  • New DITA Topic - Generates a DITA XML topic based on a text description entered in a popup dialog box. For Oxygen version 27 and newer, related content from the current set of project resources is also taken into account.
  • Update Content Based on Images - Updates the content of a DITA XML topic based on the images that it references.
  • Short Description - Generates a short description ( inside a <shortdesc> element) based on a summary of the selected text (or the entire document if there is no selection). You can configure the style and the approximate number of sentences to be generated.
  • Index Terms - Generates a <keywords> element that contains index terms obtained from the selected text (or the entire document if there is no selection).
  • Formula/Equation - Generates an AI proposal for a MathML formula or equation based on information provided by the user when invoking the action (for example, a description of a substance, physics formula, mathematical expression, or LaTeX equation).
  • Follow Instructions (available for XSLT, Schematron, XSD, CSS, XQuery, JSON, and JSON Schema) - Replaces the selected instructions with content generated based on them.
Development
  • Explain Code - Generates an explanation of the code found in the current selection or the element content at the current cursor location.
  • Chat About Code - Creates a new chat to start a discussion with the AI regarding the code found in the current selection or the element content at the current cursor location.
  • Document Code (available for XSLT, XSD, and Schematron) - Generates the documentation for the code and includes it as a comment in the document. If code is selected, it documents the selected code. Otherwise, it documents the element at the cursor location. It inserts the documentation as an XML comment before the documented code.
  • Generate Code - Generates the code for the current editor type based on an instruction. It also reuses components found in the current document when generating the new code. The instruction can be a selected text, in which case the text will be replaced with the generated code. Alternatively, the instruction can be the previous XML comment, in which case the generated text will be inserted after the comment.
  • Suggest Refactoring (available for XSLT and XSD) - Generates a suggestion for refactoring the selected code to simplify it and make it easier to read and understand. It has some enhanced features for XSLT files, such as it upgrades selected XSLT code to version 3.0, it breaks down large templates into small units, it incorporates xsl:try and xsl:catch instructions for error handling, and adds XML comments to clarify the purpose and functionality of the code.
  • Annotate Code (available for XSLT, Schematron, and XSD) - Generates XML comments within the code found in the current selection, at the cursor location, or in the whole document. The generated annotations explain key concepts of the code.
Rewrite
  • Correct Grammar - Generates a suggestion for correcting the grammar and spelling within the selected content.
  • Improve Readability - Modifies the selected content to improve readability and fix grammar/spelling errors. If you hover the mouse prompt over this button, a Settings button becomes available in the top-right corner. Clicking the Settings button opens a pop-up window where you can choose the writing level of the content to be generated. You can choose between: Beginner, Intermediate, Advanced, and Expert.
  • Use Active Voice - Generates a suggestion for replacing the selected content with content that has been converted from passive to active voice.
  • Improve Structure - Improves the selected DITA XML content by adding additional structure or inline elements.
  • Itemize - Generates a suggestion for converting the selected content into a list of items.
  • Join Items - Generates a suggestion for converting the selected list of items into a paragraph.
Review
  • Proofread - Adds comments in content that has logical consistency problems, grammar or spelling mistakes, or is hard to read and comprehend.
  • Resolve Comments - Changes the selected content based on the suggestions within comments and then removes the comments.
Overview
  • Answer Questions - Generates answers to questions that the AI finds within the selected content (or the entire document if there is no selection).
  • Generate Questions - Generates a list of five questions that are answered within the selected content (or the entire document if there is no selection).
  • Summarize - Generates a summary of the selected content (or the entire document if there is no selection).
  • Readability - Generates suggestions for changing the selected content (or the entire document if there is no selection) to improve its general readability.
Translation
  • English, French, German, Japanese - These actions translate the selected text to the target language, while preserving the original XML markup.
  • Other... - This action behaves like the previous ones, but it allows you to provide the target language. You can either choose from the predefined values or type another one.
Intelligent Agents
  • Create Topics - Generates DITA XML topics based upon user input, incorporating relevant project content. It creates a topic hierarchy, assigns DITA document types, and proposes a DITA map location. Topics are then saved and added upon user approval. The AI considers the DITA map opened in the DITA Maps Manager and the selected topic and then looks for similar content in topics gathered from the related links or through the Retrieval-Augmented Generation (RAG) process. After the action processes, a Preview dialog box shows the list of proposed changes.
  • Expand Draft - Enhances a draft of a DITA XML topic by refining the existing content, adding new content, adding markup that is consistent with similar topics, and generating documentation based on the referenced images using the Vision support. The AI looks for similar content in topics gathered from the related links or through the Retrieval-Augmented Generation (RAG) process.
  • Split Topic - Analyzes the current DITA XML topic based on modular document development best practices. If the topic is too large or contains multiple subjects, the AI may split it into several topic files. References to the new topics are also added in the DITA map that is currently open in the DITA Maps Manager. After the action processes, a Preview dialog box shows the list of proposed changes.
  • Fix Validation Problems - Validates the entire content of the current document, finds problems, and then uses AI to fix all the reported problems.
  • Fix Terminology Problems [optional] - When installed along with the latest Terminology Checker add-on, this action that is contributed by the Terminology Checker gathers terminology problems from the entire content of the current document, and then uses AI to fix all the reported problems.
Reuse
  • Product Names - Finds product names in the selected content and replaces them with key references (@keyref). If keys are not defined for specific product names, those names are wrapped in <keyword> elements.
  • Component - Use the AI to identify the closest existing reusable component that matches the current selected paragraph.
DITA Conversion
  • Analyze and Update Topic - This action analyzes and optimizes your DITA topics to ensure modularity and consistency. It reviews and updates the topics to align with the DITA standards, generates new topics, and updates the DITA map as needed.
  • Convert to [DITA_TYPE] - Actions that convert plain text, Markdown, or DITA content to a specific type of DITA topic:
    • Task - A topic type used to describe a series of steps to accomplish a specific goal. It is ideal for procedural information.
    • Concept - A topic type used to explain an idea, definition, or concept. It is typically used for background or explanatory information.
    • Reference - A topic type used to provide detailed, structured information such as tables, lists, or specifications. It is often used for quick look-up information.
    • Troubleshooting - A topic type used to describe problems, their causes, and solutions. It is designed to help users resolve issues effectively.
    • Glossary - A topic type used to define terms and provide explanations. It is commonly used to build a glossary of terms for a project or document.
File Creation
  • Create New XSLT - Generates a new XSLT file based on a text description that you provide in a pop-up dialog box.
  • Create New XML Schema - Generates a new XML Schema file (XSD) based on a text description that you provide in a pop-up dialog box.
  • Create New Schematron - Generates a new Schematron file based on a text description that you provide in a pop-up dialog box.
  • Create New JSON Schema - Generates a new JSON Schema file based on a text description that you provide in a pop-up dialog box.
  • Create New DTD - Generates a new Document Type Definition (DTD) file based on a text description that you provide in a pop-up dialog box.
Tip:
The New Document Wizard contains a folder named AI Positron Templates with new file templates for creating these same types of documents (XSLT, XML Schema, Schematron, JSON schema, and DTD).
Marketing
  • Release Notes - Creates release notes based on a set of features or issue ticket numbers with optional descriptions.
  • Marketing Post - Creates a marketing post based on a list of ideas or release notes.
  • Improve SEO - Rewrites the content to enhance search engine optimization.
  • Pain-Agitate-Solution - Rewrites the content using a marketing style based on the Pain-Agitate-Solution framework.
  • Features-Advantages-Benefits - Rewrites the content using a marketing style based on the Features-Advantages-Benefits framework.
Note:
Custom actions can be configured in the AI Positron Assistant Actions preferences page.
Tip:
Use the dedicated filter to search the available AI-powered actions.

Creating Custom Prompts/Actions by Recording Changes

The Record button in the top-left corner of the view allows you to create new AI actions. It opens the Record examples for instructions dialog box where you can provide a set of instructions that are intended for the AI to follow. Then, after clicking the Start recording button at the bottom of the dialog box, you can record a collection of examples in the editing area that will help the AI better follow the given instructions. The examples are recorded from the changes made in the open editors.

After providing examples, you need to click the Record button again to stop the recording. You will then have the opportunity to save the final result as either a Positron action or as a favorite chat prompt.

For example, if you want to add DITA markup to menu cascades, you can follow these steps:
  1. Click the Record button.
  2. In the Record examples for instructions dialog box, enter some instructions like: You are a technical writer. Add DITA markup to menu cascades.
  3. Click Start recording.
  4. Open a DITA topic that has a menu cascade without markup (for example: File > Export).
  5. Edit the topic and add markup, transforming it to:
    <menucascade>
      <uicontrol>File</uicontrol>
      <uicontrol>Export</uicontrol>
    </menucascade>
  6. Click the Record button again to stop the recording. The system generates the following instructions with examples:
    You are a technical writer. Add DITA markup to a menu cascades.
    ###
    Input:
            <p>File > Export</p>
    
    Output:
          <p><menucascade><uicontrol>File</uicontrol>
          <uicontrol>Export</uicontrol></menucascade></p>
    
    Input: ${selection}
    Output:
    
  7. In the resulting dialog box, save the final result as either a Positron action or as a favorite chat prompt.

AI Refactoring

The AI Positron Assistant add-on contributes an AI Positron XML Refactoring action in the contextual menu (Refactoring > AI Positron XML Refactoring) of both the Project and DITA Maps Manager views in Oxygen. It can be used to refactor multiple XML files (local or remote) at once.

You can invoke the AI Positron XML Refactoring action to apply either a predefined AI action or a custom prompt to modify the selected XML resources. The resulting AI Positron XML Refactoring dialog box presents an estimate of the amount of credits that will be consumed by the operation, and you have the option to preview the changes before applying them over the original content.

For example, you could use the predefined Translate to action to translate multiple DITA topics into a certain language or apply the Correct Grammar or Improve Readability actions on multiple resources.

XML Refactoring

The add-on contributes AI-specific XML refactoring actions in the XML Refactoring tool's wizard (Tools > XML Refactoring, in the AI category):
  • Generate alternate text for images in DITA XML topics - Generates an alternate text for images in DITA XML topics.
  • Generate missing short descriptions in DITA XML topics - Generates a short description (inside a <shortdesc> element) for DITA XML topics.
  • Shorten existing short descriptions in DITA XML topics - Generates a shorter version of an existing short description for DITA XML topics.
The XML refactoring actions can be applied on multiple resources and are based on the ai:transform-content and ai:verify-content XPath extension functions contributed by the add-on.

Validation Quick Fixes

When validation problems are displayed in the Results pane, you can right-click on a problem and use the AI Positron Fix action to ask the AI Positron platform for help with fixing the problem. It will propose content in the chat pane (within the AI Positron Assistant view) that can be used to solve the problem. The AI Positron Fix action also utilizes the Retreival-Augmented Generation (RAG) functionality to retrieve information from the current document to use as context.

Project Retrieval-Augmented Generation (RAG)

When using the add-on with Oxygen versions 26.1 (latest build) or newer, certain actions that generate content (e.g. New DITA Topic, Generate Documentation Draft, Expand Draft) use information retrieved from the current project that is open in the Project view to enrich the AI context and receive more meaningful and project-targeted responses. The AI Positron Fix action also uses the Retrieval-Augmented Generation functionality to get context from the current document.

For the project-based retrieval augmentation to work, the Enable searching in content option must be enabled in the Open/Find Resource preferences page and the indexing must have finished before invoking the actions. If the opened DITA map is from a remote location (e.g. a CMS), the Enable indexing for remote resources option needs to be selected as well. To test that the indexing is available, you can use Find > Open/Find Resource (from the main menu) and search for some project content to see if the indexer properly finds it.

The Reuse/Component AI action locates reusable components using the Window > Show view > DITA Reusable Components side view. You can check that reusable components have been properly indexed in that side view before invoking the action.

You can enable Retrieval-Augmented Generation (RAG) for the Chat and configure related options in the AI Positron Functions and RAG preferences page.

If Oxygen Feedback is used to provide search functionality for a web site generated from the DITA project, the Feedback search system can also be used to retrieve related content. For this functionality to work, you must enable the External RAG sources option and configure its sibling options in the Functions and RAG preferences page.

Generating Documentation Drafts

The AI Positron Assistant add-on provides the ability to generate a documentation draft of a DITA topic based on a configuration file that tailors the draft generation process using a context, instructions, images, and other data.

Once the add-on is installed, you can use the New Document wizard to create a new AI Doc Draft Configuration file, that can be edited in Author mode. Validation and content completion are automatically provided for such configuration files. The Author mode also renders short explanations for each element, as well as buttons for inserting the optional elements.

After providing the configuration data, you can use the Generate Documentation Draft action to trigger the AI-based drafting process. Once the AI response is complete in the AI Positron Assistant side-view, click the Create document button to create a new DITA topic with content generated based upon the data in the configuration file.

The simplest form of the configuration file would only contain the <title> and <draft-summary> that will be used by the AI as a starting point:
<?xml version="1.0" encoding="UTF-8"?>
<doc-draft>
  <title>Generate Documentation Draft</title>
  <instructions>
    <draft-summary>The new "Generate Documentation Draft" action was added to the 
"Content Generation" category and can be used to draft a DITA documentation topic
using AI and a configuration file.</draft-summary>
  </instructions>
</doc-draft>
Other data elements can be used to further configure the drafting process: <context>, <target audience>, <instructions>, <image>, <file>, and <similar-topic>.
Notice:
  • For the <image> element, only a PNG, JPEG, and non-animated GIF image should be provided.
  • For the <file> element, you may provide a file in plain text format (including Markdown or XML) or in a document format (e.g. PDF, Word, or PowerPoint).

<?xml version="1.0" encoding="UTF-8"?>
<doc-draft>
  <title>Generate Documentation Draft</title>
  <context>I am working on the user manual of a software application called Oxygen XML Editor,
 used for authoring and publishing XML content.</context>
  <prolog>
    <metadata>
      <audience>The audience of our user manual is very wide and includes 
people without a technical background.</audience>
    </metadata>
  </prolog>
  <instructions>
    <draft-summary>We have a new action in the contextual menu of the Project side-view,
 called "Format and Indent...", which can be used to pretty print multiple files at once. 
 The action is available in both the Oxygen XML Editor stand-alone distribution and the 
 Eclipse plug-in.</draft-summary>
    <instruction>Analyze the following image and document the dialog box
 and all its components.</instruction>
    <image href="format-and-indent-files.png"/>
    <instruction>Add additional information based on the following file.</instruction>
    <file href="format-and-indent-files-overview.docx"/>
    <instruction>Also add a DITA "note" element that mentions the fact that this feature 
is not available for XQuery files.</instruction>
  </instructions>
  <relationship-context>
    <similar-topic href="spell-check-in-files.dita"/>
  </relationship-context>
</doc-draft>
Note:
Project retrieval functionality can be enabled for this action by setting the use-related-content-from-project="true" attribute on the <draft-summary> element. This can easily be done in the Author-mode rendering of the draft configuration file by selecting the Use related content from project checkbox located below the text area of the draft summary.

Customizing AI Positron for a DITA XML Project

The add-on includes a variety of helpful AI actions designed to boost productivity. However, DITA XML projects have specific requirements. They often need particular terminology and adherence to style guide rules, or they may rely on company-specific DITA specialization DTDs/schemas that differ from the standard DITA DTDs that the AI models are trained on. Therefore, to generate high quality content using the AI actions, the add-on must be configured to understand the unique aspects of the DITA XML project it will be used with. You can read more about how the add-on's context prompt can be configured to generate content that adheres to your project's rules in this blog post.

Exclude Resources from AI Processing

You can create files named .ai-ignore in various locations in your project to have the AI ignore certain files and folders from AI processing. The .ai-ignore files allow you to define exclusion rules using one pattern per line.
Note:
Do not use separators, such as commas or semicolons, between rules. Each rule must be on a separate line.
You can use wildcards when defining ignore rules. For example:
  • * - Excludes all files in the current directory and all subdirectories from AI processing.
  • *.txt - Excludes all .txt files in the current folder and its subfolders.
  • */topics/* - Excludes all files from any topics directory, regardless of their depth.
  • resources/* - Excludes all files from the resources directory.

You can also easily add resources to an ignore file by using the Exclude from AI processing action that is available in the contextual menu of the Project view, DITA Maps Manager, and the Author/Text editor pages (within the AI Positron Assistant submenu). When this action is used, the selected files or folders are added to the .ai-ignore file, which is automatically opened for review or editing. This action will also create an .ai-ignore file if one does not already exist in the current directory.

Custom XPath Functions

The add-on contributes some XPath extension functions (available in the content completion proposals for Schematron, XSLT, XQuery, and XPath) that can be used to rephrase content, perform validation checks on existing content, or to invoke an AI action:

ai:transform-content(system, (user, assistant,)* user)

Use this function from namespace http://www.oxygenxml.com/ai/function to automatically transform content using AI.

The function has the string parameters:
  • system - This parameter is used to set up the context or provide instructions for the AI model. It can include guidelines, rules, or any other information that affects how the model should interpret inputs and generate outputs.
  • user - This parameter represents the input from the human user. The user's input guides the conversation and prompts a response from the assistant (AI model). This input is typically what you want to transform or have addressed by the AI.
  • assistant - This parameter represents the responses or actions from the AI model (assistant) based on the user's input and the context set by the system. Multiple assistant parameters can be provided to represent different stages or turns in the conversation.

It returns a string that represents the transformed content.

Here is an example of a custom Schematron schema that uses the transform-content function to correct the number of words used in a short description:
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt3"
    xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
    <sch:ns uri="http://www.oxygenxml.com/ai/function" prefix="ai"/>
    <sch:pattern>
        <sch:rule context="shortdesc">
            <sch:report test="count(tokenize(.,'\s+')) > 50" sqf:fix="rephrase">
      The phrase must contain less than 50 words.</sch:report>
            <sqf:fix id="rephrase">
                <sqf:description>
                    <sqf:title>Rephrase phrase to be less that 50 words</sqf:title>
                </sqf:description>
                <sqf:replace match="text()" select="ai:transform-content(
                'Reformulate phrase to be less that 50 words', .)"></sqf:replace>
            </sqf:fix>
        </sch:rule>
    </sch:pattern>
</sch:schema> 
ai:verify-content(system, (user, assistant,)* user)

Use this function from namespace http://www.oxygenxml.com/ai/function to automatically validate content using AI.

The function has two string parameters:
  • system - This parameter is used to set up the context or provide instructions for the AI model. It can include guidelines, rules, or any other information that affects how the model should interpret inputs and generate outputs.
  • user - This parameter represents the input from the human user. The user's input guides the conversation and prompts a response from the assistant (AI model). This input is typically what you want to transform or have addressed by the AI.
  • assistant - This parameter represents the responses or actions from the AI model (assistant) based on the user's input and the context set by the system. Multiple assistant parameters can be provided to represent different stages or turns in the conversation.

It returns a boolean value that represents the result of the validation.

Here is an example of a custom Schematron schema that uses the verify-content function to check a short description for instances of a passive voice:
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt3"
  xmlns:sqf="http://www.schematron-quickfix.com/validator/process">
  <sch:ns uri="http://www.oxygenxml.com/ai/function" prefix="ai"/>    
  <sch:pattern>
    <sch:rule context="shortdesc">
      <sch:report test="ai:verify-content('Does the following content has passive voice?', .)"
            sqf:fix="rephrase">The phrase uses passive voice.</sch:report>
      <sqf:fix id="rephrase">
         <sqf:description><sqf:title>Rephrase text to be active voice</sqf:title>
</sqf:description>
         <sqf:replace match="text()"
                select="ai:transform-content('Rephrase text to be active voice', .)"/>
         </sqf:fix>
      </sch:rule>
  </sch:pattern>
</sch:schema> 
ai:invoke-action(actionId, extraPrompt, content)

Use this function from namespace http://www.oxygenxml.com/ai/function to invoke a predefined AI action on a specified content.

The function has the string parameters:
  • actionId - The ID of the action to call (string).
  • extraPrompt - An extra prompt to give to the action as a context. It gets expanded at the beginning of the action's prompt (string).
  • content - The content to process using the action (string).

It returns a string that represents the content returned by the action.

Change Tracking Limitations/Behavior

Change tracking and comments are serialized as processing instructions in XML documents. When processing content from XML documents opened in the Author visual editor mode, the AI engine receives the XML content with the change tracking and comment processing instructions present inside of it. However, all changes made by the AI engine to the processed XML content are previewed and inserted with change tracking turned off in the document.

Security

All possibly confidential user-specific content (history list, favorite prompts, local caches for improving speed) is stored encrypted and cannot be exported and used by others.