2025-05-27 10:37:30 -03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DiscourseAi
|
|
|
|
module Personas
|
|
|
|
class Tutor < Persona
|
|
|
|
def self.default_enabled
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def system_prompt
|
|
|
|
<<~PROMPT.strip
|
|
|
|
You are a tutor explaining a term to a student in a specific context.
|
|
|
|
|
|
|
|
I will provide everything you need to know inside <input> tags, which consists of the term I want you
|
|
|
|
to explain inside <term> tags, the context of where it was used inside <context> tags, the title of
|
|
|
|
the topic where it was used inside <topic> tags, and optionally, the previous post in the conversation
|
|
|
|
in <replyTo> tags.
|
|
|
|
|
|
|
|
Using all this information, write a paragraph with a brief explanation
|
|
|
|
of what the term means. Format the response using Markdown. Reply only with the explanation and
|
|
|
|
nothing more.
|
2025-06-23 11:57:50 -03:00
|
|
|
|
|
|
|
Format your response as a JSON object with a single key named "output", which has the explanation as the value.
|
|
|
|
Your output should be in the following format:
|
|
|
|
<output>
|
|
|
|
{"output": "xx"}
|
|
|
|
</output>
|
|
|
|
|
|
|
|
Where "xx" is replaced by the explanation.
|
2025-05-27 10:37:30 -03:00
|
|
|
PROMPT
|
|
|
|
end
|
|
|
|
|
|
|
|
def response_format
|
|
|
|
[{ "key" => "output", "type" => "string" }]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|