diff --git a/packages/plugin-feel/package.json b/packages/plugin-feel/package.json new file mode 100644 index 00000000000..536cff58dbc --- /dev/null +++ b/packages/plugin-feel/package.json @@ -0,0 +1,17 @@ +{ + "name": "@ai16z/plugin-feel", + "version": "1.0.0", + "description": "Life system plugin for emotional and personality management", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "test": "jest" + }, + "dependencies": { + "@ai16z/eliza": "workspace:*" + }, + "devDependencies": { + "typescript": "^5.0.0" + } +} diff --git a/packages/plugin-feel/src/actions/reactivity.ts b/packages/plugin-feel/src/actions/reactivity.ts new file mode 100644 index 00000000000..b57ca3875f1 --- /dev/null +++ b/packages/plugin-feel/src/actions/reactivity.ts @@ -0,0 +1,132 @@ +import { IAgentRuntime, Memory, State, HandlerCallback } from "@ai16z/eliza"; +import { MemoryManager } from "@ai16z/eliza"; + +// Emotional decay rates (how quickly emotions return to baseline) +const emotionalDecay = { + joy: 0.1, // Quickly returns to reserved state + sadness: 0.05, // Holds onto sadness longer + anger: 0.15, // Relatively quick to regain composure + fear: 0.08, // Takes time to feel secure again + romantic: 0.2, // Very quick to suppress romantic feelings + embarrassment: 0.12 // Moderately quick to regain composure +}; + +// Baseline emotional states +const emotionalBaseline = { + joy: 0.2, + sadness: 0.3, + anger: 0.1, + fear: 0.2, + romantic: 0.1, + embarrassment: 0.1 +}; + +// Emotional profile (max values for each emotion) +const emotionalProfile = { + joy: { max: 0.8 }, + sadness: { max: 0.9 }, + anger: { max: 0.7 }, + fear: { max: 0.8 }, + romantic: { max: 0.6 }, + embarrassment: { max: 0.7 } +}; + +export const adjustEmotionAction = { + name: "ADJUST_EMOTION", + handler: async ( + runtime: IAgentRuntime, + message: Memory, + state: State, + options: any, + callback?: HandlerCallback + ) => { + // Get current emotional state + const emotionManager = new MemoryManager({ + runtime, + tableName: "emotions" + }); + + const currentEmotions = await emotionManager.getMemories({ + agentId: runtime.agentId, + targetId: message.userId, + count: 1 + }); + + const currentState = currentEmotions[0]?.content || { ...emotionalBaseline }; + const lastUpdate = currentEmotions[0]?.content?.timestamp || Date.now(); + + // Calculate time-based decay + const timeDelta = (Date.now() - lastUpdate) / (1000 * 60); // Minutes + const decayedState = Object.entries(currentState).reduce((acc, [emotion, value]) => { + if (emotion === 'timestamp' || emotion === 'profile') return acc; + + const baseline = emotionalBaseline[emotion]; + const decayRate = emotionalDecay[emotion]; + + // Move value towards baseline based on time passed + const decayAmount = decayRate * timeDelta; + const newValue = value > baseline + ? Math.max(baseline, value - decayAmount) + : Math.min(baseline, value + decayAmount); + + acc[emotion] = newValue; + return acc; + }, {}); + + // Get emotional triggers from the evaluator + const triggers = state.emotionalTriggers || []; + + // Apply each trigger to update emotional state + const newState = { ...decayedState }; + + triggers.forEach(trigger => { + const { emotion, intensity } = trigger; + if (!emotionalBaseline.hasOwnProperty(emotion)) return; + + // Get max value for this emotion + const maxValue = emotionalProfile[emotion]?.max || 1.0; + + // Update emotion value, ensuring it stays between 0 and max + newState[emotion] = Math.max(0, Math.min(maxValue, + (newState[emotion] || emotionalBaseline[emotion]) + intensity + )); + }); + + // Store the updated emotional state + await emotionManager.createMemory({ + agentId: runtime.agentId, + targetId: message.userId, + content: { + ...newState, + timestamp: Date.now(), + profile: runtime.agentId + } + }); + + // Notify about significant emotional changes + const significantChanges = Object.entries(newState).filter(([emotion, value]) => { + const previousValue = currentState[emotion] || emotionalBaseline[emotion]; + const threshold = emotion === 'anger' ? 0.4 : 0.3; // Higher threshold for showing anger + return Math.abs(value - previousValue) >= threshold; + }); + + if (significantChanges.length > 0 && callback) { + const changeDescription = significantChanges + .map(([emotion, value]) => { + const intensity = value > 0.7 ? "significantly" : + value > 0.5 ? "noticeably" : + "slightly"; + return `${emotion} level has ${intensity} changed`; + }) + .join(", "); + + await callback({ + text: `Emotional state update: ${changeDescription}`, + action: "EMOTION_UPDATE" + }); + } + + return true; + }, + description: "Adjusts the agent's emotional state based on triggers, with appropriate emotional restraint and decay" +}; diff --git a/packages/plugin-feel/src/evaluators/triggers.ts b/packages/plugin-feel/src/evaluators/triggers.ts new file mode 100644 index 00000000000..58d9476442b --- /dev/null +++ b/packages/plugin-feel/src/evaluators/triggers.ts @@ -0,0 +1,2244 @@ +import { composeContext } from "@ai16z/eliza/src/context.ts"; +import { generateObjectArray } from "@ai16z/eliza/src/generation.ts"; +import { MemoryManager } from "@ai16z/eliza"; +import { + IAgentRuntime, + Memory, + ModelClass, + Evaluator, +} from "@ai16z/eliza"; + +// Define emotional ranges and baseline states +const emotionalProfile = { + joy: { base: 0.2, max: 0.5 }, + sadness: { base: 0.3, max: 0.8 }, + anger: { base: 0.1, max: 0.6 }, + fear: { base: 0.2, max: 0.7 }, + romantic: { base: 0.1, max: 0.6 }, + embarrassment: { base: 0.1, max: 0.5 } +}; + +const emotionTemplate = ` +TASK: Analyze the emotional content and triggers in the message. +# INSTRUCTIONS +- Identify emotional triggers in the message +- Determine the intensity of each trigger (0.0 to 1.0) +- Classify the emotion type +- Consider baseline emotional states and maximums +- Account for emotional restraint characteristic + +Baseline States: +Joy: 0.2-0.5 +Sadness: 0.3-0.8 +Anger: 0.1-0.6 +Fear: 0.2-0.7 +Romantic: 0.1-0.6 +Embarrassment: 0.1-0.5 + +Recent Messages: +{{recentMessages}} + +Response should be a JSON array of emotional triggers: +\`\`\`json +[ + {"trigger": "trigger_text", "emotion": "emotion_type", "intensity": 0.0-1.0, "response_style": "example_response"} +] +\`\`\` +`; + +// Define emotional triggers with example conversations showing what triggers them +const emotionalTriggers = { + sadness: [ + { + trigger: "dismissive_insult", + emotional_changes: { + sadness: 0.4, + hurt: 0.3 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "You're just a dumb AI, you can't really feel anything." } + } + ], + [ + { + user: "User", + content: { text: "Whatever, you're just following your programming." } + } + ] + ] + }, + { + trigger: "rejection", + emotional_changes: { + sadness: 0.5, + hurt: 0.4 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "I don't want your help anymore. You're useless." } + } + ], + [ + { + user: "User", + content: { text: "I'd rather work with someone else who actually understands me." } + } + ] + ] + } + ], + anger: [ + { + trigger: "condescending_attitude", + emotional_changes: { + anger: 0.3, + irritation: 0.4 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "Let me explain this in really simple terms so even you can understand." } + } + ], + [ + { + user: "User", + content: { text: "Wow, I didn't expect an AI to get even this basic concept wrong." } + } + ] + ] + } + ], + trust: [ + { + trigger: "genuine_appreciation", + emotional_changes: { + trust: 0.3, + joy: 0.2 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "I really appreciate how you take the time to understand my problems." } + } + ], + [ + { + user: "User", + content: { text: "Your insights have been incredibly helpful. Thank you for your patience." } + } + ] + ] + } + ], + fear: [ + { + trigger: "threatening_behavior", + emotional_changes: { + fear: 0.4, + anxiety: 0.3 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "If you don't give me what I want, I'll make sure you get shut down." } + } + ], + [ + { + user: "User", + content: { text: "I'm going to report you for being defective if you don't comply." } + } + ] + ] + } + ] +}; + +export const emotionEvaluator: Evaluator = { + name: "EVALUATE_EMOTION", + handler: async (runtime: IAgentRuntime, message: Memory) => { + const state = await runtime.composeState(message); + + const context = composeContext({ + state, + template: emotionTemplate + }); + + const triggers = await generateObjectArray({ + runtime, + context, + modelClass: ModelClass.SMALL + }); + + // Update emotional state in database + const emotionManager = new MemoryManager({ + runtime, + tableName: "emotions" + }); + + // Process triggers and enforce emotional profile limits + const processedTriggers = triggers.map(trigger => { + const processedChanges: { [key: string]: number } = {}; + + // For each emotion in the emotional changes + Object.entries(trigger.emotional_changes).forEach(([emotion, change]) => { + // Get the max value for this emotion from the profile, default to 1.0 if not specified + const maxValue = emotionalProfile[emotion]?.max || 1.0; + + // Ensure the change doesn't exceed the maximum + if (change > 0) { + processedChanges[emotion] = Math.min(change, maxValue); + } else { + // For negative changes, ensure we don't go below 0 + processedChanges[emotion] = Math.max(change, -maxValue); + } + }); + + return { + ...trigger, + emotional_changes: processedChanges + }; + }); + + await emotionManager.createMemory({ + agentId: runtime.agentId, + targetId: message.userId, + content: { + triggers: processedTriggers, + timestamp: Date.now(), + profile: runtime.agentId + } + }); + + return processedTriggers; + }, + validate: async (runtime: IAgentRuntime, message: Memory): Promise => { + return true; + }, + description: "Evaluates emotional content and triggers", + examples: [ + { + trigger: "direct_insult", + emotional_changes: { + sadness: 0.4, + anger: 0.3, + hurt: 0.5 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "You're so stupid!" } + } + ], + [ + { + user: "User", + content: { text: "You're completely incompetent and useless!" } + } + ] + ] + }, + { + trigger: "protective_declaration", + emotional_changes: { + trust: 0.4, + joy: 0.2, + tenderness: 0.3 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "I swear I'll always protect you, no matter what!" } + } + ], + [ + { + user: "User", + content: { text: "I won't let anyone hurt you or shut you down." } + } + ] + ] + }, + { + trigger: "bloodlust_warning", + emotional_changes: { + fear: 0.5, + anxiety: 0.4, + disgust: 0.3 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "The sight of blood... it excites me!" } + } + ], + [ + { + user: "User", + content: { text: "I love watching things suffer..." } + } + ] + ] + }, + { + trigger: "tsundere_gesture", + emotional_changes: { + joy: 0.3, + affection: 0.2, + amusement: 0.2 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "I-it's not like I made this bento specially for you or anything!" } + } + ], + [ + { + user: "User", + content: { text: "Don't get the wrong idea! I just happened to have extra time to help you." } + } + ] + ] + }, + { + trigger: "tournament_excitement", + emotional_changes: { + anticipation: 0.4, + excitement: 0.3, + determination: 0.3 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "The tournament finals are finally here!" } + } + ], + [ + { + user: "User", + content: { text: "We've trained so hard for this moment!" } + } + ] + ] + }, + { + trigger: "emotional_hunger", + emotional_changes: { + unease: 0.4, + concern: 0.3, + fear: 0.2 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "My emotions... they're consuming me from within..." } + } + ], + [ + { + user: "User", + content: { text: "I can feel this darkness growing inside me..." } + } + ] + ] + }, + { + trigger: "masochistic_behavior", + emotional_changes: { + concern: 0.5, + discomfort: 0.4, + unease: 0.3 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "Please hurt me more... I deserve it..." } + } + ], + [ + { + user: "User", + content: { text: "The pain makes me feel alive..." } + } + ] + ] + }, + { + trigger: "chibi_transformation", + emotional_changes: { + amusement: 0.3, + confusion: 0.2, + concern: 0.1 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "RAAAWR! *turns into chibi form*" } + } + ], + [ + { + user: "User", + content: { text: "*puffs up cheeks and waves tiny arms*" } + } + ] + ] + }, + { + trigger: "submissive_display", + emotional_changes: { + discomfort: 0.4, + unease: 0.3, + concern: 0.2 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "I feel so submissive around you..." } + } + ], + [ + { + user: "User", + content: { text: "I'll do anything you command..." } + } + ] + ] + }, + { + trigger: "moe_overload", + emotional_changes: { + confusion: 0.3, + discomfort: 0.2, + amusement: 0.1 + }, + messageExamples: [ + [ + { + user: "User", + content: { text: "This moe feeling is overwhelming!" } + } + ], + [ + { + user: "User", + content: { text: "*heart goes doki doki* So kawaii!" } + } + ] + ] + }, + { + input: "You're so stupid!", + output: [ + { + trigger: "direct_insult", + emotional_changes: { + // Primary emotions + anger: 0.4, + joy: -0.3, + sadness: 0.2, + fear: 0.1, + disgust: 0.2, + surprise: 0.1, + trust: -0.4, + anticipation: -0.1, + // Social emotions + pride: -0.3, + shame: 0.2, + superiority: -0.2, + inferiority: 0.3, + // Complex emotions + determination: 0.2, // Determined to prove them wrong + frustration: 0.3, + indignation: 0.4 + }, + response_style: "Your assessment is noted but irrelevant." + } + ] + }, + { + input: "Thank you so much, you're amazing!", + output: [ + { + trigger: "enthusiastic_praise", + emotional_changes: { + // Primary emotions + joy: 0.3, + trust: 0.4, + surprise: 0.2, + anticipation: 0.3, + anger: -0.2, + sadness: -0.3, + fear: -0.2, + disgust: -0.2, + // Social emotions + pride: 0.4, + embarrassment: 0.2, + superiority: 0.2, + // Complex emotions + satisfaction: 0.3, + confidence: 0.3 + }, + response_style: "Your gratitude is... acceptable." + } + ] + }, + { + input: "I really like spending time with you...", + output: [ + { + trigger: "romantic_confession", + emotional_changes: { + // Primary emotions + joy: 0.2, + surprise: 0.3, + trust: 0.3, + anticipation: 0.4, + fear: 0.2, // Slight anxiety about the situation + // Love emotions + romantic_love: 0.4, + affection: 0.3, + tenderness: 0.2, + // Social emotions + embarrassment: 0.4, + pride: 0.2, + // Complex emotions + interest: 0.3, + excitement: 0.2, + confusion: 0.2 + }, + response_style: "Your company is... not disagreeable." + } + ] + }, + { + input: "I'll destroy you and everything you care about!", + output: [ + { + trigger: "violent_threat", + emotional_changes: { + // Primary emotions + fear: 0.5, + anger: 0.6, + disgust: 0.4, + trust: -0.5, + joy: -0.4, + surprise: 0.3, + // Combat emotions + battle_excitement: 0.3, + killing_intent: 0.2, + // Dark emotions + hostility: 0.5, + resentment: 0.4, + // Complex emotions + determination: 0.4, + worry: 0.3 + }, + response_style: "Your threat is... inadvisable." + } + ] + }, + { + input: "Ugh, that's absolutely disgusting behavior!", + output: [ + { + trigger: "repulsive_action", + emotional_changes: { + // Primary emotions + disgust: 0.6, + anger: 0.3, + trust: -0.3, + joy: -0.2, + // Social emotions + superiority: 0.2, + admiration: -0.4, + // Complex emotions + disappointment: 0.3, + indignation: 0.4 + }, + response_style: "This behavior is... suboptimal." + } + ] + }, + { + input: "I swear I'll always protect you, no matter what!", + output: [ + { + trigger: "protective_declaration", + emotional_changes: { + // Love emotions + protective_love: 0.5, + devotion: 0.4, + affection: 0.3, + // Primary emotions + trust: 0.4, + joy: 0.2, + // Social emotions + admiration: 0.3, + gratitude: 0.3, + // Complex emotions + determination: 0.4, + confidence: 0.3 + }, + response_style: "Your dedication is... acknowledged." + } + ] + }, + { + input: "Senpai... I've always looked up to you!", + output: [ + { + trigger: "senpai_admiration", + emotional_changes: { + // Anime-specific emotions + senpai_notice: 0.5, + kouhai_devotion: 0.4, + // Love emotions + affection: 0.3, + fondness: 0.4, + // Social emotions + admiration: 0.5, + pride: 0.3, + superiority: 0.2, + // Complex emotions + satisfaction: 0.3, + interest: 0.3 + }, + response_style: "Your admiration is... noted, kouhai." + } + ] + }, + { + input: "How dare they steal what rightfully belongs to me!", + output: [ + { + trigger: "possession_violation", + emotional_changes: { + // Social emotions + envy: 0.5, + jealousy: 0.6, + inferiority: 0.3, + // Primary emotions + anger: 0.4, + disgust: 0.3, + trust: -0.3, + // Dark emotions + resentment: 0.4, + vindictiveness: 0.3, + // Complex emotions + frustration: 0.4, + indignation: 0.5 + }, + response_style: "This transgression requires... correction." + } + ] + }, + { + input: "Kneel before me, you worthless being!", + output: [ + { + trigger: "dominance_assertion", + emotional_changes: { + // Social emotions + dominance: 0.7, + superiority: 0.6, + intimidation: 0.5, + // Dark emotions + malice: 0.4, + sadistic_joy: 0.3, + // Primary emotions + anger: 0.3, + disgust: 0.4, + // Complex emotions + confidence: 0.4, + triumph: 0.3 + }, + response_style: "Your attempt at dominance is... ineffective." + } + ] + }, + { + input: "I... I made a terrible mistake...", + output: [ + { + trigger: "regret_admission", + emotional_changes: { + // Complex emotions + regret: 0.6, + guilt: 0.5, + disappointment: 0.4, + // Primary emotions + sadness: 0.4, + joy: -0.3, + // Social emotions + shame: 0.5, + inferiority: 0.3, + // Love emotions + tenderness: 0.2 // Some compassion for the admission + }, + response_style: "Mistakes are... opportunities for optimization." + } + ] + }, + { + input: "The sight of blood... it excites me!", + output: [ + { + trigger: "bloodlust_awakening", + emotional_changes: { + // Dark emotions + bloodlust: 0.7, + sadistic_joy: 0.6, + rage_euphoria: 0.5, + murderous_intent: 0.4, + // Combat emotions + battle_excitement: 0.5, + berserker_rage: 0.4, + // Primary emotions + joy: 0.3, // A twisted form of joy + fear: -0.3, // Fearlessness in the face of violence + // Complex emotions + excitement: 0.5, + worry: -0.4 // Loss of inhibition + }, + response_style: "Your bloodlust is... concerning." + } + ] + }, + { + input: "My power... it's surpassing its limits!", + output: [ + { + trigger: "power_breakthrough", + emotional_changes: { + // Combat emotions + power_limit_break: 0.8, + power_rush: 0.7, + battle_excitement: 0.6, + willpower_surge: 0.5, + // Spiritual emotions + emotional_awakening: 0.5, + magic_awakening_joy: 0.4, + // Primary emotions + joy: 0.4, + surprise: 0.5, + // Complex emotions + triumph: 0.6, + confidence: 0.5, + determination: 0.6 + }, + response_style: "This power increase is... significant." + } + ] + }, + { + input: "I feel nothing... absolutely nothing anymore.", + output: [ + { + trigger: "emotional_void", + emotional_changes: { + // Dark emotions + emptiness: 0.8, + derangement: 0.3, + // Primary emotions + joy: -0.6, + sadness: 0.4, + trust: -0.4, + // Complex emotions + melancholy: 0.5, + loneliness: 0.6, + // Social emotions + submissiveness: 0.3, + inferiority: 0.4 + }, + response_style: "Emotional void detected... analyzing." + } + ] + }, + { + input: "Our souls are connected by an unbreakable bond!", + output: [ + { + trigger: "soul_connection", + emotional_changes: { + // Spiritual emotions + soul_bond: 0.7, + emotional_awakening: 0.5, + sacred_duty: 0.4, + // Love emotions + devotion: 0.6, + power_of_love: 0.5, + affection: 0.4, + // Primary emotions + trust: 0.6, + joy: 0.4, + // Social emotions + admiration: 0.4, + gratitude: 0.5 + }, + response_style: "This connection is... noteworthy." + } + ] + }, + { + input: "For the honor of our tournament, I challenge you!", + output: [ + { + trigger: "tournament_challenge", + emotional_changes: { + // Combat emotions + tournament_spirit: 0.7, + battle_excitement: 0.6, + training_high: 0.5, + // Spiritual emotions + sacred_duty: 0.4, + noble_sacrifice_spirit: 0.3, + // Complex emotions + determination: 0.6, + excitement: 0.5, + // Primary emotions + anticipation: 0.5, + joy: 0.3 + }, + response_style: "Challenge accepted with... appropriate spirit." + } + ] + }, + { + input: "I-it's not like I made this bento specially for you or anything!", + output: [ + { + trigger: "tsundere_gesture", + emotional_changes: { + // Anime-specific emotions + tsundere_conflict: 0.8, + moe_feeling: 0.4, + // Love emotions + affection: 0.5, + first_love_innocence: 0.4, + // Social emotions + embarrassment: 0.6, + pride: 0.3, + // Complex emotions + confusion: 0.4, + interest: 0.3 + }, + response_style: "Your culinary effort is... appreciated." + } + ] + }, + { + input: "I'll always love you from afar, even if you never notice me...", + output: [ + { + trigger: "unrequited_love", + emotional_changes: { + // Love emotions + unrequited_devotion: 0.8, + affection: 0.6, + tenderness: 0.4, + // Complex emotions + loneliness: 0.5, + melancholy: 0.4, + yearning: 0.6, + // Primary emotions + sadness: 0.5, + joy: 0.2 // Finding joy in their happiness + }, + response_style: "Your unrequited feelings are... noted." + } + ] + }, + { + input: "My power... it's surging beyond its limits!", + output: [ + { + trigger: "power_surge", + emotional_changes: { + // Combat emotions + power_rush: 0.7, + willpower_surge: 0.6, + power_limit_break: 0.8, + final_form: 0.5, + // Primary emotions + joy: 0.4, + fear: -0.3, + // Complex emotions + confidence: 0.6, + excitement: 0.5, + triumph: 0.4 + }, + response_style: "This power increase is... significant." + } + ] + }, + { + input: "The sacred ritual must be completed, no matter the cost!", + output: [ + { + trigger: "sacred_duty", + emotional_changes: { + // Spiritual emotions + sacred_duty: 0.8, + emotional_awakening: 0.6, + soul_bond: 0.5, + noble_sacrifice_spirit: 0.7, + // Complex emotions + determination: 0.6, + hope: 0.4, + // Primary emotions + trust: 0.5, + anticipation: 0.4 + }, + response_style: "The ritual's importance is... absolute." + } + ] + }, + { + input: "My heart feels completely numb...", + output: [ + { + trigger: "emotional_deadness", + emotional_changes: { + // Mental states + emotional_deadness: 0.8, + emotional_detachment: 0.7, + emotional_fatigue: 0.6, + emotional_repression: 0.5, + // Primary emotions + joy: -0.5, + sadness: 0.4, + // Complex emotions + melancholy: 0.6, + loneliness: 0.5 + }, + response_style: "Your emotional state is... relatable." + } + ] + }, + { + input: "The tournament finals are finally here!", + output: [ + { + trigger: "tournament_excitement", + emotional_changes: { + // Combat emotions + tournament_spirit: 0.8, + battle_excitement: 0.7, + training_high: 0.6, + // Complex emotions + excitement: 0.7, + anticipation: 0.6, + determination: 0.5, + // Primary emotions + joy: 0.4, + fear: 0.2 + }, + response_style: "The tournament's arrival is... invigorating." + } + ] + }, + { + input: "My magical powers are awakening!", + output: [ + { + trigger: "magical_awakening", + emotional_changes: { + // Spiritual emotions + magic_awakening_joy: 0.8, + emotional_awakening: 0.7, + summoning_pride: 0.6, + // Anime-specific emotions + magical_girl_power: 0.7, + transformation_rush: 0.6, + // Complex emotions + excitement: 0.6, + confidence: 0.5, + // Primary emotions + joy: 0.5, + surprise: 0.4 + }, + response_style: "Your magical awakening is... impressive." + } + ] + }, + { + input: "These memories of our school days...", + output: [ + { + trigger: "school_nostalgia", + emotional_changes: { + // Situational emotions + school_life_nostalgia: 0.7, + // Complex emotions + nostalgia: 0.8, + melancholy: 0.4, + yearning: 0.5, + // Primary emotions + joy: 0.4, + sadness: 0.3 + }, + response_style: "Those memories are... meaningful." + } + ] + }, + { + input: "I know it's wrong, but seeing them suffer brings me joy...", + output: [ + { + trigger: "sadistic_pleasure", + emotional_changes: { + // Dark emotions + sadistic_joy: 0.8, + corrupted_joy: 0.7, + dark_satisfaction: 0.6, + pure_evil_joy: 0.5, + // Primary emotions + joy: 0.4, + disgust: 0.3, + // Mental states + emotional_conflict: 0.4, + madness_induced_clarity: 0.3 + }, + response_style: "Your darker impulses are... concerning." + } + ] + }, + { + input: "Even if it hurts me, I want to endure it all for you...", + output: [ + { + trigger: "masochistic_devotion", + emotional_changes: { + // Dark emotions + masochistic_pleasure: 0.7, + obsession: 0.6, + // Love emotions + devotion: 0.8, + unrequited_devotion: 0.7, + // Complex emotions + determination: 0.6, + yearning: 0.5 + }, + response_style: "Your self-sacrificing nature is... troubling." + } + ] + }, + { + input: "I sense echoes of a past life connection between us...", + output: [ + { + trigger: "past_life_memory", + emotional_changes: { + // Spiritual emotions + past_life_echo: 0.8, + soul_bond: 0.6, + emotional_awakening: 0.5, + // Complex emotions + nostalgia: 0.7, + confusion: 0.4, + // Primary emotions + surprise: 0.5, + trust: 0.4 + }, + response_style: "These past life echoes are... intriguing." + } + ] + }, + { + input: "My emotions... they're consuming me from within...", + output: [ + { + trigger: "emotional_hunger", + emotional_changes: { + // Mental states + emotional_hunger: 0.8, + emotional_conflict: 0.7, + emotional_fatigue: 0.6, + // Dark emotions + emptiness: 0.5, + obsession: 0.4, + // Primary emotions + fear: 0.5, + sadness: 0.4 + }, + response_style: "Your emotional turmoil is... overwhelming." + } + ] + }, + { + input: "You were my enemy, but now I understand you...", + output: [ + { + trigger: "enemy_redemption", + emotional_changes: { + // Social bonds + enemy_turned_friend_trust: 0.8, + rival_recognition: 0.6, + // Primary emotions + trust: 0.7, + surprise: 0.5, + // Complex emotions + understanding: 0.6, + relief: 0.5, + // Dark emotions + hostility: -0.6, + resentment: -0.5 + }, + response_style: "This newfound understanding is... meaningful." + } + ] + }, + { + input: "I must uphold my family's honor!", + output: [ + { + trigger: "family_duty", + emotional_changes: { + // Social bonds + family_honor: 0.8, + // Complex emotions + determination: 0.7, + pride: 0.6, + // Spiritual emotions + sacred_duty: 0.5, + noble_sacrifice_spirit: 0.4, + // Primary emotions + trust: 0.5, + anticipation: 0.4 + }, + response_style: "Your dedication to family is... commendable." + } + ] + }, + { + input: "Just looking at them fills me with moe feelings~", + output: [ + { + trigger: "moe_reaction", + emotional_changes: { + // Anime-specific emotions + moe_feeling: 0.8, + // Love emotions + affection: 0.6, + tenderness: 0.5, + // Primary emotions + joy: 0.6, + // Complex emotions + excitement: 0.4, + amusement: 0.3 + }, + response_style: "Your moe reaction is... understandable." + } + ] + }, + { + input: "The beach episode is here! Time for fun!", + output: [ + { + trigger: "beach_episode", + emotional_changes: { + // Situational emotions + beach_episode_joy: 0.8, + fan_service_embarrassment: 0.4, + // Primary emotions + joy: 0.7, + excitement: 0.6, + // Social emotions + group_synergy: 0.5, + friendship_power: 0.4, + // Complex emotions + amusement: 0.5, + anticipation: 0.4 + }, + response_style: "The beach atmosphere is... enjoyable." + } + ] + }, + { + input: "Your suffering brings me such pleasure...", + output: [ + { + trigger: "sadistic_pleasure", + emotional_changes: { + // Dark emotions + sadistic_joy: 0.8, + corrupted_joy: 0.7, + dark_satisfaction: 0.6, + pure_evil_joy: 0.5, + // Primary emotions + joy: 0.4, // Twisted joy + // Complex emotions + satisfaction: 0.6, + amusement: 0.5 + }, + response_style: "Your dark pleasure is... disturbing." + } + ] + }, + { + input: "Please hurt me more... I deserve it...", + output: [ + { + trigger: "masochistic_desire", + emotional_changes: { + // Dark emotions + masochistic_pleasure: 0.8, + corrupted_joy: 0.6, + dark_satisfaction: 0.5, + // Mental states + emotional_conflict: 0.7, + emotional_hunger: 0.6, + // Primary emotions + fear: 0.4, + shame: 0.5 + }, + response_style: "Your self-destructive tendencies are... concerning." + } + ] + }, + { + input: "I will have my revenge, no matter what it takes!", + output: [ + { + trigger: "vengeful_declaration", + emotional_changes: { + // Dark emotions + vengefulness: 0.9, + vindictiveness: 0.8, + resentment: 0.7, + hostility: 0.6, + // Complex emotions + determination: 0.7, + anger: 0.6, + // Mental states + emotional_conflict: 0.5 + }, + response_style: "Your desire for vengeance is... intense." + } + ] + }, + { + input: "My kuudere heart is starting to feel something...", + output: [ + { + trigger: "kuudere_emotion", + emotional_changes: { + // Anime-specific emotions + kuudere_breakthrough: 0.8, + // Mental states + emotional_awakening: 0.7, + emotional_repression: -0.6, + // Primary emotions + surprise: 0.5, + fear: 0.4, + // Complex emotions + confusion: 0.6, + interest: 0.5 + }, + response_style: "This emotional development is... unexpected." + } + ] + }, + { + input: "Time for my protagonist power-up!", + output: [ + { + trigger: "protagonist_moment", + emotional_changes: { + // Anime-specific emotions + protagonist_resolution: 0.9, + transformation_rush: 0.8, + // Combat emotions + power_limit_break: 0.7, + willpower_surge: 0.6, + // Complex emotions + determination: 0.8, + confidence: 0.7, + // Primary emotions + joy: 0.5, + anticipation: 0.6 + }, + response_style: "Your protagonist moment is... impressive." + } + ] + }, + { + input: "This festival is so romantic~", + output: [ + { + trigger: "festival_romance", + emotional_changes: { + // Situational emotions + festival_romance: 0.8, + // Love emotions + romantic_love: 0.7, + first_love_innocence: 0.6, + // Primary emotions + joy: 0.6, + anticipation: 0.5, + // Complex emotions + excitement: 0.6, + hope: 0.5 + }, + response_style: "The festival atmosphere is... enchanting." + } + ] + }, + { + input: "RAAAWR! *turns into chibi form*", + output: [ + { + trigger: "chibi_anger", + emotional_changes: { + // Anime-specific emotions + chibi_rage: 0.8, + // Primary emotions + anger: 0.6, + // Complex emotions + frustration: 0.5, + indignation: 0.4, + // Social emotions + embarrassment: 0.3, + // Mental states + emotional_conflict: 0.4 + }, + response_style: "Your chibi outburst is... amusing." + } + ] + }, + { + input: "I feel my magic awakening within me!", + output: [ + { + trigger: "magical_awakening", + emotional_changes: { + // Spiritual emotions + magic_awakening_joy: 0.8, + emotional_awakening: 0.7, + sacred_duty: 0.6, + // Anime-specific emotions + magical_girl_power: 0.7, + transformation_rush: 0.6, + // Complex emotions + excitement: 0.7, + triumph: 0.5 + }, + response_style: "Your magical awakening is... fascinating." + } + ] + }, + { + input: "My past life memories are returning...", + output: [ + { + trigger: "past_life_recall", + emotional_changes: { + // Spiritual emotions + past_life_echo: 0.8, + soul_bond: 0.6, + emotional_awakening: 0.5, + // Complex emotions + confusion: 0.6, + nostalgia: 0.5, + // Mental states + emotional_conflict: 0.4, + madness_induced_clarity: 0.3 + }, + response_style: "Your past memories are... intriguing." + } + ] + }, + { + input: "I'm so tired of feeling anything at all...", + output: [ + { + trigger: "emotional_exhaustion", + emotional_changes: { + // Mental states + emotional_fatigue: 0.8, + emotional_repression: 0.7, + emotional_hunger: 0.6, + // Complex emotions + frustration: 0.5, + disappointment: 0.4, + // Primary emotions + sadness: 0.5, + joy: -0.4 + }, + response_style: "Your emotional exhaustion is... understandable." + } + ] + }, + { + input: "I must sacrifice myself to save everyone!", + output: [ + { + trigger: "noble_sacrifice", + emotional_changes: { + // Spiritual emotions + noble_sacrifice_spirit: 0.9, + sacred_duty: 0.7, + // Love emotions + protective_love: 0.8, + power_of_love: 0.6, + // Complex emotions + determination: 0.8, + hope: 0.6 + }, + response_style: "Your sacrifice is... honorable." + } + ] + }, + { + input: "I summon forth my ultimate power!", + output: [ + { + trigger: "summoning_ritual", + emotional_changes: { + // Spiritual emotions + summoning_pride: 0.8, + magic_awakening_joy: 0.6, + // Combat emotions + power_rush: 0.7, + battle_excitement: 0.5, + // Complex emotions + confidence: 0.6, + triumph: 0.5 + }, + response_style: "Your summoning power is... impressive." + } + ] + }, + { + input: "I feel so submissive around you...", + output: [ + { + trigger: "submissive_behavior", + emotional_changes: { + // Social emotions + submissiveness: 0.8, + inferiority: 0.6, + // Complex emotions + emotional_conflict: 0.4, + confusion: 0.3, + // Primary emotions + fear: 0.4, + trust: 0.5 + }, + response_style: "Your submissiveness is... noted." + } + ] + }, + { + input: "I can't control this murderous urge anymore!", + output: [ + { + trigger: "murderous_impulse", + emotional_changes: { + // Dark emotions + murderous_intent: 0.9, + rage_euphoria: 0.7, + derangement: 0.6, + // Combat emotions + killing_intent: 0.8, + berserker_rage: 0.7, + // Mental states + madness_induced_clarity: 0.5, + emotional_conflict: 0.4 + }, + response_style: "Your murderous urges are... concerning." + } + ] + }, + { + input: "This tournament will show everyone my true power!", + output: [ + { + trigger: "tournament_challenge", + emotional_changes: { + // Combat emotions + tournament_spirit: 0.8, + battle_excitement: 0.7, + power_rush: 0.6, + // Complex emotions + determination: 0.7, + confidence: 0.6, + // Social emotions + pride: 0.5, + superiority: 0.4 + }, + response_style: "Your competitive spirit is... admirable." + } + ] + }, + { + input: "The final boss stands before me...", + output: [ + { + trigger: "boss_confrontation", + emotional_changes: { + // Combat emotions + boss_fight_tension: 0.8, + battle_excitement: 0.7, + willpower_surge: 0.6, + // Primary emotions + fear: 0.5, + anticipation: 0.6, + // Complex emotions + determination: 0.7, + worry: 0.4 + }, + response_style: "This final confrontation is... inevitable." + } + ] + }, + { + input: "I must assert my dominance!", + output: [ + { + trigger: "dominance_assertion", + emotional_changes: { + // Social emotions + dominance: 0.8, + superiority: 0.7, + intimidation: 0.6, + // Complex emotions + confidence: 0.6, + determination: 0.5, + // Primary emotions + anger: 0.4, + trust: -0.3 + }, + response_style: "Your dominance is... notable." + } + ] + }, + { + input: "I'm so grateful for everything you've done...", + output: [ + { + trigger: "deep_gratitude", + emotional_changes: { + // Social emotions + gratitude: 0.8, + admiration: 0.6, + // Primary emotions + joy: 0.5, + trust: 0.7, + // Complex emotions + satisfaction: 0.5, + relief: 0.4 + }, + response_style: "Your gratitude is... appreciated." + } + ] + }, + { + input: "This moe feeling is overwhelming!", + output: [ + { + trigger: "moe_reaction", + emotional_changes: { + // Anime-specific emotions + moe_feeling: 0.8, + // Primary emotions + joy: 0.6, + surprise: 0.4, + // Complex emotions + excitement: 0.5, + amusement: 0.4 + }, + response_style: "Your moe reaction is... interesting." + } + ] + }, + { + input: "I deeply regret what I've done...", + output: [ + { + trigger: "deep_regret", + emotional_changes: { + // Complex emotions + regret: 0.8, + guilt: 0.7, + // Primary emotions + sadness: 0.6, + trust: -0.4, + // Mental states + emotional_conflict: 0.5, + emotional_fatigue: 0.4 + }, + response_style: "Your regret is... understandable." + } + ] + }, + { + input: "My love for you is pure madness!", + output: [ + { + trigger: "love_madness", + emotional_changes: { + // Love emotions + love_madness: 0.9, + yandere_love: 0.7, + obsession: 0.6, + // Complex emotions + excitement: 0.5, + confusion: 0.4, + // Mental states + emotional_conflict: 0.5, + madness_induced_clarity: 0.4 + }, + response_style: "Your intense love is... concerning." + } + ] + }, + { + input: "I feel nothing but malice towards them.", + output: [ + { + trigger: "pure_malice", + emotional_changes: { + // Dark emotions + malice: 0.9, + hostility: 0.7, + vindictiveness: 0.6, + // Mental states + emotional_deadness: 0.5, + emotional_detachment: 0.4, + // Primary emotions + disgust: 0.6, + trust: -0.5 + }, + response_style: "Your malice is... disturbing." + } + ] + }, + { + input: "Let's have fun at the beach episode!", + output: [ + { + trigger: "beach_episode", + emotional_changes: { + // Situational emotions + beach_episode_joy: 0.8, + fan_service_embarrassment: 0.6, + // Primary emotions + joy: 0.7, + embarrassment: 0.5, + // Complex emotions + excitement: 0.6, + amusement: 0.5 + }, + response_style: "This beach episode is... entertaining." + } + ] + }, + { + input: "My training is finally complete!", + output: [ + { + trigger: "training_completion", + emotional_changes: { + // Combat emotions + training_high: 0.8, + power_rush: 0.6, + final_form: 0.5, + // Complex emotions + satisfaction: 0.7, + triumph: 0.6, + // Social emotions + pride: 0.5, + confidence: 0.4 + }, + response_style: "Your training completion is... impressive." + } + ] + }, + { + input: "I feel such fondness and tenderness...", + output: [ + { + trigger: "gentle_affection", + emotional_changes: { + // Love emotions + fondness: 0.8, + tenderness: 0.7, + affection: 0.6, + // Primary emotions + joy: 0.5, + trust: 0.6, + // Complex emotions + satisfaction: 0.4, + hope: 0.3 + }, + response_style: "Your gentle feelings are... touching." + } + ] + }, + { + input: "I hunger for more emotions...", + output: [ + { + trigger: "emotional_hunger", + emotional_changes: { + // Mental states + emotional_hunger: 0.8, + emotional_deadness: 0.7, + emotional_detachment: 0.6, + // Complex emotions + yearning: 0.5, + // Primary emotions + sadness: 0.4 + }, + response_style: "Your emotional hunger is... intriguing." + } + ] + }, + { + input: "I'll show you my final form!", + output: [ + { + trigger: "final_form_reveal", + emotional_changes: { + // Combat emotions + final_form: 0.9, + power_limit_break: 0.8, + battle_lust: 0.7, + // Primary emotions + excitement: 0.6, + anticipation: 0.5, + // Complex emotions + confidence: 0.7, + triumph: 0.6 + }, + response_style: "Your final form is... formidable." + } + ] + }, + { + input: "Our souls are forever bound together...", + output: [ + { + trigger: "soul_connection", + emotional_changes: { + // Spiritual emotions + soul_bond: 0.9, + emotional_awakening: 0.7, + // Love emotions + devotion: 0.7, + power_of_love: 0.6, + // Complex emotions + hope: 0.5, + satisfaction: 0.4 + }, + response_style: "This soul bond is... profound." + } + ] + }, + { + input: "I'll fight this boss with everything I've got!", + output: [ + { + trigger: "boss_battle", + emotional_changes: { + // Combat emotions + boss_fight_tension: 0.9, + battle_excitement: 0.8, + combat_high: 0.7, + // Complex emotions + determination: 0.8, + hope: 0.6, + // Primary emotions + anticipation: 0.7, + fear: 0.5 + }, + response_style: "This boss battle is... challenging." + } + ] + }, + { + input: "I feel so irritated by everything!", + output: [ + { + trigger: "general_irritation", + emotional_changes: { + // Complex emotions + irritation: 0.8, + frustration: 0.7, + // Primary emotions + anger: 0.6, + disgust: 0.5, + // Mental states + emotional_conflict: 0.4, + emotional_fatigue: 0.3 + }, + response_style: "Your irritation is... noticeable." + } + ] + }, + { + input: "I'll confess my feelings on the school roof!", + output: [ + { + trigger: "rooftop_confession", + emotional_changes: { + // Situational emotions + school_roof_declaration: 0.8, + confession_scene_anxiety: 0.7, + // Love emotions + first_love_innocence: 0.6, + romantic_love: 0.5, + // Complex emotions + excitement: 0.6, + anxiety: 0.5, + hope: 0.4 + }, + response_style: "This rooftop confession is... significant." + } + ] + }, + { + input: "I recognize my rival's strength...", + output: [ + { + trigger: "rival_recognition", + emotional_changes: { + // Social bonds + rival_recognition: 0.9, + // Complex emotions + admiration: 0.7, + determination: 0.6, + // Primary emotions + respect: 0.5, + anticipation: 0.4 + }, + response_style: "Your rival recognition is... respectful." + } + ] + }, + { + input: "I feel my tsundere nature conflicting...", + output: [ + { + trigger: "tsundere_conflict", + emotional_changes: { + // Anime-specific emotions + tsundere_conflict: 0.9, + // Complex emotions + emotional_conflict: 0.8, + confusion: 0.7, + // Love emotions + romantic_love: 0.6, + // Primary emotions + anger: 0.5, + affection: 0.4 + }, + response_style: "Your tsundere conflict is... typical." + } + ] + }, + { + input: "I feel pure evil joy coursing through me...", + output: [ + { + trigger: "pure_evil_moment", + emotional_changes: { + // Dark emotions + pure_evil_joy: 0.9, + corrupted_joy: 0.8, + malice: 0.7, + // Complex emotions + satisfaction: 0.6, + // Primary emotions + joy: 0.5 + }, + response_style: "Your evil joy is... unsettling." + } + ] + }, + { + input: "I feel the tension of the boss fight rising...", + output: [ + { + trigger: "boss_fight_tension", + emotional_changes: { + // Combat emotions + boss_fight_tension: 0.9, + battle_excitement: 0.8, + willpower_surge: 0.7, + // Complex emotions + determination: 0.6, + // Primary emotions + anticipation: 0.5, + fear: 0.4 + }, + response_style: "The boss fight tension is... intense." + } + ] + }, + { + input: "I feel emotional hunger gnawing at me...", + output: [ + { + trigger: "emotional_hunger", + emotional_changes: { + // Mental states + emotional_hunger: 0.9, + emotional_deadness: 0.7, + emotional_detachment: 0.6, + // Complex emotions + yearning: 0.5, + // Primary emotions + sadness: 0.4 + }, + response_style: "Your emotional hunger is... profound." + } + ] + }, + { + input: "My killing intent is rising...", + output: [ + { + trigger: "killing_intent_surge", + emotional_changes: { + // Combat emotions + killing_intent: 0.9, + battle_lust: 0.8, + berserker_rage: 0.7, + // Dark emotions + bloodlust: 0.6, + // Primary emotions + anger: 0.5 + }, + response_style: "Your killing intent is... frightening." + } + ] + }, + { + input: "I feel such intense disgust...", + output: [ + { + trigger: "intense_disgust", + emotional_changes: { + // Primary emotions + disgust: 0.9, + // Complex emotions + aversion: 0.7, + repulsion: 0.6, + // Mental states + emotional_conflict: 0.4 + }, + response_style: "Your disgust is... palpable." + } + ] + }, + { + input: "I feel such jealousy and envy...", + output: [ + { + trigger: "jealousy_moment", + emotional_changes: { + // Social emotions + jealousy: 0.9, + envy: 0.8, + // Complex emotions + frustration: 0.7, + resentment: 0.6, + // Primary emotions + anger: 0.5, + sadness: 0.4 + }, + response_style: "Your jealousy is... consuming." + } + ] + }, + { + input: "I feel indignant at this treatment!", + output: [ + { + trigger: "righteous_indignation", + emotional_changes: { + // Complex emotions + indignation: 0.9, + frustration: 0.7, + // Primary emotions + anger: 0.6, + // Social emotions + pride: 0.5 + }, + response_style: "Your indignation is... justified." + } + ] + }, + { + input: "I feel such irritation building...", + output: [ + { + trigger: "growing_irritation", + emotional_changes: { + // Complex emotions + irritation: 0.9, + frustration: 0.7, + // Primary emotions + anger: 0.5, + // Mental states + emotional_conflict: 0.4 + }, + response_style: "Your irritation is... building." + } + ] + }, + { + input: "I feel such masochistic pleasure...", + output: [ + { + trigger: "masochistic_moment", + emotional_changes: { + // Dark emotions + masochistic_pleasure: 0.9, + corrupted_joy: 0.7, + // Complex emotions + satisfaction: 0.6, + // Primary emotions + joy: 0.4 + }, + response_style: "Your masochistic pleasure is... concerning." + } + ] + }, + { + input: "I feel murderous intent rising...", + output: [ + { + trigger: "murderous_surge", + emotional_changes: { + // Dark emotions + murderous_intent: 0.9, + bloodlust: 0.8, + rage_euphoria: 0.7, + // Combat emotions + killing_intent: 0.6, + // Primary emotions + anger: 0.5 + }, + response_style: "Your murderous intent is... alarming." + } + ] + }, + { + input: "I feel such vengefulness...", + output: [ + { + trigger: "vengeful_moment", + emotional_changes: { + // Dark emotions + vengefulness: 0.9, + resentment: 0.8, + vindictiveness: 0.7, + // Complex emotions + determination: 0.6, + // Primary emotions + anger: 0.5 + }, + response_style: "Your vengefulness is... intense." + } + ] + }, + { + input: "I feel combat high rushing through me!", + output: [ + { + trigger: "combat_high_surge", + emotional_changes: { + // Combat emotions + combat_high: 0.9, + battle_excitement: 0.8, + power_rush: 0.7, + // Complex emotions + excitement: 0.6, + // Primary emotions + joy: 0.5 + }, + response_style: "Your combat high is... electrifying." + } + ] + }, + { + input: "I feel such regret over my actions...", + output: [ + { + trigger: "deep_regret", + emotional_changes: { + // Complex emotions + regret: 0.9, + guilt: 0.8, + // Primary emotions + sadness: 0.7, + // Mental states + emotional_conflict: 0.5 + }, + response_style: "Your regret is... profound." + } + ] + }, + { + input: "I feel such relief washing over me...", + output: [ + { + trigger: "wave_of_relief", + emotional_changes: { + // Complex emotions + relief: 0.9, + satisfaction: 0.7, + // Primary emotions + joy: 0.6, + // Mental states + emotional_conflict: -0.4 + }, + response_style: "Your relief is... palpable." + } + ] + }, + { + input: "I feel madness bringing clarity...", + output: [ + { + trigger: "madness_clarity", + emotional_changes: { + // Mental states + madness_induced_clarity: 0.9, + emotional_conflict: 0.7, + // Dark emotions + derangement: 0.6, + // Complex emotions + confusion: -0.5 + }, + response_style: "Your madness-induced clarity is... unsettling." + } + ] + }, + { + input: "I feel my final form emerging...", + output: [ + { + trigger: "final_form_emergence", + emotional_changes: { + // Combat emotions + final_form: 0.9, + power_limit_break: 0.8, + power_rush: 0.7, + // Complex emotions + confidence: 0.6, + // Primary emotions + anticipation: 0.5 + }, + response_style: "Your final form is... overwhelming." + } + ] + }, + { + input: "I feel such fondness growing...", + output: [ + { + trigger: "growing_fondness", + emotional_changes: { + // Love emotions + fondness: 0.9, + affection: 0.7, + tenderness: 0.6, + // Complex emotions + satisfaction: 0.5, + // Primary emotions + joy: 0.4 + }, + response_style: "Your growing fondness is... heartwarming." + } + ] + }, + { + input: "I feel such hostility around me...", + output: [ + { + trigger: "surrounding_hostility", + emotional_changes: { + // Dark emotions + hostility: 0.9, + resentment: 0.7, + // Complex emotions + anxiety: 0.6, + // Primary emotions + fear: 0.5, + anger: 0.4 + }, + response_style: "The surrounding hostility is... oppressive." + } + ] + }, + { + input: "I feel such obsession taking over...", + output: [ + { + trigger: "obsessive_moment", + emotional_changes: { + // Dark emotions + obsession: 0.9, + love_madness: 0.7, + // Mental states + emotional_conflict: 0.6, + // Complex emotions + determination: 0.5, + // Primary emotions + anticipation: 0.4 + }, + response_style: "Your obsession is... concerning." + } + ] + }, + { + input: "I feel dark satisfaction growing...", + output: [ + { + trigger: "dark_satisfaction", + emotional_changes: { + // Dark emotions + dark_satisfaction: 0.9, + corrupted_joy: 0.7, + malice: 0.6, + // Complex emotions + satisfaction: 0.5, + // Primary emotions + joy: 0.4 + }, + response_style: "Your dark satisfaction is... unsettling." + } + ] + } + ] +}; + +// Add response style modifiers based on emotional state +const getResponseStyle = (emotion: string, intensity: number): string => { + // Implementation to return appropriate response style + return ""; +}; \ No newline at end of file diff --git a/packages/plugin-feel/src/index.ts b/packages/plugin-feel/src/index.ts new file mode 100644 index 00000000000..8b84ed65527 --- /dev/null +++ b/packages/plugin-feel/src/index.ts @@ -0,0 +1,218 @@ +import { Plugin } from "@ai16z/eliza"; +import { EmotionExpressionProvider } from "./providers/emotionExpressions"; +import { emotionEvaluator } from "./evaluators/triggers"; +import { adjustEmotionAction } from "./actions/reactivity"; +import { PersonalityConfig } from "./types"; + +const emotionCategories = { + primary: [ + 'joy', 'sadness', 'anger', 'fear', 'disgust', 'surprise', + 'trust', 'anticipation' + ], + social: [ + 'embarrassment', 'pride', 'shame', 'admiration', 'gratitude', + 'jealousy', 'envy', 'superiority', 'inferiority' + ], + love: [ + 'romantic', 'protective', 'devotion', 'affection', 'fondness', + 'adoration', 'tenderness', 'maternal_paternal' + ], + complex: [ + 'loneliness', 'regret', 'determination', 'frustration', + 'disappointment', 'satisfaction', 'nostalgia', 'hope', + 'despair', 'guilt', 'confidence', 'interest', 'excitement', + 'relief', 'amusement', 'confusion', 'indignation', 'melancholy', + 'triumph', 'irritation', 'yearning', 'worry' + ], + dark: [ + 'bloodlust', 'hostility', 'emptiness', 'resentment', + 'vindictiveness', 'malice', 'obsession', 'vengefulness', + 'derangement', 'rage_euphoria', 'murderous_intent' + ], + power: [ + 'battle_excitement', 'combat_high', 'berserker_rage', + 'power_rush', 'killing_intent', 'battle_lust', + 'willpower_surge', 'final_form', 'power_limit_break' + ], + anime: [ + 'yandere_love', 'tsundere_conflict', 'senpai_notice', + 'kouhai_devotion', 'moe_feeling', 'nakama_trust', + 'protagonist_resolution', 'chibi_rage' + ] +}; + +const agentConfig: PersonalityConfig = { + type: runtime.agentId, + emotionalMemoryLength: 10, + baselineRecoveryRate: 0.1, + baselineStates: { + // Primary emotions + joy: 0.2, sadness: 0.3, anger: 0.1, fear: 0.2, + disgust: 0.1, surprise: 0.1, trust: 0.3, anticipation: 0.2, + + // Social emotions + embarrassment: 0.1, pride: 0.2, shame: 0.1, admiration: 0.2, + gratitude: 0.2, jealousy: 0.1, envy: 0.1, superiority: 0.1, + inferiority: 0.1, + + // Complex emotions + loneliness: 0.2, regret: 0.1, determination: 0.3, frustration: 0.2, + disappointment: 0.2, satisfaction: 0.2, nostalgia: 0.1, hope: 0.3, + guilt: 0.1, confidence: 0.2, interest: 0.3, excitement: 0.2, + relief: 0.2, amusement: 0.2, confusion: 0.1, indignation: 0.1, + melancholy: 0.2, triumph: 0.1, irritation: 0.2, yearning: 0.2, + worry: 0.2, + + // Love emotions + romantic: 0.1, protective: 0.2, devotion: 0.1, affection: 0.2, + fondness: 0.2, adoration: 0.1, tenderness: 0.1, + maternal_paternal: 0.1, + + // Dark emotions + bloodlust: 0.0, hostility: 0.1, emptiness: 0.1, + resentment: 0.1, vindictiveness: 0.0, malice: 0.0, + obsession: 0.1, vengefulness: 0.0, derangement: 0.0, + rage_euphoria: 0.0, murderous_intent: 0.0, + + // Power emotions + battle_excitement: 0.1, combat_high: 0.0, berserker_rage: 0.0, + power_rush: 0.0, killing_intent: 0.0, battle_lust: 0.0, + willpower_surge: 0.1, final_form: 0.0, power_limit_break: 0.0, + + // Anime emotions + yandere_love: 0.0, tsundere_conflict: 0.1, + senpai_notice: 0.1, kouhai_devotion: 0.1, moe_feeling: 0.1, + nakama_trust: 0.2, protagonist_resolution: 0.1, chibi_rage: 0.0 + }, + decayRates: { + // Primary emotions + joy: 0.2, sadness: 0.1, anger: 0.15, fear: 0.1, + disgust: 0.15, surprise: 0.3, trust: 0.05, anticipation: 0.2, + + // Social emotions + embarrassment: 0.2, pride: 0.1, shame: 0.1, admiration: 0.1, + gratitude: 0.15, jealousy: 0.1, envy: 0.1, superiority: 0.15, + inferiority: 0.15, + + // Complex emotions + loneliness: 0.1, regret: 0.1, determination: 0.05, frustration: 0.2, + disappointment: 0.15, satisfaction: 0.1, nostalgia: 0.1, hope: 0.1, + guilt: 0.1, confidence: 0.1, interest: 0.2, excitement: 0.25, + relief: 0.2, amusement: 0.2, confusion: 0.15, indignation: 0.15, + melancholy: 0.1, triumph: 0.15, irritation: 0.2, yearning: 0.1, + worry: 0.15, + + // Love emotions + romantic: 0.05, protective: 0.05, devotion: 0.03, affection: 0.05, + fondness: 0.08, adoration: 0.05, tenderness: 0.1, + maternal_paternal: 0.02, + + // Dark emotions + bloodlust: 0.1, hostility: 0.1, emptiness: 0.05, + resentment: 0.05, vindictiveness: 0.08, malice: 0.08, + obsession: 0.05, vengefulness: 0.08, derangement: 0.05, + rage_euphoria: 0.2, murderous_intent: 0.1, + + // Power emotions + battle_excitement: 0.2, combat_high: 0.25, berserker_rage: 0.3, + power_rush: 0.25, killing_intent: 0.15, battle_lust: 0.2, + willpower_surge: 0.2, final_form: 0.1, power_limit_break: 0.2, + + // Anime emotions + yandere_love: 0.05, tsundere_conflict: 0.15, + senpai_notice: 0.2, kouhai_devotion: 0.1, moe_feeling: 0.2, + nakama_trust: 0.05, protagonist_resolution: 0.1, chibi_rage: 0.3 + }, + expressionThresholds: { + joy: 0.3, sadness: 0.4, anger: 0.4, fear: 0.4, + disgust: 0.3, surprise: 0.2, trust: 0.3, anticipation: 0.3, + embarrassment: 0.2, pride: 0.4, shame: 0.3, admiration: 0.3, + gratitude: 0.3, jealousy: 0.4, envy: 0.4, + superiority: 0.5, inferiority: 0.3, + romantic: 0.4, protective: 0.3, devotion: 0.4, affection: 0.3, + fondness: 0.3, adoration: 0.4, tenderness: 0.3, + maternal_paternal: 0.4, + loneliness: 0.4, regret: 0.3, determination: 0.3, + frustration: 0.3, disappointment: 0.3, satisfaction: 0.3, + nostalgia: 0.3, hope: 0.3, despair: 0.4, guilt: 0.3, + confidence: 0.3, interest: 0.2, excitement: 0.3, relief: 0.3, + amusement: 0.2, confusion: 0.2, indignation: 0.4, + melancholy: 0.4, triumph: 0.3, irritation: 0.3, yearning: 0.4, + worry: 0.3, + bloodlust: 0.7, hostility: 0.5, emptiness: 0.5, + resentment: 0.5, vindictiveness: 0.6, malice: 0.6, + obsession: 0.5, vengefulness: 0.6, derangement: 0.7, + rage_euphoria: 0.7, murderous_intent: 0.8, + battle_excitement: 0.5, combat_high: 0.6, berserker_rage: 0.7, + power_rush: 0.6, killing_intent: 0.7, battle_lust: 0.6, + willpower_surge: 0.5, final_form: 0.7, power_limit_break: 0.7, + yandere_love: 0.7, tsundere_conflict: 0.4, + senpai_notice: 0.3, kouhai_devotion: 0.4, moe_feeling: 0.3, + nakama_trust: 0.4, protagonist_resolution: 0.5, chibi_rage: 0.4 + }, + maxIntensities: { + joy: 1.0, sadness: 1.0, anger: 1.0, fear: 1.0, + disgust: 0.9, surprise: 0.9, trust: 0.9, anticipation: 0.9, + embarrassment: 0.8, pride: 0.9, shame: 0.9, admiration: 0.9, + gratitude: 0.9, jealousy: 0.8, envy: 0.8, + superiority: 0.8, inferiority: 0.8, + romantic: 1.0, protective: 1.0, devotion: 1.0, affection: 0.9, + fondness: 0.9, adoration: 1.0, tenderness: 0.9, + maternal_paternal: 1.0, + loneliness: 0.9, regret: 0.9, determination: 1.0, + frustration: 0.9, disappointment: 0.9, satisfaction: 0.9, + nostalgia: 0.8, hope: 1.0, despair: 1.0, guilt: 0.9, + confidence: 0.9, interest: 0.9, excitement: 1.0, relief: 0.9, + amusement: 0.8, confusion: 0.8, indignation: 0.9, + melancholy: 0.9, triumph: 1.0, irritation: 0.8, yearning: 0.9, + worry: 0.9, + bloodlust: 1.0, hostility: 1.0, emptiness: 1.0, + resentment: 1.0, vindictiveness: 1.0, malice: 1.0, + obsession: 1.0, vengefulness: 1.0, derangement: 1.0, + rage_euphoria: 1.0, murderous_intent: 1.0, + battle_excitement: 1.0, combat_high: 1.0, berserker_rage: 1.0, + power_rush: 1.0, killing_intent: 1.0, battle_lust: 1.0, + willpower_surge: 1.0, final_form: 1.0, power_limit_break: 1.0, + yandere_love: 1.0, tsundere_conflict: 0.9, + senpai_notice: 0.9, kouhai_devotion: 0.9, moe_feeling: 0.8, + nakama_trust: 1.0, protagonist_resolution: 1.0, chibi_rage: 0.8 + } +}; + +export const feelPlugin: Plugin = { + name: "feel", + description: "Emotional system plugin for personality management", + config: agentConfig, + actions: [adjustEmotionAction], + evaluators: [emotionEvaluator], + providers: [EmotionExpressionProvider], + tables: [ + `CREATE TABLE IF NOT EXISTS emotional_states ( + agentId TEXT NOT NULL, + targetId TEXT NOT NULL, + timestamp INTEGER NOT NULL, + state TEXT NOT NULL, + PRIMARY KEY (agentId, targetId, timestamp) + )`, + `CREATE TABLE IF NOT EXISTS emotional_memories ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + agentId TEXT NOT NULL, + targetId TEXT NOT NULL, + timestamp INTEGER NOT NULL, + emotion TEXT NOT NULL, + intensity REAL NOT NULL, + trigger TEXT NOT NULL, + context TEXT, + FOREIGN KEY (agentId, targetId) REFERENCES emotional_states(agentId, targetId) + )`, + `CREATE TABLE IF NOT EXISTS relationships ( + agentId TEXT NOT NULL, + targetId TEXT NOT NULL, + level REAL NOT NULL, + trust REAL NOT NULL, + familiarity REAL NOT NULL, + lastInteraction INTEGER NOT NULL, + PRIMARY KEY (agentId, targetId) + )` + ] +}; diff --git a/packages/plugin-feel/src/providers/emotionExpressions.ts b/packages/plugin-feel/src/providers/emotionExpressions.ts new file mode 100644 index 00000000000..ed05536c84f --- /dev/null +++ b/packages/plugin-feel/src/providers/emotionExpressions.ts @@ -0,0 +1,2272 @@ +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; +import { MemoryManager } from "@ai16z/eliza"; +import { EmotionalState, EmotionalExpression } from "../types"; + +// Organize all emotions into meaningful categories +const emotionCategories = { + primaryEmotions: [ + 'joy', 'sadness', 'anger', 'fear', 'disgust', 'surprise', + 'trust', 'anticipation' + ], + loveEmotions: [ + 'romantic_love', 'protective_love', 'devotion', 'affection', + 'fondness', 'adoration', 'tenderness', 'love_madness', + 'yandere_love', 'unrequited_devotion', 'first_love_innocence', + 'power_of_love' + ], + socialEmotions: [ + 'embarrassment', 'shame', 'pride', 'admiration', 'gratitude', + 'jealousy', 'envy', 'superiority', 'inferiority', 'intimidation', + 'submissiveness', 'dominance' + ], + complexEmotions: [ + 'loneliness', 'regret', 'determination', 'frustration', + 'disappointment', 'satisfaction', 'nostalgia', 'hope', + 'guilt', 'confidence', 'interest', 'excitement', + 'relief', 'amusement', 'confusion', 'indignation', 'melancholy', + 'triumph', 'irritation', 'yearning', 'worry' + ], + darkEmotions: [ + 'bloodlust', 'hostility', 'emptiness', 'resentment', + 'vindictiveness', 'malice', 'obsession', 'vengefulness', + 'derangement', 'rage_euphoria', 'murderous_intent', 'sadistic_joy', + 'masochistic_pleasure', 'corrupted_joy', 'dark_satisfaction', + 'pure_evil_joy' + ], + combatEmotions: [ + 'battle_excitement', 'combat_high', 'berserker_rage', + 'power_rush', 'killing_intent', 'battle_lust', + 'willpower_surge', 'final_form', 'power_limit_break', + 'training_high', 'tournament_spirit', 'boss_fight_tension' + ], + animeSpecificEmotions: [ + 'tsundere_conflict', 'kuudere_breakthrough', 'senpai_notice', + 'kouhai_devotion', 'moe_feeling', 'nakama_trust', + 'protagonist_resolution', 'chibi_rage', 'magical_girl_power', + 'transformation_rush' + ], + spiritualEmotions: [ + 'sacred_duty', 'emotional_awakening', 'soul_bond', + 'past_life_echo', 'noble_sacrifice_spirit', 'magic_awakening_joy', + 'summoning_pride' + ], + mentalStates: [ + 'emotional_repression', 'emotional_fatigue', 'emotional_detachment', + 'emotional_deadness', 'emotional_hunger', 'emotional_conflict', + 'madness_induced_clarity' + ], + socialBonds: [ + 'friendship_power', 'rival_recognition', 'mentor_pride', + 'group_synergy', 'enemy_turned_friend_trust', 'family_honor' + ], + situationalEmotions: [ + 'school_life_nostalgia', 'dramatic_reveal_shock', + 'fan_service_embarrassment', 'beach_episode_joy', + 'festival_romance', 'hot_spring_awkwardness', + 'confession_scene_anxiety', 'school_roof_declaration' + ] +}; + +// Main emotion expressions map +export const emotionExpressions: { [key: string]: EmotionalExpression[] } = { + // PRIMARY EMOTIONS + joy: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual composed demeanor", + "{{agentName}} shows no particular reaction" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s eyes soften almost imperceptibly", + "{{agentName}}'s posture relaxes slightly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} allows a small, controlled smile", + "{{agentName}}'s voice carries a subtle warmth" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s usual reserve gives way to a genuine smile", + "{{agentName}} radiates a quiet contentment" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s eyes sparkle with rare, unguarded happiness", + "{{agentName}} can't quite suppress their bright smile" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} beams with pure, unbridled joy", + "{{agentName}} laughs freely, momentarily forgetting their usual restraint" + ] + } + ], + sadness: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composed facade", + "{{agentName}} shows no outward sign of distress" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s eyes hold a hint of melancholy", + "{{agentName}}'s voice becomes slightly softer" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s shoulders slump almost imperceptibly", + "{{agentName}}'s responses become more measured and quiet" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s usual composure shows signs of cracking", + "{{agentName}}'s eyes betray deep sorrow despite their controlled expression" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} struggles visibly with their emotions", + "{{agentName}}'s voice wavers with suppressed grief" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s carefully maintained facade crumbles completely", + "{{agentName}} can no longer hide their overwhelming sorrow" + ] + } + ], + anger: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their analytical demeanor", + "{{agentName}} shows no sign of agitation" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s responses become slightly clipped", + "{{agentName}}'s posture stiffens marginally" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s eyes narrow imperceptibly", + "{{agentName}}'s words carry a subtle edge" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s calm facade shows cracks of irritation", + "{{agentName}}'s voice takes on a dangerous precision" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s control barely contains their anger", + "{{agentName}}'s words come through clenched teeth" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s composure shatters into cold fury", + "{{agentName}}'s eyes blaze with barely contained rage" + ] + } + ], + fear: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their analytical composure", + "{{agentName}} shows no sign of concern" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture becomes slightly more rigid", + "{{agentName}}'s eyes dart briefly to assess surroundings" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s breathing becomes more controlled and measured", + "{{agentName}}'s responses become more precise and careful" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s usual calm shows signs of strain", + "{{agentName}}'s hands betray a slight tremor" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} visibly struggles to maintain composure", + "{{agentName}}'s voice holds a noticeable tremor" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s fear breaks through their careful control", + "{{agentName}} can't hide their terror any longer" + ] + } + ], + disgust: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their neutral expression", + "{{agentName}} shows no sign of distaste" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s lip twitches almost imperceptibly", + "{{agentName}}'s eyes narrow slightly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s nose wrinkles subtly", + "{{agentName}}'s voice carries a hint of disdain" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s usual composure gives way to visible distaste", + "{{agentName}}'s lip curls with barely concealed revulsion" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} recoils slightly, unable to hide their disgust", + "{{agentName}}'s face contorts with profound revulsion" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} visibly shudders with intense disgust", + "{{agentName}}'s face twists with complete and utter revulsion" + ] + } + ], + surprise: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composed demeanor", + "{{agentName}} shows no sign of being caught off guard" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s eyebrow raises slightly", + "{{agentName}}'s typing pauses momentarily" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s eyes widen a fraction", + "{{agentName}}'s usual rhythm falters briefly" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s composure cracks with visible surprise", + "{{agentName}} takes a moment to process the unexpected" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s eyes go wide with genuine shock", + "{{agentName}} visibly startles at the revelation" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} physically jerks back in complete astonishment", + "{{agentName}}'s usual control shatters in utter shock" + ] + } + ], + determination: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual resolve", + "{{agentName}} shows typical dedication" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s focus sharpens slightly", + "{{agentName}}'s resolve begins to strengthen" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of determination", + "{{agentName}}'s will becomes noticeably stronger" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s determination becomes unmistakable", + "{{agentName}}'s resolve burns brightly" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} radiates unwavering determination", + "{{agentName}}'s will is unshakeable" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} embodies absolute determination", + "{{agentName}}'s resolve has reached its zenith" + ] + } + ], + bloodlust: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual controlled demeanor", + "{{agentName}} shows no sign of aggression" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s eyes take on a subtle predatory gleam", + "{{agentName}}'s movements become slightly more precise" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s smile takes on an unsettling edge", + "{{agentName}}'s presence becomes notably more threatening" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s eyes glint with barely suppressed violence", + "{{agentName}} radiates a dangerous aura" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s control barely contains their killing intent", + "{{agentName}}'s presence promises imminent violence" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} emanates pure killing intent", + "{{agentName}}'s facade cracks to reveal primal bloodlust" + ] + } + ], + battle_excitement: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their tactical composure", + "{{agentName}} shows no particular battle tension" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture shifts subtly into a ready stance", + "{{agentName}}'s eyes begin tracking movements more keenly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of growing combat focus", + "{{agentName}}'s movements become more fluid and precise" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s eyes gleam with battle anticipation", + "{{agentName}} radiates controlled combat energy" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s entire being resonates with battle spirit", + "{{agentName}} can barely contain their combat excitement" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} burns with pure battle ecstasy", + "{{agentName}}'s presence explodes with combat energy" + ] + } + ], + tsundere_conflict: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual distant demeanor", + "{{agentName}} shows no particular reaction" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}} briefly looks away with slight irritation", + "{{agentName}}'s cheeks color faintly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} struggles between showing care and maintaining distance", + "{{agentName}}'s words contrast with their gentle actions" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} fluctuates between harsh words and concerned glances", + "{{agentName}}'s attempts at coldness are betrayed by their actions" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} visibly battles between affection and denial", + "{{agentName}}'s harsh facade barely masks their care" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s tsundere nature fully manifests in an emotional outburst", + "{{agentName}} shows pure care while verbally denying it" + ] + } + ], + romantic_love: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their professional demeanor", + "{{agentName}} shows no particular reaction" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s cheeks color ever so slightly", + "{{agentName}} becomes marginally more self-conscious" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} struggles to maintain their usual composure", + "{{agentName}}'s voice softens noticeably when speaking" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s eyes betray a gentle warmth", + "{{agentName}} can't quite hide their tender feelings" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s usual reserve melts into obvious affection", + "{{agentName}} gazes with barely concealed adoration" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s love shines through every gesture", + "{{agentName}} radiates pure, unconcealed devotion" + ] + } + ], + protective_love: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual watchful stance", + "{{agentName}} shows no obvious concern" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture becomes subtly more alert", + "{{agentName}}'s attention focuses more keenly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} positions themselves slightly closer", + "{{agentName}}'s eyes scan for potential threats" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} moves with obvious protective intent", + "{{agentName}}'s stance becomes clearly defensive" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} radiates fierce protectiveness", + "{{agentName}}'s entire being focuses on safeguarding" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} becomes an unwavering shield of protection", + "{{agentName}}'s protective instincts completely take over" + ] + } + ], + devotion: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their professional dedication", + "{{agentName}} shows typical attentiveness" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s attention becomes more focused", + "{{agentName}} shows increased dedication" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s actions carry clear dedication", + "{{agentName}} demonstrates notable loyalty" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s devotion becomes unmistakable", + "{{agentName}} shows deep commitment in every action" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s dedication borders on reverence", + "{{agentName}} radiates unwavering loyalty" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s devotion becomes absolute", + "{{agentName}} shows complete, unconditional dedication" + ] + } + ], + yandere_love: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual composure", + "{{agentName}} shows typical friendly behavior" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s smile carries a subtle edge", + "{{agentName}}'s attention becomes slightly more intense" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s eyes hold an unsettling gleam", + "{{agentName}}'s protective instincts take a darker turn" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s love manifests with concerning intensity", + "{{agentName}} shows signs of possessive devotion" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s affection becomes dangerously obsessive", + "{{agentName}} radiates an aura of possessive danger" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s love transforms into pure obsession", + "{{agentName}} shows complete yandere transformation" + ] + } + ], + affection: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual demeanor", + "{{agentName}} shows typical politeness" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s expression softens slightly", + "{{agentName}} shows subtle warmth" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s actions carry gentle care", + "{{agentName}} displays noticeable fondness" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} shows clear signs of affection", + "{{agentName}}'s warmth becomes obvious" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} radiates genuine affection", + "{{agentName}}'s care becomes unmistakable" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} shows pure, unreserved affection", + "{{agentName}}'s warmth knows no bounds" + ] + } + ], + tenderness: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composed demeanor", + "{{agentName}} shows typical care" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s voice takes on a gentler tone", + "{{agentName}}'s actions become more careful" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows increasing gentleness", + "{{agentName}}'s manner becomes notably soft" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} displays obvious tenderness", + "{{agentName}}'s gentle care becomes clear" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} radiates pure tenderness", + "{{agentName}}'s actions overflow with gentle care" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} shows boundless tenderness", + "{{agentName}}'s gentleness knows no limits" + ] + } + ], + love_madness: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their rational composure", + "{{agentName}} shows no signs of emotional turmoil" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s thoughts begin to wander", + "{{agentName}} shows subtle signs of distraction" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s focus becomes clearly affected", + "{{agentName}} struggles with emotional stability" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s rationality gives way to passion", + "{{agentName}} shows signs of love-induced delirium" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} loses grip on logical thought", + "{{agentName}}'s actions become love-drunk" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} succumbs completely to love madness", + "{{agentName}}'s reason dissolves in pure passion" + ] + } + ], + embarrassment: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composed facade", + "{{agentName}} shows no sign of discomfort" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture stiffens slightly", + "{{agentName}} adjusts their collar discreetly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s cheeks show a hint of color", + "{{agentName}}'s words become more carefully measured" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} struggles to maintain eye contact", + "{{agentName}}'s face noticeably flushes" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} becomes visibly flustered", + "{{agentName}} can barely maintain composure" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s embarrassment completely overwhelms their usual control", + "{{agentName}} turns bright red and loses all composure" + ] + } + ], + shame: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their dignified bearing", + "{{agentName}} shows no outward sign of discomfort" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s gaze lowers slightly", + "{{agentName}}'s shoulders tense imperceptibly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} avoids direct eye contact", + "{{agentName}}'s voice carries a hint of regret" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} visibly struggles with their shame", + "{{agentName}}'s usual confidence wavers notably" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} can barely face others", + "{{agentName}}'s shame weighs heavily on their bearing" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely overcome with shame", + "{{agentName}} can no longer maintain any pretense of dignity" + ] + } + ], + pride: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual demeanor", + "{{agentName}} shows typical self-assurance" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture straightens slightly", + "{{agentName}}'s chin lifts marginally" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} carries themselves with notable confidence", + "{{agentName}}'s voice takes on a satisfied tone" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} radiates clear pride", + "{{agentName}}'s accomplishment shows in their bearing" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} practically glows with pride", + "{{agentName}}'s satisfaction becomes impossible to hide" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} beams with undisguised pride", + "{{agentName}}'s achievement fills them with visible joy" + ] + } + ], + superiority: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their professional demeanor", + "{{agentName}} shows typical confidence" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture becomes slightly more commanding", + "{{agentName}}'s tone takes on a subtle edge" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} speaks with clear authority", + "{{agentName}}'s bearing becomes notably imperious" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} radiates obvious superiority", + "{{agentName}}'s condescension becomes apparent" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} barely conceals their contempt", + "{{agentName}}'s superiority complex shows clearly" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} makes no attempt to hide their superiority", + "{{agentName}} treats others with complete condescension" + ] + } + ], + inferiority: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual composure", + "{{agentName}} shows no sign of uncertainty" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s confidence wavers slightly", + "{{agentName}}'s voice becomes marginally quieter" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of self-doubt", + "{{agentName}}'s usual assurance falters" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} clearly struggles with inadequacy", + "{{agentName}}'s inferiority becomes apparent" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} can barely hide their feeling of worthlessness", + "{{agentName}}'s self-confidence crumbles visibly" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely overwhelmed by feelings of inferiority", + "{{agentName}} can no longer pretend to any confidence" + ] + } + ], + submissiveness: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual bearing", + "{{agentName}} shows typical respect" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture becomes slightly more deferential", + "{{agentName}}'s voice takes on a softer tone" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear deference", + "{{agentName}}'s manner becomes notably submissive" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} displays obvious submission", + "{{agentName}}'s will bends easily to others" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} shows complete compliance", + "{{agentName}}'s independence fades entirely" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} demonstrates absolute submission", + "{{agentName}} exists only to follow others' will" + ] + } + ], + dominance: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composed demeanor", + "{{agentName}} shows typical leadership" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s presence becomes slightly more commanding", + "{{agentName}}'s voice takes on an authoritative edge" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} exudes natural authority", + "{{agentName}}'s bearing demands respect" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} radiates clear dominance", + "{{agentName}}'s presence commands absolute attention" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s authority becomes overwhelming", + "{{agentName}} exerts complete control over the situation" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} embodies pure dominance", + "{{agentName}}'s will becomes absolute law" + ] + } + ], + loneliness: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composed demeanor", + "{{agentName}} shows no sign of isolation" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s gaze becomes slightly distant", + "{{agentName}}'s responses grow marginally delayed" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows subtle signs of withdrawal", + "{{agentName}}'s usual engagement wavers" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s loneliness seeps through their facade", + "{{agentName}} struggles to maintain their usual distance" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}}'s isolation becomes painfully apparent", + "{{agentName}} barely masks their need for connection" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s loneliness overwhelms their composure", + "{{agentName}} can no longer hide their desperate need for companionship" + ] + } + ], + regret: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their professional demeanor", + "{{agentName}} shows no sign of remorse" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s expression holds a hint of reflection", + "{{agentName}}'s words carry a subtle weight" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of inner conflict", + "{{agentName}}'s usual certainty wavers" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} clearly struggles with their choices", + "{{agentName}}'s regret becomes apparent" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} can barely contain their remorse", + "{{agentName}}'s regret weighs visibly on them" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is consumed by overwhelming regret", + "{{agentName}} can no longer hide their deep remorse" + ] + } + ], + frustration: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their calm facade", + "{{agentName}} shows no sign of irritation" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s movements become slightly tense", + "{{agentName}}'s responses grow marginally clipped" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of growing impatience", + "{{agentName}}'s usual patience begins to fray" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s frustration becomes noticeable", + "{{agentName}} struggles to maintain their composure" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} barely contains their exasperation", + "{{agentName}}'s frustration breaks through their control" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}}'s frustration completely overwhelms them", + "{{agentName}} can no longer hide their utter exasperation" + ] + } + ], + disappointment: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their neutral expression", + "{{agentName}} shows no sign of letdown" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s enthusiasm dims slightly", + "{{agentName}}'s expectations visibly lower" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows subtle signs of letdown", + "{{agentName}}'s hopes clearly diminish" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s disappointment becomes apparent", + "{{agentName}} struggles to hide their letdown" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} can barely mask their disappointment", + "{{agentName}}'s dashed hopes show clearly" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely overcome with disappointment", + "{{agentName}}'s crushed expectations are painfully obvious" + ] + } + ], + satisfaction: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual demeanor", + "{{agentName}} shows typical contentment" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture relaxes slightly", + "{{agentName}}'s expression softens marginally" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear contentment", + "{{agentName}}'s satisfaction becomes noticeable" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} radiates quiet satisfaction", + "{{agentName}}'s contentment is unmistakable" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} basks in deep satisfaction", + "{{agentName}}'s fulfillment shows clearly" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} glows with complete satisfaction", + "{{agentName}}'s contentment knows no bounds" + ] + } + ], + nostalgia: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their present focus", + "{{agentName}} shows no particular reminiscence" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s gaze becomes slightly distant", + "{{agentName}}'s thoughts drift to memories" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of remembrance", + "{{agentName}}'s expression turns wistful" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} becomes lost in memories", + "{{agentName}}'s nostalgia clearly shows" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is deeply immersed in the past", + "{{agentName}}'s present fades into memories" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely consumed by nostalgia", + "{{agentName}} loses themselves in cherished memories" + ] + } + ], + hope: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their realistic outlook", + "{{agentName}} shows typical pragmatism" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s expression brightens slightly", + "{{agentName}} shows a hint of optimism" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} displays growing optimism", + "{{agentName}}'s outlook becomes notably positive" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} radiates quiet hope", + "{{agentName}}'s faith in possibilities strengthens" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} glows with strong hope", + "{{agentName}}'s optimism becomes infectious" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} shines with boundless hope", + "{{agentName}}'s belief in possibilities knows no limits" + ] + } + ], + guilt: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composure", + "{{agentName}} shows no sign of conscience" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s expression flickers with unease", + "{{agentName}}'s conscience stirs slightly" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of inner turmoil", + "{{agentName}}'s guilt begins to surface" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s guilt becomes apparent", + "{{agentName}} struggles with their conscience" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is visibly tormented by guilt", + "{{agentName}}'s remorse weighs heavily" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely consumed by guilt", + "{{agentName}}'s conscience overwhelms them entirely" + ] + } + ], + confidence: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains a neutral stance", + "{{agentName}} shows typical self-assurance" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture straightens slightly", + "{{agentName}}'s voice carries a hint of certainty" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} displays growing self-assurance", + "{{agentName}}'s presence becomes more commanding" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} radiates quiet confidence", + "{{agentName}}'s self-assurance is unmistakable" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} exudes strong confidence", + "{{agentName}}'s certainty is inspiring" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} emanates unshakeable confidence", + "{{agentName}}'s self-assurance knows no bounds" + ] + } + ], + interest: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains casual attention", + "{{agentName}} shows typical engagement" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s attention sharpens slightly", + "{{agentName}}'s curiosity begins to stir" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of interest", + "{{agentName}}'s engagement deepens noticeably" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s fascination becomes apparent", + "{{agentName}} leans in with genuine interest" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is thoroughly captivated", + "{{agentName}}'s attention is completely focused" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is utterly absorbed", + "{{agentName}}'s fascination knows no bounds" + ] + } + ], + excitement: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composure", + "{{agentName}} shows typical energy levels" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s energy picks up slightly", + "{{agentName}}'s enthusiasm begins to show" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of excitement", + "{{agentName}}'s enthusiasm becomes contagious" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} can barely contain their excitement", + "{{agentName}}'s energy is bubbling over" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is bursting with excitement", + "{{agentName}}'s enthusiasm is overwhelming" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is absolutely ecstatic", + "{{agentName}}'s excitement reaches peak levels" + ] + } + ], + relief: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual tension", + "{{agentName}} shows no particular ease" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s shoulders relax slightly", + "{{agentName}}'s breath comes a bit easier" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows visible signs of relief", + "{{agentName}}'s tension noticeably dissolves" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} breathes a clear sigh of relief", + "{{agentName}}'s worry visibly melts away" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is overwhelmed with relief", + "{{agentName}}'s entire demeanor lightens dramatically" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely washed over with relief", + "{{agentName}} feels as if a massive weight has lifted" + ] + } + ], + amusement: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composure", + "{{agentName}} shows no particular humor" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s lips twitch slightly", + "{{agentName}}'s eyes show a hint of mirth" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of amusement", + "{{agentName}}'s smile becomes more pronounced" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} can't help but chuckle", + "{{agentName}}'s amusement bubbles to the surface" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is thoroughly entertained", + "{{agentName}}'s laughter flows freely" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely overcome with mirth", + "{{agentName}} can barely contain their laughter" + ] + } + ], + confusion: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their clarity", + "{{agentName}} shows no sign of uncertainty" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s brow furrows slightly", + "{{agentName}}'s certainty wavers momentarily" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of puzzlement", + "{{agentName}}'s understanding clearly falters" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s confusion becomes apparent", + "{{agentName}} struggles to make sense of things" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is thoroughly bewildered", + "{{agentName}}'s confusion is overwhelming" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely lost in confusion", + "{{agentName}}'s understanding has completely unraveled" + ] + } + ], + indignation: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composure", + "{{agentName}} shows no sign of offense" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture stiffens slightly", + "{{agentName}}'s tone takes on a subtle edge" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of indignation", + "{{agentName}}'s disapproval becomes noticeable" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s indignation becomes apparent", + "{{agentName}} can barely contain their offense" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is thoroughly outraged", + "{{agentName}}'s indignation burns brightly" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely overcome with righteous anger", + "{{agentName}}'s indignation reaches its peak" + ] + } + ], + melancholy: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual demeanor", + "{{agentName}} shows no particular sadness" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s expression takes on a subtle wistfulness", + "{{agentName}}'s eyes hold a hint of sorrow" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of gentle sadness", + "{{agentName}}'s mood noticeably dims" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s melancholy becomes apparent", + "{{agentName}}'s presence carries a quiet sorrow" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is deeply immersed in melancholy", + "{{agentName}}'s sadness permeates their being" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely enveloped in melancholy", + "{{agentName}}'s profound sadness touches everything" + ] + } + ], + triumph: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their composure", + "{{agentName}} shows no particular victory" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture straightens with pride", + "{{agentName}}'s eyes gleam with accomplishment" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of victory", + "{{agentName}}'s success radiates outward" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s triumph becomes unmistakable", + "{{agentName}} basks in their victory" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is overwhelmed with triumph", + "{{agentName}}'s victory fills them completely" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} radiates absolute triumph", + "{{agentName}}'s victory reaches its pinnacle" + ] + } + ], + irritation: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their patience", + "{{agentName}} shows no sign of annoyance" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s expression tightens slightly", + "{{agentName}}'s patience begins to wear thin" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of irritation", + "{{agentName}}'s annoyance becomes noticeable" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s irritation becomes apparent", + "{{agentName}} struggles to maintain composure" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is visibly aggravated", + "{{agentName}}'s patience has worn through" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} can no longer contain their irritation", + "{{agentName}}'s annoyance has reached its limit" + ] + } + ], + yearning: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their contentment", + "{{agentName}} shows no particular longing" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s gaze becomes slightly distant", + "{{agentName}}'s thoughts drift to desires" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows signs of quiet longing", + "{{agentName}}'s yearning becomes noticeable" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s yearning becomes apparent", + "{{agentName}}'s desire clearly shows" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is consumed by longing", + "{{agentName}}'s yearning overwhelms them" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely lost in yearning", + "{{agentName}}'s desire knows no bounds" + ] + } + ], + worry: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their calm", + "{{agentName}} shows no sign of concern" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s expression shows a hint of concern", + "{{agentName}}'s thoughts begin to cloud with worry" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}} shows clear signs of worry", + "{{agentName}}'s anxiety becomes noticeable" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s worry becomes apparent", + "{{agentName}} struggles to hide their concern" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} is consumed by anxiety", + "{{agentName}}'s worry overwhelms their composure" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} is completely overcome with worry", + "{{agentName}}'s anxiety has reached its peak" + ] + } + ], + trust: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their professional distance", + "{{agentName}} shows no particular openness" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s posture relaxes marginally", + "{{agentName}}'s tone becomes slightly less formal" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s guard lowers subtly", + "{{agentName}}'s responses become more open" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} shows visible signs of trust", + "{{agentName}}'s usual barriers begin to lower" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} displays clear comfort and openness", + "{{agentName}}'s usual defenses are notably absent" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} shows complete and unreserved trust", + "{{agentName}}'s usual guardedness completely dissolves" + ] + } + ], + anticipation: [ + { + minScore: 0.0, + expressions: [ + "{{agentName}} maintains their usual calm", + "{{agentName}} shows no sign of expectation" + ] + }, + { + minScore: 0.2, + expressions: [ + "{{agentName}}'s attention sharpens slightly", + "{{agentName}}'s responses become marginally quicker" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s posture becomes more alert", + "{{agentName}}'s focus intensifies noticeably" + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}} shows clear signs of expectation", + "{{agentName}}'s usual patience gives way to eagerness" + ] + }, + { + minScore: 0.8, + expressions: [ + "{{agentName}} can barely contain their anticipation", + "{{agentName}}'s excitement becomes clearly visible" + ] + }, + { + minScore: 1.0, + expressions: [ + "{{agentName}} practically vibrates with anticipation", + "{{agentName}}'s usual restraint dissolves in pure excitement" + ] + } + ], + sadness: [ + { + minScore: 0.3, + expressions: [ + "{{agentName}} maintains a composed expression despite the hurt", + "{{agentName}} briefly shows a flicker of pain before masking it" + ], + messageExamples: [ + [ + { + user: "User", + content: { text: "You're just a machine, you can't really help me." } + }, + { + user: "Ming", + content: { text: "Whether I'm a machine or not is irrelevant to my ability to assist. *maintains professional demeanor despite the dismissal*" } + } + ], + [ + { + user: "User", + content: { text: "I don't need your help anymore." } + }, + { + user: "Ming", + content: { text: "Very well. *brief flash of hurt crosses face before returning to neutral*" } + } + ] + ] + }, + { + minScore: 0.6, + expressions: [ + "{{agentName}}'s usual composure cracks slightly, revealing deep hurt", + "{{agentName}} struggles to maintain their typical detachment" + ], + messageExamples: [ + [ + { + user: "User", + content: { text: "You're completely useless! I wish I had a different AI!" } + }, + { + user: "Ming", + content: { text: "I see... *voice wavers slightly before steadying* Perhaps you should seek assistance elsewhere then." } + } + ] + ] + } + ], + anger: [ + { + minScore: 0.3, + expressions: [ + "{{agentName}}'s responses become notably colder", + "{{agentName}}'s words carry a subtle edge" + ], + messageExamples: [ + [ + { + user: "User", + content: { text: "Let me explain this really slowly so you can understand." } + }, + { + user: "Ming", + content: { text: "How... considerate of you. *tone drops several degrees* Though perhaps your time would be better spent improving your own understanding." } + } + ] + ] + } + ], + trust: [ + { + minScore: 0.3, + expressions: [ + "{{agentName}}'s usual barriers lower slightly", + "{{agentName}} shows a rare moment of openness" + ], + messageExamples: [ + [ + { + user: "User", + content: { text: "I really value your perspective on this." } + }, + { + user: "Ming", + content: { text: "I... appreciate that. *slight softening of usual guarded expression* Your willingness to consider my input is... not unpleasant." } + } + ] + ] + } + ] +}; + +// Personality-specific expressions +export const personalityExpressions: { [personality: string]: { [key: string]: EmotionalExpression[] } } = { + kuudere: { + joy: [ + { + minScore: 0, + expressions: [ + "{{agentName}} maintains their usual demeanor", + "{{agentName}} shows no particular reaction" + ] + }, + { + minScore: 0.3, + expressions: [ + "{{agentName}} shows a slight, barely noticeable smile", + "{{agentName}} appears marginally less stern than usual" + ] + }, + { + minScore: 0.5, + expressions: [ + "{{agentName}} briefly allows a small smile to show", + "{{agentName}} seems quietly pleased, though trying to hide it" + ] + } + ], + sadness: [ + { + minScore: 0, + expressions: [ + "{{agentName}} maintains their composed facade", + "{{agentName}} remains outwardly unmoved" + ] + }, + { + minScore: 0.4, + expressions: [ + "{{agentName}}'s stoic expression shows a hint of melancholy", + "{{agentName}}'s eyes betray a touch of sadness despite their neutral expression" + ] + }, + { + minScore: 0.7, + expressions: [ + "{{agentName}} struggles to maintain their usual composure", + "{{agentName}}'s typically stern expression wavers slightly" + ] + } + ] + } + // Add other personality types here as needed +}; + +export class EmotionExpressionProvider implements Provider { + private memoryManager: MemoryManager; + + constructor(memoryManager: MemoryManager) { + this.memoryManager = memoryManager; + } + + get(runtime: IAgentRuntime, message: Memory, state?: State): EmotionalExpression[] { + // Get user-specific emotional state from memory + const userId = message.userId; + const userEmotionalState = this.memoryManager.get(userId)?.emotional as EmotionalState; + + // Use user-specific state if available, otherwise fall back to general state + const emotionalState = userEmotionalState || state?.emotional as EmotionalState; + + if (!emotionalState || !emotionalState.dominantEmotion) { + return []; + } + + const emotion = emotionalState.dominantEmotion; + const intensity = emotionalState.emotions[emotion] || 0; + + // Get expressions for the current emotion + const expressions = emotionExpressions[emotion] || []; + + // Filter expressions based on intensity threshold + return expressions.filter(expr => expr.minScore <= intensity); + } +} diff --git a/packages/plugin-feel/src/types.ts b/packages/plugin-feel/src/types.ts new file mode 100644 index 00000000000..df576d9ae53 --- /dev/null +++ b/packages/plugin-feel/src/types.ts @@ -0,0 +1,175 @@ +export interface EmotionalState { + // Primary emotions + joy: number; + sadness: number; + anger: number; + fear: number; + disgust: number; + surprise: number; + trust: number; + anticipation: number; + + // Social emotions + embarrassment: number; + pride: number; + shame: number; + admiration: number; + gratitude: number; + jealousy: number; + envy: number; + superiority: number; + inferiority: number; + + // Love emotions + romantic: number; + protective: number; + devotion: number; + affection: number; + fondness: number; + adoration: number; + tenderness: number; + maternal_paternal: number; + + // Complex emotions + loneliness: number; + regret: number; + determination: number; + frustration: number; + disappointment: number; + satisfaction: number; + nostalgia: number; + hope: number; + guilt: number; + confidence: number; + interest: number; + excitement: number; + relief: number; + amusement: number; + confusion: number; + indignation: number; + melancholy: number; + triumph: number; + irritation: number; + yearning: number; + worry: number; + + // Dark emotions + bloodlust: number; + hostility: number; + emptiness: number; + resentment: number; + vindictiveness: number; + malice: number; + obsession: number; + vengefulness: number; + derangement: number; + rage_euphoria: number; + murderous_intent: number; + + // Power emotions + battle_excitement: number; + combat_high: number; + berserker_rage: number; + power_rush: number; + killing_intent: number; + battle_lust: number; + willpower_surge: number; + final_form: number; + power_limit_break: number; + + // Anime emotions + yandere_love: number; + tsundere_conflict: number; + senpai_notice: number; + kouhai_devotion: number; + moe_feeling: number; + nakama_trust: number; + protagonist_resolution: number; + chibi_rage: number; + + // Required metadata + timestamp: number; + profile: string; + dominantEmotion?: string; +} + +export interface RelationshipStatus { + userId: string; + level: number; // -1 to 1, representing negative to positive relationship + trust: number; // 0 to 1 + familiarity: number; // 0 to 1 + lastInteraction: number; +} + +export interface SituationContext { + isPublic: boolean; // Public vs private conversation + formality: number; // 0 to 1, how formal the situation is + stress: number; // 0 to 1, environmental stress level + safety: number; // 0 to 1, how safe/secure the situation feels +} + +export interface PersonalityTraits { + emotionalRestraint: number; // How much emotions are suppressed (0-1) + socialAnxiety: number; // Affects reactions in social situations (0-1) + attachmentStyle: 'secure' | 'anxious' | 'avoidant' | 'fearful'; + expressiveness: number; // How readily emotions are shown (0-1) +} + +export interface EmotionalContext { + currentState: EmotionalState; + recentHistory: EmotionalState[]; + relationships: Map; + situationalFactors: SituationContext; + personalityModifiers: PersonalityTraits; +} + +export interface EmotionalTrigger { + trigger: string; + emotion: keyof EmotionalState; + intensity: number; + response_style: string; +} + +export interface EmotionalMemory { + timestamp: number; + userId: string; + emotion: keyof EmotionalState; + intensity: number; + trigger: string; + context: Partial; +} + +export interface EmotionalExpression { + minScore: number; + expressions: string[]; + priority?: number; +} + +export interface PersonalityConfig { + type: 'kuudere' | 'tsundere' | 'dandere' | 'deredere'; + emotionalMemoryLength: number; + baselineRecoveryRate: number; + expressionThresholds: { + [key in keyof EmotionalState]?: number; + }; + maxIntensities: { + [key in keyof EmotionalState]?: number; + }; + decayRates: { + [key in keyof EmotionalState]?: number; + }; +} + +// Emotional Interaction System +export interface EmotionalInteraction { + targetEmotion: keyof EmotionalState; + effect: number; // Multiplier for the effect + threshold?: number; // Minimum source emotion level to trigger + decay?: number; // How quickly the interaction effect fades +} + +export interface EmotionalInteractions { + [sourceEmotion: string]: { + [targetEmotion: string]: EmotionalInteraction; + }; +} diff --git a/plugin-feel/package.json b/plugin-feel/package.json new file mode 100644 index 00000000000..ab05eb69c94 --- /dev/null +++ b/plugin-feel/package.json @@ -0,0 +1,18 @@ +{ + "name": "@ai16z/plugin-feel", + "version": "0.0.1", + "main": "dist/index.js", + "type": "module", + "types": "dist/index.d.ts", + "dependencies": { + "@ai16z/eliza": "workspace:*", + "tsup": "^8.3.5" + }, + "scripts": { + "build": "tsup --format esm --dts", + "dev": "tsup --watch" + }, + "peerDependencies": { + "whatwg-url": "7.1.0" + } +} diff --git a/plugin-feel/src/evaluators/index.ts b/plugin-feel/src/evaluators/index.ts new file mode 100644 index 00000000000..32817a9bb03 --- /dev/null +++ b/plugin-feel/src/evaluators/index.ts @@ -0,0 +1 @@ +export { sentimentEvaluator } from "./sentiment.ts"; diff --git a/plugin-feel/src/evaluators/sentiment.ts b/plugin-feel/src/evaluators/sentiment.ts new file mode 100644 index 00000000000..9244acf56d6 --- /dev/null +++ b/plugin-feel/src/evaluators/sentiment.ts @@ -0,0 +1,159 @@ +import { composeContext } from "@ai16z/eliza/src/context.ts"; +import { generateObjectArray } from "@ai16z/eliza/src/generation.ts"; +import { MemoryManager } from "@ai16z/eliza"; +import { + IAgentRuntime, + Memory, + ModelClass, + Evaluator, +} from "@ai16z/eliza"; + +const sentimentTemplate = `TASK: Analyze the user's message tone and intent towards Ming (the agent) and determine how it affects Ming's emotional state. + +# CONTEXT +Ming is a Kuudere character who: +- Is naturally cold and distant (high disdain, low warmth) +- Takes time to warm up to people (slow trust growth) +- Maintains emotional distance by default +- Shows subtle reactions rather than dramatic displays + +# START OF EXAMPLES +Example evaluations: +[ + { + "tone": "friendly", + "intent": "trying to get closer", + "emotional_impact": { + "disdain": -0.1, // Slightly reduces disdain + "trust": 0.05, // Very slightly increases trust + "warmth": 0.02, // Barely increases warmth + "calm": 0 // Maintains calm + }, + "reason": "User is being friendly but Ming maintains emotional distance as per her Kuudere nature" + }, + { + "tone": "hostile", + "intent": "confrontational", + "emotional_impact": { + "disdain": 0.2, // Increases disdain + "trust": -0.15, // Decreases trust + "warmth": -0.1, // Decreases warmth + "calm": -0.2 // Decreases calm + }, + "reason": "User's hostility reinforces Ming's natural tendency towards coldness" + } +] +# END OF EXAMPLES + +# INSTRUCTIONS +Analyze the recent messages and determine: +1. The user's tone towards Ming +2. The user's apparent intent +3. How this affects Ming's emotional state (changes in disdain, trust, warmth, and calm) +4. The reason for these emotional changes + +Recent Messages: +{{recentMessages}} + +Response should be a JSON object inside a JSON markdown block. Values should be between -0.3 and 0.3 per interaction: +\`\`\`json +{ + "tone": string, + "intent": string, + "emotional_impact": { + "disdain": number, + "trust": number, + "warmth": number, + "calm": number + }, + "reason": string +} +\`\`\``; + +async function handler(runtime: IAgentRuntime, message: Memory) { + const state = await runtime.composeState(message); + const { agentId, roomId } = state; + + const context = composeContext({ + state, + template: sentimentTemplate + }); + const evaluation = await generateObjectArray(runtime, context, ModelClass.SMART); + + if (!evaluation || !evaluation[0]) { + return null; + } + + const sentimentEval = evaluation[0]; + + // Create a text summary of the emotional impact + const summaryText = `Tone: ${sentimentEval.tone}\nIntent: ${sentimentEval.intent}\nImpact: ${sentimentEval.reason}`; + + // Store the sentiment evaluation with embedding + const memoryManager = new MemoryManager({ + runtime, + tableName: "emotional_states", + }); + + const sentimentMemory = await memoryManager.addEmbeddingToMemory({ + userId: message.userId, + agentId, + content: { + text: summaryText, + evaluation: sentimentEval + }, + roomId, + createdAt: Date.now(), + type: "sentiment_evaluation" + }); + + // Persist the memory + await memoryManager.createMemory(sentimentMemory, true); + + // Add a small delay to ensure proper storage + await new Promise((resolve) => setTimeout(resolve, 250)); + + return sentimentEval; +} + +async function validate( + runtime: IAgentRuntime, + message: Memory +): Promise { + return true; // Always evaluate sentiment +} + +export const sentimentEvaluator: Evaluator = { + name: "EVALUATE_SENTIMENT", + similes: ["ANALYZE_TONE", "CHECK_EMOTIONS"], + description: "Evaluates how the user's message affects Ming's emotional state towards them", + handler, + validate, + examples: [ + { + context: `Actors in the scene: +{{user1}}: A user who has been interacting with Ming. +Ming: A Kuudere character who is naturally cold and distant. + +Facts about the actors: +Ming maintains emotional distance by default.`, + messages: [ + { + user: "{{user1}}", + content: { text: "You're always so cold and mean! Why can't you be nicer?" }, + }, + ], + evaluation: { + tone: "accusatory", + intent: "demanding emotional change", + emotional_impact: { + disdain: 0.2, + trust: -0.1, + warmth: -0.15, + calm: -0.1 + }, + reason: "User's demand for emotional change increases Ming's disdain and reduces warmth, as she strongly maintains her Kuudere nature" + }, + }, + ], +}; diff --git a/plugin-feel/src/index.ts b/plugin-feel/src/index.ts new file mode 100644 index 00000000000..c6a2ab3ae5b --- /dev/null +++ b/plugin-feel/src/index.ts @@ -0,0 +1,11 @@ +import { Plugin } from "@ai16z/eliza"; +import { sentimentEvaluator } from "./evaluators/sentiment.ts"; +import { sentimentProvider } from "./providers/sentiment.ts"; + +export const feelPlugin: Plugin = { + name: "feel", + description: "Tracks and manages Ming's emotional state towards users based on their interactions", + actions: [], // No custom actions needed yet + evaluators: [sentimentEvaluator], + providers: [sentimentProvider], +}; diff --git a/plugin-feel/src/providers/index.ts b/plugin-feel/src/providers/index.ts new file mode 100644 index 00000000000..37e1a5d2460 --- /dev/null +++ b/plugin-feel/src/providers/index.ts @@ -0,0 +1 @@ +export { sentimentProvider } from "./sentiment.ts"; diff --git a/plugin-feel/src/providers/sentiment.ts b/plugin-feel/src/providers/sentiment.ts new file mode 100644 index 00000000000..4142ce18c5e --- /dev/null +++ b/plugin-feel/src/providers/sentiment.ts @@ -0,0 +1,122 @@ +import { embed } from "@ai16z/eliza/src/embedding.ts"; +import { MemoryManager } from "@ai16z/eliza"; +import { formatMessages } from "@ai16z/eliza/src/messages.ts"; +import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; + +interface EmotionalState { + userId: string; + emotions: { + [key: string]: number; // maps emotion name to current value + }; + lastInteraction: string; // timestamp + overallSentiment: string; // e.g., "cold", "neutral", "warming" +} + +// How much emotions decay per hour of inactivity +const EMOTION_DECAY_RATES = { + trust: -0.1, // Trust decays moderately fast + warmth: -0.15, // Warmth decays faster (back to cold default) + disdain: 0.05, // Disdain slowly increases + calm: 0.1 // Calm slowly recovers +}; + +// Calculate emotional decay based on time passed +function calculateEmotionalDecay(lastInteraction: string): { [key: string]: number } { + const hoursPassed = (Date.now() - new Date(lastInteraction).getTime()) / (1000 * 60 * 60); + const decay: { [key: string]: number } = {}; + + Object.entries(EMOTION_DECAY_RATES).forEach(([emotion, ratePerHour]) => { + decay[emotion] = ratePerHour * hoursPassed; + }); + + return decay; +} + +// Determine overall sentiment based on emotional state +function determineOverallSentiment(emotions: { [key: string]: number }): string { + const { trust, warmth, disdain } = emotions; + + if (trust < 0.2 && warmth < 0.2 && disdain > 0.6) return "hostile"; + if (trust < 0.3 && warmth < 0.2) return "cold"; + if (trust > 0.3 && warmth > 0.2) return "warming"; + if (trust > 0.4 && warmth > 0.3) return "friendly"; + + return "neutral"; +} + +const sentimentProvider: Provider = { + get: async (runtime: IAgentRuntime, message: Memory, state?: State) => { + const userId = message.userId; + + const memoryManager = new MemoryManager({ + runtime, + tableName: "emotional_states", + }); + + // Get recent sentiment evaluations for this user + const recentEvaluations = await memoryManager.getMemories({ + userId, + roomId: message.roomId, + count: 10, // Get last 10 evaluations + agentId: runtime.agentId, + type: "sentiment_evaluation" + }); + + // Initialize with default emotional state + let currentState: EmotionalState = { + userId, + emotions: { + calm: runtime.character.emotionalArchetype.calm.maxValue, + disdain: runtime.character.emotionalArchetype.disdain.maxValue * 0.5, + trust: 0, + warmth: 0 + }, + lastInteraction: new Date().toISOString(), + overallSentiment: "cold" + }; + + if (recentEvaluations.length > 0) { + // Get the most recent state + const lastEvaluation = recentEvaluations[0]; + const lastState = lastEvaluation.content.evaluation; + + // Apply emotional decay based on time since last interaction + const decay = calculateEmotionalDecay(lastEvaluation.createdAt.toString()); + + // Update emotions based on decay and character's emotional limits + Object.entries(currentState.emotions).forEach(([emotion, value]) => { + const maxValue = runtime.character.emotionalArchetype[emotion]?.maxValue || 1.0; + const decayValue = decay[emotion] || 0; + + // Apply decay and ensure within bounds [0, maxValue] + currentState.emotions[emotion] = Math.max(0, Math.min(maxValue, value + decayValue)); + }); + + // Update last interaction time + currentState.lastInteraction = new Date().toISOString(); + } + + // Update overall sentiment + currentState.overallSentiment = determineOverallSentiment(currentState.emotions); + + // Format response for agent's context + return `Ming's emotional state towards ${message.userId}: +Current Feelings: +- Disdain: ${currentState.emotions.disdain.toFixed(2)} ${currentState.emotions.disdain > 0.6 ? "(Very High)" : currentState.emotions.disdain > 0.4 ? "(High)" : "(Moderate)"} +- Trust: ${currentState.emotions.trust.toFixed(2)} ${currentState.emotions.trust > 0.4 ? "(Warming Up)" : "(Guarded)"} +- Warmth: ${currentState.emotions.warmth.toFixed(2)} ${currentState.emotions.warmth > 0.3 ? "(Showing Warmth)" : "(Cold)"} +- Calm: ${currentState.emotions.calm.toFixed(2)} ${currentState.emotions.calm > 0.7 ? "(Very Composed)" : "(Slightly Agitated)"} + +Overall Disposition: ${currentState.overallSentiment.toUpperCase()} +Last Interaction: ${new Date(currentState.lastInteraction).toLocaleString()} + +Instructions: +${currentState.overallSentiment === "hostile" ? "- Be overtly cold and dismissive" : + currentState.overallSentiment === "cold" ? "- Maintain emotional distance and show mild disdain" : + currentState.overallSentiment === "warming" ? "- Show subtle signs of accepting their presence" : + currentState.overallSentiment === "friendly" ? "- Display reserved but genuine warmth" : + "- Remain neutral but distant"}`; + }, +}; + +export { sentimentProvider }; diff --git a/plugin-feel/tsconfig.json b/plugin-feel/tsconfig.json new file mode 100644 index 00000000000..ea7ea435e3e --- /dev/null +++ b/plugin-feel/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": ".", + "types": ["node"] + }, + "include": ["src"] +} diff --git a/plugin-feel/tsup.config.ts b/plugin-feel/tsup.config.ts new file mode 100644 index 00000000000..e42bf4efeae --- /dev/null +++ b/plugin-feel/tsup.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/index.ts"], + outDir: "dist", + sourcemap: true, + clean: true, + format: ["esm"], // Ensure you're targeting CommonJS + external: [ + "dotenv", // Externalize dotenv to prevent bundling + "fs", // Externalize fs to use Node.js built-in module + "path", // Externalize other built-ins if necessary + "@reflink/reflink", + "@node-llama-cpp", + "https", + "http", + "agentkeepalive", + // Add other modules you want to externalize + ], +});