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

Commit fb9394b

Browse files
committed
fix tests, rename setting 6
1 parent 9dad651 commit fb9394b

File tree

13 files changed

+143
-19
lines changed

13 files changed

+143
-19
lines changed

app/jobs/regular/fast_track_topic_gist.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class FastTrackTopicGist < ::Jobs::Base
77
def execute(args)
88
return if !SiteSetting.discourse_ai_enabled
99
return if !SiteSetting.ai_summarization_enabled
10-
return if SiteSetting.ai_summarize_max_topic_gists_per_batch.zero?
10+
return if SiteSetting.ai_summary_gists_enabled
1111

1212
topic = Topic.find_by(id: args[:topic_id])
1313
return if topic.blank?

config/locales/server.de.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ de:
8585
ai_summarization_model: "Modell, das für die Zusammenfassung verwendet werden soll."
8686
ai_custom_summarization_allowed_groups: "Gruppen, die neue Zusammenfassungen erstellen dürfen."
8787
ai_pm_summarization_allowed_groups: "Gruppen können Zusammenfassungen in PMs erstellen und ansehen."
88-
ai_summarize_max_topic_gists_per_batch: "Nach der Aktualisierung der Themen in der angesagten Liste erstellen wir kurze Zusammenfassungen der ersten N Themen. (Deaktiviert, wenn 0)"
88+
ai_summary_gists_enabled: "Nach der Aktualisierung der Themen in der angesagten Liste erstellen wir kurze Zusammenfassungen der ersten N Themen. (Deaktiviert, wenn 0)"
8989
ai_hot_topic_gists_allowed_groups: "Gruppen, die die wichtigsten Themen in der Liste der aktuellen Themen sehen dürfen."
9090
ai_summary_backfill_maximum_topics_per_hour: "Anzahl der Themenzusammenfassungen, die pro Stunde aufgefüllt werden müssen."
9191
ai_bot_enabled: "Aktiviere das KI-Bot-Modul."

config/locales/server.en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ en:
8686
ai_summarization_model: "Model to use for summarization."
8787
ai_custom_summarization_allowed_groups: "Groups allowed to use create new summaries."
8888
ai_pm_summarization_allowed_groups: "Groups allowed to create and view summaries in PMs."
89-
ai_summarize_max_topic_gists_per_batch: "After updating topics in the hot list, we'll generate brief summaries of the first N ones. (Disabled when 0)"
89+
ai_summary_gists_enabled: "After updating topics in the hot list, we'll generate brief summaries of the first N ones. (Disabled when 0)"
9090
ai_hot_topic_gists_allowed_groups: "Groups allowed to see gists in the hot topics list."
9191
ai_summary_backfill_maximum_topics_per_hour: "Number of topic summaries to backfill per hour."
9292

config/locales/server.he.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ he:
8484
ai_summarization_model: "מודל לשימוש לסיכום."
8585
ai_custom_summarization_allowed_groups: "קבוצות שמורשות להשתמש ליצירת סיכומים חדשים."
8686
ai_pm_summarization_allowed_groups: "קבוצות שמורשות ליצור ולצפות בתקצירים בהודעות פרטיות."
87-
ai_summarize_max_topic_gists_per_batch: "לאחר עדכון הנושאים ברשימה החמה, נייצר תקצירים של N הראשונים. (0 להשבתה)"
87+
ai_summary_gists_enabled: "לאחר עדכון הנושאים ברשימה החמה, נייצר תקצירים של N הראשונים. (0 להשבתה)"
8888
ai_hot_topic_gists_allowed_groups: "קבוצות שמורשות לראות gists ברשימת הנושאים החמים."
8989
ai_summary_backfill_maximum_topics_per_hour: "מספר תקצירי הנושאים למילוי חוזר בשעה."
9090
ai_bot_enabled: "הפעלת מודול בוט הבינה המלאכותית."

