mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
Co-authored-by: Marcel Bialas <mb@zammad.com> Co-authored-by: Dominik Klein <dk@zammad.com> Co-authored-by: Florian Liebe <fl@zammad.com>
31 lines
705 B
Ruby
31 lines
705 B
Ruby
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
class AI::Service::KnowledgeBaseAnswerFromTicket < AI::Service
|
|
def self.lookup_attributes(context_data, locale)
|
|
{
|
|
identifier: 'knowledge_base_answer_from_ticket',
|
|
locale:,
|
|
related_object: context_data[:ticket]
|
|
}
|
|
end
|
|
|
|
def self.lookup_version(context_data, _locale)
|
|
context_data[:articles].cache_version(:created_at)
|
|
end
|
|
|
|
def analytics?
|
|
true
|
|
end
|
|
|
|
def validate_result!(result)
|
|
required_keys = %w[title body category_id]
|
|
|
|
raise InvalidResultKeysError if !required_keys.all? { |key| result[key].present? }
|
|
end
|
|
|
|
def options
|
|
{
|
|
temperature: 0.1,
|
|
}
|
|
end
|
|
end
|