Emotions
Enable emotion detection to receive the character's emotional state during a conversation.Enable emotion detection to receive the character's emotional state alongside each response.
Enable at connect time
const client = useConvaiClient({
apiKey: '...',
characterId: '...',
enableEmotion: true,
});Subscribe to emotionChange
emotionChangeclient.on('emotionChange', (emotion) => {
if (emotion === null) {
// Conversation reset — clear any emotion UI
return;
}
console.log(emotion.emotion); // e.g. "Trust", "Grief", "Joy"
console.log(emotion.scale); // integer intensity: 1 (low) → 3 (high)
});React
Via state.emotion
state.emotionVanilla JS
Fine-tuning detection
"llm" config
"llm" configField
Type
Description
"nrclex" config
"nrclex" configField
Type
Default
Description
API reference
enableEmotion (connect option)
enableEmotion (connect option)Field
Type
Default
Description
emotionChange event
emotionChange eventField
Type
Description
state.emotion
state.emotionLast updated
Was this helpful?