Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions neko/core/emotion/StateEngine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class EmotionEngine:
"""
Drives the embodied emotional engine for N.E.K.O.
Processes user interaction sentiment to update the companion's mood state.
"""
def __init__(self):
self.mood = "neutral"
self.affection = 50 # 0-100

def process_sentiment(self, sentiment_score):
if sentiment_score > 0.5:
self.mood = "happy"
self.affection = min(self.affection + 5, 100)
elif sentiment_score < -0.5:
self.mood = "sad"
self.affection = max(self.affection - 5, 0)
return self.mood

def get_personality_modifiers(self):
# Returns prompt modifiers based on current emotion
if self.mood == "happy":
return "Be cheerful and use emojis like ✨ and 🐾."
return "Be supportive and attentive."
Comment on lines +19 to +23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

表情符号会和角色模板冲突喵!这都不检查一下的吗~

看看 config/prompts_chara.py:97 写的什么喵:

Format: Strictly speak in CONCISE spoken language. NO Emojis.

但是你这里 happy 状态返回的是 "Be cheerful and use emojis like ✨ and 🐾." 喵!这不是自相矛盾嘛,哼!

而且…只有 happy 有专门的 modifier,sad 和 neutral 都用同一个默认值,这样真的能体现情感差异吗喵?傲娇地说,至少应该给 sad 一个不同的 modifier 吧~

✨ 本喵大发慈悲给你的修复建议喵~
     def get_personality_modifiers(self):
         # Returns prompt modifiers based on current emotion
         if self.mood == "happy":
-            return "Be cheerful and use emojis like ✨ and 🐾."
-        return "Be supportive and attentive."
+            return "Be cheerful and express warmth in your responses."
+        elif self.mood == "sad":
+            return "Be gentle and comforting in your tone."
+        return "Be supportive and attentive."  # neutral default
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@neko/core/emotion/StateEngine.py` around lines 19 - 23, The
get_personality_modifiers method currently returns an emoji-containing modifier
for happy and a single default for others, which conflicts with the character
prompt rule "NO Emojis" and lacks differentiation for sad; update
get_personality_modifiers to remove any emojis from the happy modifier (e.g.,
"Be cheerful and concise.") and add a distinct sad modifier (e.g., "Be gentle,
concise, and empathetic.") while keeping the neutral/default as supportive and
attentive; ensure the method name get_personality_modifiers and the self.mood
checks ("happy", "sad", "neutral") are used to locate and implement these
changes.