DEV: Cache summarization strategy results. (#22230)

Updates the interface for implementing summarization strategies and adds a cache layer to summarize topics once.

The cache stores the final summary and each chunk used to build it, which will be useful when we have to extend or rebuild it.
This commit is contained in:
Roman Rizzi
2023-06-27 11:44:34 -03:00
committed by GitHub
parent a909dffe8f
commit f4e7a80600
13 changed files with 332 additions and 41 deletions

View File

@@ -10,13 +10,13 @@ describe Summarization::Base do
it "returns true if the user group is present in the custom_summarization_allowed_groups_map setting" do
SiteSetting.custom_summarization_allowed_groups = group.id
expect(described_class.new(nil).can_request_summaries?(user)).to eq(true)
expect(subject.can_request_summaries?(user)).to eq(true)
end
it "returns false if the user group is not present in the custom_summarization_allowed_groups_map setting" do
SiteSetting.custom_summarization_allowed_groups = ""
expect(described_class.new(nil).can_request_summaries?(user)).to eq(false)
expect(subject.can_request_summaries?(user)).to eq(false)
end
end
end