2023-06-13 13:21:46 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class DummyCustomSummarization < Summarization::Base
|
2023-06-27 10:44:34 -04:00
|
|
|
def initialize(summarization_result)
|
|
|
|
@summarization_result = summarization_result
|
|
|
|
end
|
2023-06-13 13:21:46 -04:00
|
|
|
|
|
|
|
def display_name
|
|
|
|
"dummy"
|
|
|
|
end
|
|
|
|
|
|
|
|
def correctly_configured?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def configuration_hint
|
|
|
|
"hint"
|
|
|
|
end
|
|
|
|
|
2023-06-27 10:44:34 -04:00
|
|
|
def model
|
|
|
|
"dummy"
|
|
|
|
end
|
|
|
|
|
2024-01-09 12:00:01 -05:00
|
|
|
def summarize(content, _user)
|
|
|
|
@content = content
|
2023-08-11 14:08:49 -04:00
|
|
|
@summarization_result.tap { |result| yield(result[:summary]) if block_given? }
|
2023-06-13 13:21:46 -04:00
|
|
|
end
|
2024-01-09 12:00:01 -05:00
|
|
|
|
|
|
|
attr_reader :content
|
2023-06-13 13:21:46 -04:00
|
|
|
end
|