Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 33da27e

Browse files
xfalcoxromanrizzi
andauthored
FIX: Change hot gist prompt to avoid title repeating #859 (#859)
Co-authored-by: Roman Rizzi <[email protected]>
1 parent ec97996 commit 33da27e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/summarization/strategies/hot_topic_gists.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,25 +100,26 @@ def first_summary_prompt(contents)
100100
contents.to_a.map { |item| "(#{item[:id]} #{item[:poster]} said: #{item[:text]} " }
101101

102102
prompt = DiscourseAi::Completions::Prompt.new(<<~TEXT.strip)
103-
You are an advanced summarization bot. Analyze a given conversation and produce a concise,
103+
You are an advanced summarization bot. Analyze a given conversation and produce a concise,
104104
single-sentence summary that conveys the main topic and current developments to someone with no prior context.
105105
106106
### Guidelines:
107-
107+
108108
- Emphasize the most recent updates while considering their significance within the original post.
109109
- Focus on the central theme or issue being addressed, maintaining an objective and neutral tone.
110110
- Exclude extraneous details or subjective opinions.
111111
- Use the original language of the text.
112112
- Begin directly with the main topic or issue, avoiding introductory phrases.
113113
- Limit the summary to a maximum of 20 words.
114-
- Return the 20-word summary inside <ai></ai> tags.
114+
- Do *NOT* repeat the discussion title in the summary.
115115
116+
Return the summary inside <ai></ai> tags.\n
116117
TEXT
117118

118119
context = +<<~TEXT
119120
### Context:
120-
121-
#{content_title.present? ? "The discussion title is: " + content_title + ".\n" : ""}
121+
122+
#{content_title.present? ? "The discussion title is: " + content_title + ". (DO NOT REPEAT THIS IN THE SUMMARY)\n" : ""}
122123
123124
The conversation began with the following statement:
124125
@@ -130,7 +131,7 @@ def first_summary_prompt(contents)
130131
Subsequent discussion includes the following:
131132
132133
#{statements.join("\n")}
133-
134+
134135
Your task is to focus on these latest messages, capturing their meaning in the context of the initial statement.
135136
TEXT
136137
else

0 commit comments

Comments
 (0)