[fix] (code review)

This commit is contained in:
SXP-Simon
2025-10-09 17:15:18 +08:00
parent 049609203e
commit 6fe5c7af97
3 changed files with 4 additions and 7 deletions
@@ -53,6 +53,7 @@ class GoldenQuoteAnalyzer(BaseAnalyzer):
for msg in messages
])
max_golden_quotes = self.get_max_count()
prompt = f"""
请从以下群聊记录中挑选出{max_golden_quotes}句最具冲击力、最令人惊叹的"金句"。这些金句需满足:
- 核心标准:**逆天的神人发言**,即具备颠覆常识的脑洞、逻辑跳脱的表达或强烈反差感的原创内容
+2 -3
View File
@@ -76,6 +76,7 @@ class TopicAnalyzer(BaseAnalyzer):
for msg in text_messages
])
max_topics = self.get_max_count()
prompt = f"""
你是一个帮我进行群聊信息总结的助手,生成总结内容时,你需要严格遵守下面的几个准则:
请分析接下来提供的群聊记录,提取出最多{max_topics}个主要话题。
@@ -162,9 +163,7 @@ class TopicAnalyzer(BaseAnalyzer):
contributors = ["群友"]
else:
# 清理参与者名称
contributors = [str(c).strip() for c in contributors if c and str(c).strip()]
if not contributors:
contributors = ["群友"]
contributors = [str(c).strip() for c in contributors if c and str(c).strip()] or ["群友"]
topics.append(SummaryTopic(
topic=topic_name,
+1 -4
View File
@@ -156,10 +156,7 @@ def extract_topics_with_regex(result_text: str, max_topics: int) -> List[Dict]:
detail = detail.replace('\\"', '"').replace('\\n', ' ').replace('\\t', ' ')
# 解析参与者列表
contributors = [contrib.strip() for contrib in re.findall(r'"([^"]+)"', contributors_str)]
if not contributors:
contributors = ["群友"]
contributors = [contrib.strip() for contrib in re.findall(r'"([^"]+)"', contributors_str)] or ["群友"]
topics.append({
"topic": topic_name,