update
This commit is contained in:
@@ -123,20 +123,22 @@ export class EmotionAIService {
|
||||
// 发送情绪初始化完成事件
|
||||
Utils.sendInnerMsg(InnerMsgCode.Chat_EmotionInitialized, {
|
||||
roleId: roleId,
|
||||
emotion: emotionalState
|
||||
emotion: emotionalState,
|
||||
});
|
||||
|
||||
console.log(`Emotion initialization completed for role ${roleId}: ${VideoEmotion[emotionalState]}`);
|
||||
console.log(
|
||||
`Emotion initialization completed for role ${roleId}: ${VideoEmotion[emotionalState]}`
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`Failed to initialize emotion analysis for role ${roleId}:`,
|
||||
error
|
||||
);
|
||||
|
||||
|
||||
// 即使发生错误,也发送默认情绪状态
|
||||
Utils.sendInnerMsg(InnerMsgCode.Chat_EmotionInitialized, {
|
||||
roleId: roleId,
|
||||
emotion: VideoEmotion.calm_down
|
||||
emotion: VideoEmotion.calm_down,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -382,7 +384,7 @@ export class EmotionAIService {
|
||||
// 发送情绪更新完成事件
|
||||
Utils.sendInnerMsg(InnerMsgCode.Chat_EmotionUpdated, {
|
||||
roleId: roleId,
|
||||
emotion: newEmotion
|
||||
emotion: newEmotion,
|
||||
});
|
||||
|
||||
return newEmotion;
|
||||
@@ -411,12 +413,12 @@ export class EmotionAIService {
|
||||
aiResponse: string,
|
||||
currentEmotion: VideoEmotion
|
||||
): string {
|
||||
const roleName = this.getRoleEnglishName(roleId);
|
||||
//const roleName = this.getRoleEnglishName(roleId);
|
||||
|
||||
let analysisText = `当前情绪状态: ${VideoEmotion[currentEmotion]}\n\n`;
|
||||
analysisText += `请分析以下最新对话的情绪变化,返回对应的VideoEmotion枚举值:\n\n`;
|
||||
analysisText += `用户: ${userMessage}\n`;
|
||||
analysisText += `${roleName}: ${aiResponse}\n\n`;
|
||||
analysisText += `user: ${userMessage}\n`;
|
||||
analysisText += `model: ${aiResponse}\n\n`;
|
||||
analysisText += `请基于对话内容和当前情绪状态,返回以下枚举值之一:calm_down, arousal, desire, passion, orgasm`;
|
||||
|
||||
return analysisText;
|
||||
|
||||
Reference in New Issue
Block a user