02.10: Sample Dialogues
The sample dialogues contributor emits few-shot example turns from persona configuration to demonstrate speaking voice and dialogue cadence.
Flow and ownership
Section titled “Flow and ownership”The contributor buildSampleDialogueContextItems in src/utils/text/context/templates.ts maps paired example arrays to structured context items:
- Eligibility:
- Returns an empty array during user impersonation, when persona state is missing, when either
sample_dialogues_inorsample_dialogues_outis empty, or when array lengths do not match.
- Returns an empty array during user impersonation, when persona state is missing, when either
- Turn transformation:
- User example: When the user prompt matches
UNPAIRED_SAMPLE_DIALOGUE_SENTINEL, the user turn is omitted and only the model turn emits. Otherwise, the turn text passes through humanization (if enabled), mention conversion, and uncensor transforms, and emits as auser-role item taggedDIALOGUE_SAMPLE. - Model example: Ensures the bot name prefix (
${botName}:) is present on the model output. The text passes through humanization, mention conversion, and uncensor transforms, and emits as amodel-role item taggedDIALOGUE_SAMPLE.
- User example: When the user prompt matches
- Humanizer handling:
- When the Force Lowercase or Punctuation Splits toggle is on, both turns pass through
applyStableHumanizer. Force Lowercase normalizes casing and Punctuation Splits strips semicolons; the randomized comma and emphasis rolls never run here, so commas and quotes stay intact as stable few-shot syntax examples.
- When the Force Lowercase or Punctuation Splits toggle is on, both turns pass through
Constraints and rationale
Section titled “Constraints and rationale”- Impersonation suppression: Sample dialogues demonstrate the bot persona’s voice and are suppressed during user impersonation.
- Preset reassembly and terminal spacer: Tagged as
DIALOGUE_SAMPLE, which SillyTavern preset reassembly maps to thedialogueExamplesmarker. If a custom preset configuration places sample dialogues at the terminal position of the assembled prompt,presetContextBuilder.tsappends a terminal warning notice to prevent models from mistaking the example dialogue for the active conversation turn.
Source pointers
Section titled “Source pointers”src/utils/text/context/templates.ts:buildSampleDialogueContextItems.src/utils/text/processors/formatters.ts:humanizeStringformatting.src/utils/text/presetContextBuilder.ts:dialogueExamplesmapping and terminal spacer.