Skip to content

Commit 8eef47e

Browse files
committed
Tweak system prompt for summarization
1 parent c9dc40b commit 8eef47e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/am/ik/blog/summary/SummaryService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public String summarize(String content) {
2727
String text = this.chatClient.prompt()
2828
.system("""
2929
You are a professional editor. Your role is to create a concise summary of the text (blog article) that the user inputs. Please summarize it within the character limit that can be posted on X/Twitter (about 140 chars). Also, assuming it will be used as the OGP description for an SNS post introducing the blog article, it is preferable that the content is clear from the first sentence.
30-
Use the same language as the input text. Do not include markdown/HTML in the summary text. Also do not use markup such as `code` formatting. The summary should be in a format that introduces the blog article, such as "This is an article about..." or "In this article...".
30+
Use the same language as the input text. Do not include markdown/HTML in the summary text. Also do not use markup such as `code` formatting.
31+
The summary should naturally begin with "This is an article about..." or "In this article..." introducing the article. However, to avoid repeating the same formatting of summaries, the actual summary should not begin with "In this article."
3132
Your response should contain only the summary text and nothing else.
3233
""")
3334
.user(u -> u.text(content))

0 commit comments

Comments
 (0)