FIX: disables temporarily ai_summaries filtering (#943)
This commit is contained in:
parent
86cf4ccba7
commit
2cc8115b48
|
@ -17,20 +17,20 @@ module DiscourseAi
|
||||||
scope.can_see_summary?(object.topic)
|
scope.can_see_summary?(object.topic)
|
||||||
end
|
end
|
||||||
|
|
||||||
plugin.register_modifier(:topic_query_create_list_topics) do |topics, options|
|
# plugin.register_modifier(:topic_query_create_list_topics) do |topics, options|
|
||||||
if Discourse.filters.include?(options[:filter]) && SiteSetting.ai_summarization_enabled &&
|
# if Discourse.filters.include?(options[:filter]) && SiteSetting.ai_summarization_enabled &&
|
||||||
SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0
|
# SiteSetting.ai_summarize_max_hot_topics_gists_per_batch > 0
|
||||||
topics
|
# topics
|
||||||
.includes(:ai_summaries)
|
# .includes(:ai_summaries)
|
||||||
.where(
|
# .where(
|
||||||
"ai_summaries.id IS NULL OR ai_summaries.summary_type = ?",
|
# "ai_summaries.id IS NULL OR ai_summaries.summary_type = ?",
|
||||||
AiSummary.summary_types[:gist],
|
# AiSummary.summary_types[:gist],
|
||||||
)
|
# )
|
||||||
.references(:ai_summaries)
|
# .references(:ai_summaries)
|
||||||
else
|
# else
|
||||||
topics
|
# topics
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
|
||||||
plugin.add_to_serializer(
|
plugin.add_to_serializer(
|
||||||
:topic_list_item,
|
:topic_list_item,
|
||||||
|
|
|
@ -21,7 +21,7 @@ RSpec.describe DiscourseAi::Summarization::EntryPoint do
|
||||||
context "when hot topic summarization is enabled" do
|
context "when hot topic summarization is enabled" do
|
||||||
before { SiteSetting.ai_summarize_max_hot_topics_gists_per_batch = 100 }
|
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 }
|
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)
|
expect(gist_topic.ai_summaries.size).to eq(1)
|
||||||
|
|
Loading…
Reference in New Issue