discourse/spec/support/dummy_custom_summarization.rb
Roman Rizzi 7ca5ee6cd2
FEATURE: Stream topic summaries. (#23065)
When we receive the stream parameter, we'll queue a job that periodically publishes partial updates, and after the summarization finishes, a final one with the completed version, plus metadata.

`summary-box` listens to these updates via MessageBus, and updates state accordingly.
2023-08-11 15:08:49 -03:00

28 lines
454 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.tap { |result| yield(result[:summary]) if block_given? }
end
end