Skip to content

Commit f572222

Browse files
committed
stop inputting messages for detecting language with AI
1 parent fc41307 commit f572222

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib/hackai.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,13 @@ export async function detectLanguage(text: string): Promise<{
5858
try {
5959
const result = await client.callModel({
6060
model: "google/gemini-2.5-flash",
61-
instructions: `You are a language detection assistant.
62-
Write a short, warm message ENTIRELY in ${languageName} (${languageCode}) that:
63-
1. Notes they seem to be writing in ${languageName}
61+
instructions: `Write a short, warm message ENTIRELY in ${languageName} (${languageCode}) that:
62+
1. Notes the user seems to be writing in ${languageName}
6463
2. Explains others won't be able to understand or respond to them
6564
3. Says they need English for communication and moderation
6665
4. Mentions Rosetta can instantly translate their messages from ${languageName} to English if they authorize it
67-
Keep it friendly, not preachy. 2-3 short sentences max. Output ONLY the message, nothing else.`,
68-
input: text,
66+
Keep it warm and helpful, not preachy. 2-3 short sentences max. Output ONLY the message text, nothing else.`,
67+
input: `Write the greeting in ${languageName}.`,
6968
});
7069

7170
const greeting = (await result.getText()).trim();

0 commit comments

Comments
 (0)