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