mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 22:03:44 +08:00
7ca5ee6cd2
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.
28 lines
454 B
Ruby
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
|