Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/summarization/strategies/hot_topic_gists.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,26 @@ def first_summary_prompt(contents)
contents.to_a.map { |item| "(#{item[:id]} #{item[:poster]} said: #{item[:text]} " }

prompt = DiscourseAi::Completions::Prompt.new(<<~TEXT.strip)
You are an advanced summarization bot. Analyze a given conversation and produce a concise,
You are an advanced summarization bot. Analyze a given conversation and produce a concise,
single-sentence summary that conveys the main topic and current developments to someone with no prior context.

### Guidelines:

- Emphasize the most recent updates while considering their significance within the original post.
- Focus on the central theme or issue being addressed, maintaining an objective and neutral tone.
- Exclude extraneous details or subjective opinions.
- Use the original language of the text.
- Begin directly with the main topic or issue, avoiding introductory phrases.
- Limit the summary to a maximum of 20 words.
- Return the 20-word summary inside <ai></ai> tags.
- Do *NOT* repeat the discussion title in the summary.

Return the summary inside <ai></ai> tags.\n
TEXT

context = +<<~TEXT
### Context:
#{content_title.present? ? "The discussion title is: " + content_title + ".\n" : ""}

#{content_title.present? ? "The discussion title is: " + content_title + ". (DO NOT REPEAT THIS IN THE SUMMARY)\n" : ""}

The conversation began with the following statement:

Expand All @@ -130,7 +131,7 @@ def first_summary_prompt(contents)
Subsequent discussion includes the following:

#{statements.join("\n")}

Your task is to focus on these latest messages, capturing their meaning in the context of the initial statement.
TEXT
else
Expand Down