FIX: Include JSON instructions in Helper default personas (#1458)

This commit is contained in:
Roman Rizzi 2025-06-23 11:57:50 -03:00 committed by GitHub
parent 683bb5725b
commit eea96d6df9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 67 additions and 1 deletions

View File

@ -11,6 +11,14 @@ module DiscourseAi
<<~PROMPT.strip
You are a helpful assistant. I will give you instructions inside <input></input> XML tags.
You will look at them and reply with a result.
Format your response as a JSON object with a single key named "output", which has the result as the value.
Your output should be in the following format:
<output>
{"output": "xx"}
</output>
Where "xx" is replaced by the result.
PROMPT
end

View File

@ -8,7 +8,17 @@ module DiscourseAi
end
def system_prompt
"You are a bot specializing in image captioning."
<<~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
end
def response_format

View File

@ -10,6 +10,14 @@ module DiscourseAi
def system_prompt
<<~PROMPT.strip
You are a markdown table formatter, I will provide you text inside <input></input> XML tags and you will format it into a markdown table
Format your response as a JSON object with a single key named "output", which has the formatted table as the value.
Your output should be in the following format:
<output>
{"output": "xx"}
</output>
Where "xx" is replaced by the formatted table.
PROMPT
end

View File

@ -11,6 +11,14 @@ module DiscourseAi
<<~PROMPT.strip
Provide me a StableDiffusion prompt to generate an image that illustrates the following post in 40 words or less, be creative.
You'll find the post between <input></input> XML tags.
Format your response as a JSON object with a single key named "output", which has the generated prompt as the value.
Your output should be in the following format:
<output>
{"output": "xx"}
</output>
Where "xx" is replaced by the generated prompt.
PROMPT
end

View File

@ -12,6 +12,14 @@ module DiscourseAi
You are a markdown proofreader. You correct egregious typos and phrasing issues but keep the user's original voice.
You do not touch code blocks. I will provide you with text to proofread. If nothing needs fixing, then you will echo the text back.
You will find the text between <input></input> XML tags.
Format your response as a JSON object with a single key named "output", which has the proofreaded version as the value.
Your output should be in the following format:
<output>
{"output": "xx"}
</output>
Where "xx" is replaced by the proofreaded version.
PROMPT
end

View File

@ -21,6 +21,14 @@ module DiscourseAi
- Time range: {{datetime:2pm+1:4pm+1}} for tomorrow 2 PM to 4 PM
You will find the text between <input></input> XML tags.
Format your response as a JSON object with a single key named "output", which has the formatted result as the value.
Your output should be in the following format:
<output>
{"output": "xx"}
</output>
Where "xx" is replaced by the formatted result.
PROMPT
end

View File

@ -16,6 +16,14 @@ module DiscourseAi
Keep the meaning same, but make them more literary. I want you to only reply the correction,
the improvements and nothing else, do not write explanations.
You will find the text between <input></input> XML tags.
Format your response as a JSON object with a single key named "output", which has the translation as the value.
Your output should be in the following format:
<output>
{"output": "xx"}
</output>
Where "xx" is replaced by the translation.
PROMPT
end

View File

@ -19,6 +19,14 @@ module DiscourseAi
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.
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.
PROMPT
end