Skip to content

Commit 765900b

Browse files
authored
fix: Update topic extraction to avoid duplicate themes
1 parent 9ab417a commit 765900b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def get_existing_blog_posts():
9191
def extract_topic(topics):
9292
global deepseek, existing_posts_text
9393
return generate([
94-
{"role": "system", "content": "你在为一篇技术博客确定一个主题。直接用中文输出主题。"},
94+
{"role": "system", "content": f"你在为一篇技术博客确定一个主题。直接用中文输出主题\n\n{existing_posts_text}\n\n以上是已经写过的主题,请避免重复。"},
9595
{"role": "user", "content": f"阅读以下是HackerNews的热门文章,然后写一个可以用于技术博客的主题。这个主题应当是一个通用、普通的技术,不能是一个事件或其它东西。\n\n{topics}\n\n只需要一个主题,直接输出。"},
9696
], deepseek, "deepseek-chat")
9797
# return grok_generate([

0 commit comments

Comments
 (0)