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

@@ -0,0 +1,16 @@
# frozen_string_literal: true
class CreateSummarySectionsTable < ActiveRecord::Migration[7.0]
def change
create_table :summary_sections do |t|
t.integer :target_id, null: false
t.string :target_type, null: false
t.int4range :content_range
t.string :summarized_text, null: false
t.integer :meta_section_id
t.string :original_content_sha, null: false
t.string :algorithm, null: false
t.timestamps
end
end
end