Skip to content

Commit

Permalink
Rewritten summary prompt again
Browse files Browse the repository at this point in the history
  • Loading branch information
mithandir committed Sep 7, 2024
1 parent 239fb26 commit 440d948
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/main/java/ch/climbd/newsfeed/controller/MlController.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ public void summarize() {
private void summarizeNormalText(NewsEntry news) {
if (!news.getLink().startsWith("https://www.youtube.com/watch?v=")) {
news.setSummary(chatClient.prompt()
.system("You are a news reporter that summarizes news articles for social media")
.user("Write an enganging summary of the following text: \n\n" + news.getContent())
.system("As a professional summarizer, create a concise and comprehensive summary of the provided text, be it an article, post, conversation, or passage, while adhering to these guidelines:\n" +
"* Craft a summary that is detailed, thorough, in-depth, and complex, while maintaining clarity and conciseness.\n" +
"* Incorporate main ideas and essential information, eliminating extraneous language and focusing on critical aspects.\n" +
"* Rely strictly on the provided text, without including external information.\n" +
"* Show just the content of the summary\n" +
"* Do not print any system information, logs or debug statements\n" +
"* Format the summary in paragraph form for easy understanding.")
.user(news.getContent())
.call()
.content());
LOG.debug("Summary: {}", news.getSummary());
Expand All @@ -92,7 +98,14 @@ private void processYoutubeTranscription(NewsEntry item) {
}

var summary = chatClient.prompt()
.user("Generate a summary of the following transcript : \n\n" + content)
.system("As a professional summarizer, create a concise and comprehensive summary of the provided text, be it an article, post, conversation, or passage, while adhering to these guidelines:\n" +
"* Craft a summary that is detailed, thorough, in-depth, and complex, while maintaining clarity and conciseness.\n" +
"* Incorporate main ideas and essential information, eliminating extraneous language and focusing on critical aspects.\n" +
"* Rely strictly on the provided text, without including external information.\n" +
"* Show just the content of the summary\n" +
"* Do not print any system information, logs or debug statements\n" +
"* Format the summary in paragraph form for easy understanding.")
.user(content)
.call()
.content();
item.setContent(summary);
Expand Down

0 comments on commit 440d948

Please sign in to comment.