mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-15 18:59:07 +01:00
72 lines
6.5 KiB
HTML
72 lines
6.5 KiB
HTML
<div>
|
||
System-wide Replacement Macros (in order of evaluation):
|
||
</div>
|
||
<ul>
|
||
<li><tt>{{pipe}}</tt> – only for slash command batching. Replaced with the returned result of the previous command.</li>
|
||
<li><tt>{{newline}}</tt> – just inserts a newline.</li>
|
||
<li><tt>{{original}}</tt> – global prompts defined in API settings. Only valid in Advanced Definitions prompt overrides.</li>
|
||
<li><tt>{{input}}</tt> – the user input</li>
|
||
<li><tt>{{charPrompt}}</tt> – the Character's Main Prompt override</li>
|
||
<li><tt>{{charJailbreak}}</tt> – the Character's Jailbreak Prompt override</li>
|
||
<li><tt>{{description}}</tt> – the Character's Description</li>
|
||
<li><tt>{{personality}}</tt> – the Character's Personality</li>
|
||
<li><tt>{{scenario}}</tt> – the Character's Scenario</li>
|
||
<li><tt>{{persona}}</tt> – your current Persona Description</li>
|
||
<li><tt>{{mesExamples}}</tt> – the Character's Dialogue Examples</li>
|
||
<li><tt>{{user}}</tt> – your current Persona username</li>
|
||
<li><tt>{{char}}</tt> – the Character's name</li>
|
||
<li><tt>{{lastMessage}}</tt> - the text of the latest chat message.</li>
|
||
<li><tt>{{lastMessageId}}</tt> – index # of the latest chat message. Useful for slash command batching.</li>
|
||
<li><tt>{{// (note)}}</tt> – you can leave a note here, and the macro will be replaced with blank content. Not visible for the AI.</li>
|
||
<li><tt>{{time}}</tt> – the current time</li>
|
||
<li><tt>{{date}}</tt> – the current date</li>
|
||
<li><tt>{{weekday}}</tt> – the current weekday</li>
|
||
<li><tt>{{isotime}}</tt> – the current ISO time (24-hour clock)</li>
|
||
<li><tt>{{isodate}}</tt> – the current ISO date (YYYY-MM-DD)</li>
|
||
<li><tt>{{datetimeformat …}}</tt> – the current date/time in the specified format, e. g. for German date/time: <tt>{{datetimeformat DD.MM.YYYY HH:mm}}</tt></li>
|
||
<li><tt>{{time_UTC±#}}</tt> – the current time in the specified UTC time zone offset, e.g. UTC-4 or UTC+2</li>
|
||
<li><tt>{{idle_duration}}</tt> – the time since the last user message was sent</li>
|
||
<li><tt>{{bias "text here"}}</tt> – sets a behavioral bias for the AI until the next user input. Quotes around the text are important.</li>
|
||
<li><tt>{{roll:(formula)}}</tt> – rolls a dice. (ex: <tt>>{{roll:1d6}&rcub</tt> will roll a 6-sided dice and return a number between 1 and 6)</li>
|
||
<li><tt>{{random:(args)}}</tt> – returns a random item from the list. (ex: <tt>{{random:1,2,3,4}}</tt> will return 1 of the 4 numbers at random. Works with text lists too.</li>
|
||
<li><tt>{{random::(arg1)::(arg2)}}</tt> – alternative syntax for random that allows to use commas in the list items.</li>
|
||
<li><tt>{{banned "text here"}}</tt> – dynamically add text in the quotes to banned words sequences, if Text Generation WebUI backend used. Do nothing for others backends. Can be used anywhere (Character description, WI, AN, etc.) Quotes around the text are important.</li>
|
||
</ul>
|
||
<div>
|
||
Instruct Mode and Context Template Macros:
|
||
</div>
|
||
<div>
|
||
<small>(enabled in the Advanced Formatting settings)</small>
|
||
</div>
|
||
<ul>
|
||
<li><tt>{{maxPrompt}}</tt> – max allowed prompt length in tokens = (context size - response length)</li>
|
||
<li><tt>{{exampleSeparator}}</tt> – context template example dialogues separator</li>
|
||
<li><tt>{{chatStart}}</tt> – context template chat start line</li>
|
||
<li><tt>{{instructSystem}}</tt> – instruct system prompt</li>
|
||
<li><tt>{{instructSystemPrefix}}</tt> – instruct system prompt prefix sequence</li>
|
||
<li><tt>{{instructSystemSuffix}}</tt> – instruct system prompt suffix sequence</li>
|
||
<li><tt>{{instructInput}}</tt> – instruct user input sequence</li>
|
||
<li><tt>{{instructOutput}}</tt> – instruct assistant output sequence</li>
|
||
<li><tt>{{instructFirstOutput}}</tt> – instruct assistant first output sequence</li>
|
||
<li><tt>{{instructLastOutput}}</tt> – instruct assistant last output sequence</li>
|
||
<li><tt>{{instructSeparator}}</tt> – instruct turn separator sequence</li>
|
||
<li><tt>{{instructStop}}</tt> – instruct stop sequence</li>
|
||
</ul>
|
||
<div>
|
||
Chat variables Macros:
|
||
</div>
|
||
<div><small>Local variables = unique to the current chat</small></div>
|
||
<div><small>Global variables = works in any chat for any character</small></div>
|
||
<ul>
|
||
<li><tt>{{getvar::name}}</tt> – replaced with the value of the local variable "name"</li>
|
||
<li><tt>{{setvar::name::value}}</tt> – replaced with empty string, sets the local variable "name" to "value"</li>
|
||
<li><tt>{{addvar::name::increment}}</tt> – replaced with empty strings, adds a numeric value of "increment" to the local variable "name"</li>
|
||
<li><tt>{{incvar::name}}</tt> – replaced with the result of the increment of value of the variable "name" by 1</li>
|
||
<li><tt>{{decvar::name}}</tt> – replaced with the result of the decrement of value of the variable "name" by 1</li>
|
||
<li><tt>{{getglobalvar::name}}</tt> – replaced with the value of the global variable "name"</li>
|
||
<li><tt>{{setglobalvar::name::value}}</tt> – replaced with empty string, sets the global variable "name" to "value"</li>
|
||
<li><tt>{{addglobalvar::name::value}}</tt> – replaced with empty string, adds a numeric value of "increment" to the global variable "name"</li>
|
||
<li><tt>{{incglobalvar::name}}</tt> – replaced with the result of the increment of value of the global variable "name" by 1</li>
|
||
<li><tt>{{decglobalvar::name}}</tt> – replaced with the result of the decrement of value of the global variable "name" by 1</li>
|
||
</ul>
|