continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
15.81k stars 1.2k forks source link

Specify the output language #2032

Open 980468094 opened 3 weeks ago

980468094 commented 3 weeks ago

Validations

Problem

The current default model outputs answers in English by default. It is recommended to add a language that can be specified for output, such as supporting Chinese or Japanese

Solution

No response

sestinj commented 3 weeks ago

@980468094 you can adjust the preferred language by setting a systemMessage in config.json. For example,

{
  ...
  "systemMessage": "Always respond in Japanese"
}
jussker commented 4 days ago

file config.json

{
  ...
  "models": [
    {
      "title": ...,
      "model": ...,
      "provider": ...,
      "apiBase": ...,
      "apiKey": ...,
      "systemMessage": "You are an expert software developer. You give helpful and concise responses. Always respond in Chinese."
    }
  ],
  "experimental": {
    "contextMenuPrompts": {
      "docstring": "Write a docstring for this code in Chinese. Do not change anything about the code itself.",
      "comment": "Write comments for this code in Chinese. Do not change anything about the code itself.",
      "fix": "Fix this code and explain the fixes in Chinese.",
      "optimize": "Optimize this code and explain the optimizations in Chinese.",
      "fixGrammar": "If there are any grammar or spelling mistakes in this writing, fix them and explain the corrections in Chinese. Do not make other large changes to the writing."
    }
  },
  ...
}