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