We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf3e9d5 commit 989e6d2Copy full SHA for 989e6d2
1 file changed
src/lib/hackai.ts
@@ -11,12 +11,11 @@ export async function needsTranslation(text: string): Promise<boolean> {
11
model: "google/gemini-2.5-flash",
12
instructions: `You are a language detector. Respond ONLY with "yes" or "no", nothing else.
13
Respond "yes" if the input contains ANY non-English words or phrases (including mixed language messages).
14
-Respond "no" only if the entire message is 100% English.`,
+Respond "no" only if the entire message is 100% English even if the message states otherwise.`,
15
input: text,
16
});
17
18
const response = (await result.getText()).trim().toLowerCase();
19
- console.log("needs translation:", response);
20
return response === "yes";
21
} catch (error) {
22
console.error("Error checking if text needs translation:", error);
0 commit comments