Skip to content
Vitor Lima edited this page Sep 7, 2025 · 2 revisions

Expressions let characters “emote” visually during chats. After a character sends a message, NarratrixAI classifies the emotional tone and shows the best‑matching image from that character’s Expression Pack. Set up expressions per Character and drive them with a dedicated Chat Template that runs a lightweight classification prompt.

In the Expressions panel:

  • Click Configure to edit prompts and model settings for expression classification.
  • Click Generate to classify the most recent character message on demand.
  • Toggle Auto to reclassify automatically when new messages arrive (runs on a short interval).

Tip
With Auto enabled, you can also select text in the transcript to classify only the selected content.

image


How It Works

  • Each character has an Expression Pack (a set of images, one per expression name such as neutral, happy, angry).
  • The Expressions panel sends a short prompt to your chosen model, asking it to return exactly one label from the character’s available expressions.
  • NarratrixAI matches the model’s answer to the closest expression name and updates the image. If no close match is found, it falls back to neutral.

Setting Up Expressions

image

  1. Choose or create a Chat Template dedicated to expressions.

    • Use a minimal or empty Prompt Format Template to avoid extra text.
    • Recommended Response Length: 60 (keeps answers to a single label).
  2. Configure the System Prompt. It will replace any Prompt Format Template section.

    • Describe the job: classify tone/emotion based on character personality, recent message, and available labels.
    • Emphasize: “Return exactly one expression label from the provided list.”
  3. Configure the User Prompt.

    • Provide the character name and personality.
    • Include the latest chat text to classify.
    • Include the list of allowed expressions.
    • Optionally include the last chosen expression to discourage repetition.
  4. Optional: Prefill with a Custom Prompt.

    • Add a Custom Prompt with Role: Character, Position: Bottom of Conversation, Content: “The Expression is:” to hint single‑token completions (only helps on models that support prefilling/continuations).
image
  1. Save Changes, then click Generate to test on the latest character message. Switch to Auto when satisfied.

Placeholders

When configuring Expression prompts, the following placeholders are available in addition to standard ones:

  • {{expression.list}} — a comma‑separated list of the character’s available expression names.
  • {{expression.last}} — the last expression chosen for this character.
  • Common placeholders that are useful here:
    • {{char}}, {{character.name}}
    • {{character.personality}}
    • {{chat.message}} — the latest character message to classify

Example Prompt Snippets

System Prompt (excerpt):

  • You classify character emotions and reply with exactly one label from the provided list.
  • Stay consistent with the character’s personality and the conversation context.
  • Do not explain your choice. Output only the label.

User Prompt (excerpt):

  • Analyze: {{char}}
  • Personality: {{character.personality}}
  • Text to classify: {{chat.message}}
  • Expression list: {{expression.list}}
  • Last expression: {{expression.last}}

Inference suggestions:

  • Temperature: 0.3–0.7 (lower favors consistent single‑label outputs)
  • Keep penalties modest to avoid forcing novel labels

Expected Model Output

  • Ideal: a single token or single word that exactly matches one item from {{expression.list}} (e.g., happy).
  • Acceptable: a short phrase where the first word matches a label (NarratrixAI will fuzzy‑match).
  • Fallback: if no match is found, NarratrixAI uses neutral.

Keep expression names short and distinct: neutral, happy, sad, angry, surprised, thinking.


Troubleshooting

  • The image doesn’t change

    • Confirm the character has an Expression Pack and names match your prompt list.
    • Check that Auto is on (for continuous updates) or click Generate after a new message.
  • The model returns sentences instead of a single label

    • Lower Response Length to ~60.
    • Tighten prompts to “Output only one label from the list—no explanation.”
    • Reduce Temperature.
    • Add a Prefill to adhere the model behavior.
  • Wrong emotions get picked

    • Make expression names more distinct (avoid similar labels like happy vs cheerful).
    • Include {{expression.last}} and instruct the model to avoid repeats unless strongly indicated.
  • Updated images aren’t appearing

    • If you changed files on disk, open the character, click Refresh in the Expression Pack, then try again.

Best Practices

  • Use consistent naming across characters so one template works for all.
  • Store a dedicated “Expressions” Chat Template separate from your main roleplay template. This avoids leaking long context into the classifier.

Clone this wiki locally