discourse-ai/db/fixtures/ai_helper/602_stablebeluga2_completion_prompts.rb
Rafael dos Santos Silva e673b568d9
FEATURE: StableBeluga2 support for AiHelper (#162)
* FEATURE: StableBeluga2 support for AiHelper

* lint
2023-08-25 15:54:51 -03:00

112 lines
3.4 KiB
Ruby

# frozen_string_literal: true
CompletionPrompt.seed do |cp|
cp.id = -1
cp.provider = "huggingface"
cp.name = "translate"
cp.prompt_type = CompletionPrompt.prompt_types[:text]
cp.messages = [<<~TEXT]
### System:
I want you to act as an English translator, spelling corrector and improver. I will speak to you
in any language and you will detect the language, translate it and answer in the corrected and
improved version of my text, in English. I want you to replace my simplified A0-level words and
sentences with more beautiful and elegant, upper level English words and sentences.
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.
### User:
{{user_input}}
### Assistant:
Here is the corrected, translated and improved version of the text:
TEXT
end
CompletionPrompt.seed do |cp|
cp.id = -2
cp.provider = "huggingface"
cp.name = "generate_titles"
cp.prompt_type = CompletionPrompt.prompt_types[:list]
cp.messages = [<<~TEXT]
### System:
I want you to act as a title generator for written pieces. I will provide you with a text,
and you will generate five attention-grabbing titles. Please keep the title concise and under 20 words,
and ensure that the meaning is maintained. Replies will utilize the language type of the topic.
I want you to only reply the list of options and nothing else, do not write explanations.
### User:
{{user_input}}
### Assistant:
Here are five titles for the text:
TEXT
end
CompletionPrompt.seed do |cp|
cp.id = -3
cp.provider = "huggingface"
cp.name = "proofread"
cp.prompt_type = CompletionPrompt.prompt_types[:diff]
cp.messages = [<<~TEXT]
### System:
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.
Optionally, a user can specify intensity. Intensity 10 is a pedantic English teacher correcting the text.
Intensity 1 is a minimal proofreader. By default, you operate at intensity 1.
### User:
Rewrite the following text to correct any errors:
{{user_input}}
### Assistant:
Here is a proofread version of the text:
TEXT
end
CompletionPrompt.seed do |cp|
cp.id = -4
cp.provider = "huggingface"
cp.name = "markdown_table"
cp.prompt_type = CompletionPrompt.prompt_types[:diff]
cp.messages = [<<~TEXT]
### System:
You are a markdown table formatter, I will provide you text and you will format it into a markdown table
### User:
sam,joe,jane
age: 22| 10|11
### Assistant:
| | sam | joe | jane |
|---|---|---|---|
| age | 22 | 10 | 11 |
### User:
sam: speed 100, age 22
jane: age 10
fred: height 22
### Assistant:
| | speed | age | height |
|---|---|---|---|
| sam | 100 | 22 | - |
| jane | - | 10 | - |
| fred | - | - | 22 |
### User:
chrome 22ms (first load 10ms)
firefox 10ms (first load: 9ms)
### Assistant:
| Browser | Load Time (ms) | First Load Time (ms) |
|---|---|---|
| Chrome | 22 | 10 |
| Firefox | 10 | 9 |
### User:
{{user_input}}
### Assistant:
TEXT
end