fix: update default content in getDefaultTranslateAssistant function (#10247)

* fix: update default content in getDefaultTranslateAssistant function

Changed the default content from 'follow system instruction' to 'go' in the getDefaultTranslateAssistant function to improve clarity and intent.

* use user instead of system prompt

* lint error
This commit is contained in:
beyondkmp 2025-09-18 22:03:51 +08:00 committed by GitHub
parent 5a7521e335
commit f039aa253d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,6 @@ import {
MAX_CONTEXT_COUNT,
UNLIMITED_CONTEXT_COUNT
} from '@renderer/config/constant'
import { isQwenMTModel } from '@renderer/config/models'
import { UNKNOWN } from '@renderer/config/translate'
import i18n from '@renderer/i18n'
import store from '@renderer/store'
@ -70,24 +69,16 @@ export function getDefaultTranslateAssistant(targetLanguage: TranslateLanguage,
temperature: 0.7
}
let prompt: string
let content: string
if (isQwenMTModel(model)) {
content = text
prompt = ''
} else {
content = 'follow system instruction'
prompt = store
.getState()
.settings.translateModelPrompt.replaceAll('{{target_language}}', targetLanguage.value)
.replaceAll('{{text}}', text)
}
const content = store
.getState()
.settings.translateModelPrompt.replaceAll('{{target_language}}', targetLanguage.value)
.replaceAll('{{text}}', text)
const translateAssistant = {
...assistant,
model,
settings,
prompt,
prompt: '',
targetLanguage,
content
} satisfies TranslateAssistant