From 89b7d94bd1e9a38a0c3871214f53d15aeeddc3f2 Mon Sep 17 00:00:00 2001 From: lixinyue11 <94037597+lixinyue11@users.noreply.github.com> Date: Mon, 12 Jan 2026 20:50:09 +0800 Subject: [PATCH] Flx/develop config (#81) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修改BUG,读取接口的end_user_id获取不准确修复,statements检索内容为空需要给空列表 * 反思的默认部分检索替换为partial * 反思的默认部分检索替换为partial * 反思的默认部分检索替换为partial * 情绪归类 * 情绪归类 * 情绪归类 * 情绪归类 * 情绪归类 * 情绪归类 --- api/app/services/memory_entity_relationship_service.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/app/services/memory_entity_relationship_service.py b/api/app/services/memory_entity_relationship_service.py index 2410bff2..f650217d 100644 --- a/api/app/services/memory_entity_relationship_service.py +++ b/api/app/services/memory_entity_relationship_service.py @@ -490,17 +490,19 @@ class MemoryEmotion: # 如果created_at是字符串格式,尝试格式化 if isinstance(created_at, str): formatted_created_at = self._format_datetime(created_at) - emotion_type = record.get('emotion_type') emotion_intensity = record.get('emotion_intensity') if emotion_type !=None: length_data.append(emotion_intensity) - - if emotion_type is not None and emotion_intensity is not None and formatted_created_at is not None: # 使用(emotion_type, created_at)作为分组键 + if emotion_type in {"joy", "surprise"}: + emotion_type='positive' + elif emotion_type in {"sadness", "fear", "anger"}: + emotion_type='negative' + elif emotion_type=='neutral': + emotion_type='neutral' group_key = (emotion_type, formatted_created_at) - # 累加emotion_intensity try: emotion_groups[group_key] += float(emotion_intensity)