mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 11:43:56 +08:00
f4e7a80600
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.
28 lines
397 B
Ruby
28 lines
397 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DummyCustomSummarization < Summarization::Base
|
|
def initialize(summarization_result)
|
|
@summarization_result = summarization_result
|
|
end
|
|
|
|
def display_name
|
|
"dummy"
|
|
end
|
|
|
|
def correctly_configured?
|
|
true
|
|
end
|
|
|
|
def configuration_hint
|
|
"hint"
|
|
end
|
|
|
|
def model
|
|
"dummy"
|
|
end
|
|
|
|
def summarize(_content)
|
|
@summarization_result
|
|
end
|
|
end
|