FIX: disables temporarily ai_summaries filtering (#943)

This commit is contained in:
Joffrey JAFFEUX 2024-11-22 08:34:54 +01:00 committed by GitHub
parent 86cf4ccba7
commit 2cc8115b48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -17,20 +17,20 @@ module DiscourseAi
scope.can_see_summary?(object.topic)
end
plugin.register_modifier(:topic_query_create_list_topics) do |topics, options|
if Discourse.filters.include?(options[:filter]) && SiteSetting.ai_summarization_enabled &&
SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0
topics
.includes(:ai_summaries)
.where(
"ai_summaries.id IS NULL OR ai_summaries.summary_type = ?",
AiSummary.summary_types[:gist],
)
.references(:ai_summaries)
else
topics
end
end
# plugin.register_modifier(:topic_query_create_list_topics) do |topics, options|
# if Discourse.filters.include?(options[:filter]) && SiteSetting.ai_summarization_enabled &&
# SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0
# topics
# .includes(:ai_summaries)
# .where(
# "ai_summaries.id IS NULL OR ai_summaries.summary_type = ?",
# AiSummary.summary_types[:gist],
# )
# .references(:ai_summaries)
# else
# topics
# end
# end
plugin.add_to_serializer(
:topic_list_item,

View File

@ -21,7 +21,7 @@ RSpec.describe DiscourseAi::Summarization::EntryPoint do
context "when hot topic summarization is enabled" do
before { SiteSetting.ai_summarize_max_hot_topics_gists_per_batch = 100 }
it "preloads only gist summaries" do
skip "preloads only gist summaries" do
gist_topic = topic_query.list_hot.topics.find { |t| t.id == topic_ai_gist.target_id }
expect(gist_topic.ai_summaries.size).to eq(1)