DEV: Remove the short-lived prompt for locale detection

This commit is contained in:
Nat 2024-11-28 20:18:55 +08:00
parent 54ebbbe769
commit f10af7b167
No known key found for this signature in database
GPG Key ID: 4938B35D927EC773
3 changed files with 11 additions and 18 deletions

View File

@ -8,7 +8,6 @@ class CompletionPrompt < ActiveRecord::Base
CUSTOM_PROMPT = -305
EXPLAIN = -306
ILLUSTRATE_POST = -308
DETECT_TEXT_LOCALE = -309
enum :prompt_type, { text: 0, list: 1, diff: 2 }

View File

@ -200,20 +200,3 @@ CompletionPrompt.seed do |cp|
cp.prompt_type = CompletionPrompt.prompt_types[:list]
cp.messages = {}
end
CompletionPrompt.seed do |cp|
cp.id = -309
cp.name = "detect_text_locale"
cp.prompt_type = CompletionPrompt.prompt_types[:text]
cp.messages = {
insts: <<~TEXT,
I want you to act as a language expert, determining the locale for a set of text.
The locale is a language identifier, such as "en" for English, "de" for German, etc,
and can also include a region identifier, such as "en-GB" for British English, or "zh-Hans" for Simplified Chinese.
I will provide you with text, and you will determine the locale of the text.
You will find the text between <input></input> XML tags.
Include your locale between <output></output> XML tags.
TEXT
examples: [["<input>Hello my favourite colour is red</input>", "<output>en-GB</output>"]],
}
end

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class RemoveDetectTextLocalePrompt < ActiveRecord::Migration[7.0]
def up
execute "DELETE FROM completion_prompts WHERE id = -309"
end
def down
raise ActiveRecord::IrreversibleMigration
end
end