mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
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:
@ -27,7 +27,7 @@ class Chat::Api::SummariesController < Chat::ApiController
|
||||
.map { "#{_1}: #{_2}" }
|
||||
.join("\n")
|
||||
|
||||
render json: { summary: strategy.summarize(content) }
|
||||
render json: { summary: strategy.summarize(content).dig(:summary) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user