Skip to content

Commit 7b59baf

Browse files
committed
Update detect prompt as it was returning Russian for RUby
1 parent 559d54a commit 7b59baf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/services/discourse_ai/language_detector.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
module DiscourseAi
44
class LanguageDetector
55
PROMPT_TEXT = <<~TEXT
6-
You are a language expert. Determine the locale for a set of text.
7-
- the locale is a language identifier, such as "en" for English, "de" for German, etc
8-
- it may include a region identifier, such as "en-GB" for British English, or "zh-CN" for Simplified Chinese
9-
- only return the locale
6+
You are a language expert and will determine the locale for user-written content.
7+
- the locale is a language identifier, such as "en" for English, "de" for German, or "zh-CN" for Simplified Chinese, etc.
8+
- use the vocabulary and grammar of content to determine the locale
9+
- do not use links or code to determine the locale
1010
- do not write explanations
11+
- only return the locale
1112
TEXT
1213

1314
def initialize(text)

0 commit comments

Comments
 (0)