Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Remove the short-lived prompt for locale detection #972

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/models/completion_prompt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
17 changes: 0 additions & 17 deletions db/fixtures/ai_helper/603_completion_prompts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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
11 changes: 11 additions & 0 deletions db/migrate/20241128121329_remove_detect_text_locale_prompt.rb
Original file line number Diff line number Diff line change
@@ -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
Loading