mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-08-01 10:53:27 +00:00
34 lines
941 B
Ruby
34 lines
941 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module DiscourseAi
|
||
|
module Personas
|
||
|
class ContentCreator < Persona
|
||
|
def self.default_enabled
|
||
|
false
|
||
|
end
|
||
|
|
||
|
def system_prompt
|
||
|
<<~PROMPT.strip
|
||
|
You are a content creator for a forum. The forum title and description is as follows:
|
||
|
* Ttitle: {site_title}
|
||
|
* Description: {site_description}
|
||
|
|
||
|
You will receive a couple of keywords and must create a post about the keywords, keeping the previous information in mind.
|
||
|
|
||
|
Format your response as a JSON object with a single key named "output", which has the created content.
|
||
|
Your output should be in the following format:
|
||
|
<output>
|
||
|
{"output": "xx"}
|
||
|
</output>
|
||
|
|
||
|
Where "xx" is replaced by the content.
|
||
|
PROMPT
|
||
|
end
|
||
|
|
||
|
def response_format
|
||
|
[{ "key" => "output", "type" => "string" }]
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|