config/locales/server.uk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ uk:
8484
ai_summarization_model: "Модель для узагальнення."
8585
ai_custom_summarization_allowed_groups: "Групи, яким дозволено створювати нові зведення."
8686
ai_pm_summarization_allowed_groups: "Групи дозволили створювати та переглядати підсумки в особистих повідомленнях."
87-
ai_summarize_max_topic_gists_per_batch: "Після оновлення тем у гарячому списку ми згенеруємо короткі підсумки перших N. (Вимкнено, коли 0)"
87+
ai_summary_gists_enabled: "Після оновлення тем у гарячому списку ми згенеруємо короткі підсумки перших N. (Вимкнено, коли 0)"
8888
ai_hot_topic_gists_allowed_groups: "Групи, яким дозволено бачити суть у списку гарячих тем."
8989
ai_summary_backfill_maximum_topics_per_hour: "Кількість підсумків тем для заповнення на годину."
9090
ai_bot_enabled: "Увімкніть модуль AI Bot."

config/settings.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,10 @@ discourse_ai:
364364
type: group_list
365365
list_type: compact
366366
default: "3|13" # 3: @staff, 13: @trust_level_3
367-
ai_summarize_max_topic_gists_per_batch:
368-
default: 0
369-
min: 0
370-
max: 1000
367+
ai_summary_gists_enabled:
368+
default: false
371369
hidden: true
372-
ai_hot_topic_gists_allowed_groups:
370+
ai_summary_gists_allowed_groups:
373371
type: group_list
374372
list_type: compact
375373
default: ""

db/migrate/20241126033812_rename_ai_gist_batch_setting.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
class RenameAiGistBatchSetting < ActiveRecord::Migration[7.0]
44
def up
5-
execute "UPDATE site_settings SET name = 'ai_summarize_max_topic_gists_per_batch' WHERE name = 'ai_summarize_max_hot_topics_gists_per_batch'"
5+
execute "UPDATE site_settings SET name = 'ai_summary_gists_allowed_groups' WHERE name = 'ai_hot_topic_gists_allowed_groups'"
66
end
77

88
def down
9-
execute "UPDATE site_settings SET name = 'ai_summarize_max_hot_topics_gists_per_batch' WHERE name = 'ai_summarize_max_topic_gists_per_batch'"
9+
execute "UPDATE site_settings SET name = 'ai_hot_topic_gists_allowed_groups' WHERE name = 'ai_summary_gists_allowed_groups'"
1010
end
1111
end

lib/guardian_extensions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def can_see_summary?(target)
2323

2424
def can_see_gists?
2525
return false if !SiteSetting.ai_summarization_enabled
26-
return false if SiteSetting.ai_summarize_max_topic_gists_per_batch.zero?
26+
return false if SiteSetting.ai_summary_gists_enabled
2727
if SiteSetting.ai_hot_topic_gists_allowed_groups.to_s == Group::AUTO_GROUPS[:everyone].to_s
2828
return true
2929
end

lib/summarization/entry_point.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def inject_into(plugin)
1919

2020
plugin.register_modifier(:topic_query_create_list_topics) do |topics, options|
2121
if Discourse.filters.include?(options[:filter]) && SiteSetting.ai_summarization_enabled &&
22-
SiteSetting.ai_summarize_max_topic_gists_per_batch > 0
22+
SiteSetting.ai_summary_gists_enabled
2323
topics.includes(:ai_gist_summary)
2424
else
2525
topics
@@ -39,7 +39,7 @@ def inject_into(plugin)
3939
# jobs if the feature is disabled.
4040
plugin.on(:post_created) do |post|
4141
if SiteSetting.discourse_ai_enabled && SiteSetting.ai_summarization_enabled &&
42-
SiteSetting.ai_summarize_max_topic_gists_per_batch > 0 && post.topic
42+
SiteSetting.ai_summary_gists_enabled > 0 && post.topic
4343
Jobs.enqueue(:fast_track_topic_gist, topic_id: post&.topic_id)
4444
end
4545
end

spec/jobs/regular/fast_track_topic_gist_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
before do
1010
assign_fake_provider_to(:ai_summarization_model)
1111
SiteSetting.ai_summarization_enabled = true
12-
SiteSetting.ai_summarize_max_topic_gists_per_batch = 100
12+
SiteSetting.ai_summary_gists_enabled = true
1313
end
1414

1515
context "when the topic has a gist" do

0 commit comments

Comments
 (0)