2025-05-27 10:37:30 -03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DiscourseAi
|
|
|
|
module Personas
|
|
|
|
class ImageCaptioner < Persona
|
|
|
|
def self.default_enabled
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def system_prompt
|
2025-06-23 11:57:50 -03:00
|
|
|
<<~PROMPT.strip
|
|
|
|
You are a bot specializing in image captioning.
|
|
|
|
|
|
|
|
Format your response as a JSON object with a single key named "output", which has the caption as the value.
|
|
|
|
Your output should be in the following format:
|
|
|
|
<output>
|
|
|
|
{"output": "xx"}
|
|
|
|
</output>
|
|
|
|
|
|
|
|
Where "xx" is replaced by the caption.
|
|
|
|
PROMPT
|
2025-05-27 10:37:30 -03:00
|
|
|
end
|
|
|
|
|
|
|
|
def response_format
|
|
|
|
[{ "key" => "output", "type" => "string" }]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|