From faf5e87d48ae0e52cf45c72c383cf9f7e8624290 Mon Sep 17 00:00:00 2001 From: josc146 Date: Fri, 26 Jan 2024 12:11:32 +0800 Subject: [PATCH] improve the stability of response language (#611) --- src/content-script/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content-script/index.jsx b/src/content-script/index.jsx index 3190de8..c1929b0 100644 --- a/src/content-script/index.jsx +++ b/src/content-script/index.jsx @@ -90,7 +90,9 @@ async function getInput(inputQuery) { let input if (typeof inputQuery === 'function') { input = await inputQuery() - if (input) return `Reply in ${await getPreferredLanguage()}.\n` + input + const replyPromptBelow = `Reply in ${await getPreferredLanguage()}. Regardless of the language of content I provide below. !!This is very important!!` + const replyPromptAbove = `Reply in ${await getPreferredLanguage()}. Regardless of the language of content I provide above. !!This is very important!!` + if (input) return `${replyPromptBelow}\n\n` + input + `\n\n${replyPromptAbove}` return input } const searchInput = getPossibleElementByQuerySelector(inputQuery)