Documentation Center

Admin.XMLAIAssistantConfiguration.xml

Modify the Admin.XMLAIAssistantConfiguration.xml file to configure the connection to the Large Language Models (LLM) provider and the behavior of the Draft Companion tab in Draft Space.

Changelog

File versionContent Manager versionNotes
1.015.1.0Introduction of the file

Overview

Draft Space enables authors to improve content quality using the power of Large Language Models through the Draft Companion feature. You configure Draft Companion in Organize Space.

To access this configuration file in Organize Space, select the Settings tab, then the XML Settings subtab, and then the AI Assistant subsubtab.

XML elements

The XML elements perform the following functions:
<providers> section
The <providers> section contains one <provider> subsection, representing an LLM provider, with a unique identifier (its id attribute).
For this provider, you specify:
  • access properties to connect to the LLM provider through the <connection> subsection
  • one or more supported AI models through a <models> subsection
The <connection> subsection of a provider contains a number of named properties:
Property nameDescription
numberOfRetriesThe number of connection attempts that are made before the provider is considered to be down
requestTimeoutSecThe number of seconds after which a request is considered to have timed out
roleThe role under which you access the LLM provider. Set this property if you are using the RWS Cloud environment.
accessKeyIdThe access key ID to use to authenticate your connection to the LLM provider. Set this property if you are not using the RWS Cloud environment.
secretAccessKeyThe secret access key to be paired with the access key ID above. Set this property if you are not using the RWS Cloud environment
regionThe geographical region in which the LLM provider operates
Here is an example of a connection section:
<connection>
  <property name="numberOfRetries">3</property>
	 <property name="requestTimeoutSec">60</property>
	 <property name="accessKeyId">AKIAIOSFODNN7EXAMPLE</property>
	 <property name="secretAccessKey">wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</property>
	 <property name="region">cn-northwest-1</property>
</connection>
The <models> subsection contains one or more <model> sections, one for each AI model, with the following configurable properties:
  • a unique identifier (its id attribute)
  • the ID of a prompt (listed in the <prompts> section of this configuration) to wrap around content sent to Draft Companion (contentWrapperRefId attribute) so that the Draft Companion can more easily identify who said what.
  • the ID of a prompt (listed in the <prompts> section of this configuration) to describe the behavior that the model expects from Draft Companion (systemPromptRefId attribute). This is the first prompt sent to Draft Companion. It "sets the stage" before the user asks their question. For example, such a prompt might read as follows: "You are a content writer expert with copy-editor expertise and your name is "Author Assistant". Read the content and understand what is written there. Answer the question only if you know the answer or can make a well-informed guess, otherwise tell the user 'I cannot help you this time.' If a request from the user refers to harmful, pornographic, or illegal activities, reply with 'I cannot help you this time.' In your replies, you must not repeat the question, you must skip the forewords and explanations and afterwords, and you must get straight to the point."
Apart from these attributes of the <model> element, the <model> subsection of a provider can also contains any of the following optional named properties, which are known as inference parameters:
Property namePossible valuesDefault value

if not set

Description
temperatureA number between 0 and 11The randomness of token selection during inference. A higher temperature value leads to more diverse generated text output.
topPA number between 0 and 10.999The percentage (expressed as a decimal value) of most-likely candidates that the model considers for the next token.
topKA number between 0 and 500none (disabled)The top number of tokens, sorted descending by probability, to perform token sampling on at each text generation step. Changing this value enhances computational efficiency and controls output diversity. If not set, all tokens are considered.
maxTokensToSampleA number between 1 and 4096200The maximum number of tokens that can be sampled during text generation. By lowering this value, you restrict the length of generated outputs.
Here is an example of a model section:
<model id="rephraseBasicModel" contentWrapperRefId="textContentWrapper" systemPromptRefId="straightToThePointSystemPrompt">
  <properties>
		  <property name="temperature">0.5</property>
		  <property name="topP">1</property>
		  <property name="topK">250</property>
		  <property name="maxTokensToSample">2000</property>
	 </properties>
</model>
<prompts> section
The <prompts> section contains one or more <prompt> elements, one for each predefined prompt, with a unique identifier (specified in the id attribute) and the actual text of the prompt (element contents). The <model> and <action> elements in this configuration can reference these prompts by ID, using them as directives for providers to follow. They act as the initial input or guiding instructions for the model to produce desired outputs, varying in complexity from basic phrases to comprehensive descriptions or inquiries, tailored to the model's intended application.
Here is an example of a prompts section for a fictitious company called Zonvix:
<prompts>
	<prompt id="straightToThePointSystemPrompt">Do not repeat the question, skip the introduction and explanations, and get straight to the point.</prompt>
	<prompt id="aiAssistantSystemPrompt">Context: You're an assistant named "Zonvix AI Assistant". Use the context to answer the question.\n\nQuestion: {{question}}</prompt>
	<prompt id="rephraseTextPrompt">Rephrase the text to improve readability.</prompt>
	<prompt id="fixGrammarPrompt">Fix grammar in the content.</prompt>
</prompts>
<actions> section
The <actions> section contains one or more <action> elements, representing an action supported by Draft Space, with a unique identifier (specified in the id attribute) and a flag to calculate a readability score or not (the calculateReadabilityScoreattribute, a Boolean that defaults to false if not set).
Draft Space uses this section to build a series of buttons in the Draft Companion panel.
Each action section defines an individual action that can be performed within a system. It includes the following subelements:
  • The prompt element references a specific prompt (input directive) for the action through a refId attribute.
  • The model element references a specific model that is used to perform the action through a refId attribute.
  • The label element gives the action a label for the action. It can either be specified directly (as element contents) or referenced from a resource (through a resourceRef attribute).
  • The description element gives the action a description. It can either be specified directly (as element contents) or referenced from a resource (through a resourceRef attribute).
Here is an example of a actions section:
<actions>
  <action id="rephraseTextAction" calculateReadabilityScore="true">
		  <prompt refId="rephraseTextPrompt"/>
		  <model refId="rephraseBasicModel"/>
		  <label resourceRef="rephraseTextActionLabel"/>
		  <description resourceRef="rephraseTextActionDescription"/>
	 </action>
</actions>
<conversationActions> section
The <conversationActions> section contains a single <action> element that represents a conversation action, with a unique identifier (specified in the id attribute). Draft Space uses this section to support chat commands in the Draft Companion panel.
The action subsection defines an individual conversation action that can be performed within a system. It includes the following subelements:
  • The model element references a specific model that is used to perform the action through a refId attribute.
  • The label element gives the action a label for the conversation action. It can either be specified directly (as element contents) or referenced from a resource (through a resourceRef attribute).
  • The description element gives the conversation action a description. It can either be specified directly (as element contents) or referenced from a resource (through a resourceRef attribute).
Here is an example of a <conversationActions> section:
<conversationActions>
  <action id="conversationAction">
		  <model refId="userPromptHighlyVariativeModel"/>
		  <label resourceRef="conversationActionLabel">Enter content you want to improve</label>
		  <description resourceRef="conversationActionDescription">Type a request to the Draft Companion here</description>
	 </action>
</conversationActions>