feat: respond in user's language, style fixes and research depth fixes

This commit is contained in:
AnotiaWang
2025-02-12 19:34:21 +08:00
parent 5a973b5d63
commit b0c86ce2e2
8 changed files with 80 additions and 34 deletions

View File

@ -13,3 +13,18 @@ export const systemPrompt = () => {
- Consider new technologies and contrarian ideas, not just the conventional wisdom.
- You may use high levels of speculation or prediction, just flag it for me.`
}
/**
* Construct the language requirement prompt for LLMs.
* Placing this at the end of the prompt makes it easier for the LLM to pay attention to.
* @param language the language of the prompt, e.g. `English`
*/
export const languagePrompt = (language: string) => {
let languagePrompt = `- Respond in ${language}.`
if (language === '中文') {
languagePrompt +=
' Add appropriate spaces between Chinese and Latin characters / numbers to improve readability.'
}
return languagePrompt
}