-
Notifications
You must be signed in to change notification settings - Fork 159
feat: implement embodied EmotionEngine #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jhawpetoss6-collab
wants to merge
1
commit into
Project-N-E-K-O:main
Choose a base branch
from
jhawpetoss6-collab:strike/emotion-state-engine
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
表情符号会和角色模板冲突喵!这都不检查一下的吗~
看看
config/prompts_chara.py:97写的什么喵:但是你这里 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