From f10af7b167b0a48d208daf12ba8b03ae415cd430 Mon Sep 17 00:00:00 2001 From: Nat Date: Thu, 28 Nov 2024 20:18:55 +0800 Subject: [PATCH] DEV: Remove the short-lived prompt for locale detection --- app/models/completion_prompt.rb | 1 - db/fixtures/ai_helper/603_completion_prompts.rb | 17 ----------------- ...28121329_remove_detect_text_locale_prompt.rb | 11 +++++++++++ 3 files changed, 11 insertions(+), 18 deletions(-) create mode 100644 db/migrate/20241128121329_remove_detect_text_locale_prompt.rb diff --git a/app/models/completion_prompt.rb b/app/models/completion_prompt.rb index 0176d4c24..4d2c74dab 100644 --- a/app/models/completion_prompt.rb +++ b/app/models/completion_prompt.rb @@ -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 } diff --git a/db/fixtures/ai_helper/603_completion_prompts.rb b/db/fixtures/ai_helper/603_completion_prompts.rb index 8b3eebeb5..da045c506 100644 --- a/db/fixtures/ai_helper/603_completion_prompts.rb +++ b/db/fixtures/ai_helper/603_completion_prompts.rb @@ -200,20 +200,3 @@ 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 XML tags. - Include your locale between XML tags. - TEXT - examples: [["Hello my favourite colour is red", "en-GB"]], - } -end diff --git a/db/migrate/20241128121329_remove_detect_text_locale_prompt.rb b/db/migrate/20241128121329_remove_detect_text_locale_prompt.rb new file mode 100644 index 000000000..ebbaf9835 --- /dev/null +++ b/db/migrate/20241128121329_remove_detect_text_locale_prompt.rb @@ -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