From e53bb5a06d2ddd66cacbec5edc350cd38de3683c Mon Sep 17 00:00:00 2001 From: Rubu Jam Date: Mon, 8 Jul 2024 14:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20provider=20changes=20wi?= =?UTF-8?q?th=20model=20in=20model=20settings=20(#3146)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ar/setting.json | 2 +- locales/bg-BG/setting.json | 2 +- locales/de-DE/setting.json | 2 +- locales/en-US/setting.json | 2 +- locales/es-ES/setting.json | 2 +- locales/fr-FR/setting.json | 2 +- locales/it-IT/setting.json | 2 +- locales/ja-JP/setting.json | 2 +- locales/ko-KR/setting.json | 2 +- locales/nl-NL/setting.json | 2 +- locales/pl-PL/setting.json | 2 +- locales/pt-BR/setting.json | 2 +- locales/ru-RU/setting.json | 2 +- locales/tr-TR/setting.json | 2 +- locales/vi-VN/setting.json | 2 +- locales/zh-CN/setting.json | 2 +- locales/zh-TW/setting.json | 2 +- src/features/AgentSetting/AgentModal/index.tsx | 5 ++++- src/locales/default/setting.ts | 2 +- 19 files changed, 22 insertions(+), 19 deletions(-) diff --git a/locales/ar/setting.json b/locales/ar/setting.json index 16817c219215..72a73e7adc87 100644 --- a/locales/ar/setting.json +++ b/locales/ar/setting.json @@ -209,7 +209,7 @@ "title": "الحد الأقصى للردود" }, "model": { - "desc": "نموذج ChatGPT", + "desc": "{{provider}} نموذج", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/bg-BG/setting.json b/locales/bg-BG/setting.json index fbf64b0497b8..030701014faa 100644 --- a/locales/bg-BG/setting.json +++ b/locales/bg-BG/setting.json @@ -209,7 +209,7 @@ "title": "Ограничение за максимален брой токени" }, "model": { - "desc": "Модел на ChatGPT", + "desc": "{{provider}} модел", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/de-DE/setting.json b/locales/de-DE/setting.json index 08862ca472dd..581463bbab05 100644 --- a/locales/de-DE/setting.json +++ b/locales/de-DE/setting.json @@ -209,7 +209,7 @@ "title": "Maximale Token pro Antwort" }, "model": { - "desc": "ChatGPT-Modell", + "desc": "{{provider}} Modell", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json index d1dcc51a09e4..61407857cc80 100644 --- a/locales/en-US/setting.json +++ b/locales/en-US/setting.json @@ -209,7 +209,7 @@ "title": "Max Tokens Limit" }, "model": { - "desc": "ChatGPT model", + "desc": "{{provider}} model", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/es-ES/setting.json b/locales/es-ES/setting.json index 1ff1938782d4..9957260115ca 100644 --- a/locales/es-ES/setting.json +++ b/locales/es-ES/setting.json @@ -209,7 +209,7 @@ "title": "Límite de tokens por respuesta" }, "model": { - "desc": "Modelo ChatGPT", + "desc": "{{provider}} modelo", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/fr-FR/setting.json b/locales/fr-FR/setting.json index 15237f5c1dd0..e9d62ebe0a45 100644 --- a/locales/fr-FR/setting.json +++ b/locales/fr-FR/setting.json @@ -209,7 +209,7 @@ "title": "Limite de tokens par réponse" }, "model": { - "desc": "Modèle ChatGPT", + "desc": "Modèle {{provider}}", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/it-IT/setting.json b/locales/it-IT/setting.json index e3c3a6ad9d5e..95b5a60e367b 100644 --- a/locales/it-IT/setting.json +++ b/locales/it-IT/setting.json @@ -209,7 +209,7 @@ "title": "Limite di risposta singola" }, "model": { - "desc": "Modello ChatGPT", + "desc": "Modello {{provider}}", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/ja-JP/setting.json b/locales/ja-JP/setting.json index de0ba12905a9..f3dc9bb495f0 100644 --- a/locales/ja-JP/setting.json +++ b/locales/ja-JP/setting.json @@ -209,7 +209,7 @@ "title": "単一応答制限" }, "model": { - "desc": "ChatGPT モデル", + "desc": "{{provider}}モデル", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/ko-KR/setting.json b/locales/ko-KR/setting.json index d9528c73f625..e258467d0007 100644 --- a/locales/ko-KR/setting.json +++ b/locales/ko-KR/setting.json @@ -209,7 +209,7 @@ "title": "단일 응답 제한" }, "model": { - "desc": "ChatGPT 모델", + "desc": "{{provider}} 모델", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/nl-NL/setting.json b/locales/nl-NL/setting.json index 2eff4df1443e..deb73a26140a 100644 --- a/locales/nl-NL/setting.json +++ b/locales/nl-NL/setting.json @@ -209,7 +209,7 @@ "title": "Limiet voor enkele reacties" }, "model": { - "desc": "ChatGPT-model", + "desc": "{{provider}} model", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/pl-PL/setting.json b/locales/pl-PL/setting.json index f5c3e61a21c5..78246ce1eb9f 100644 --- a/locales/pl-PL/setting.json +++ b/locales/pl-PL/setting.json @@ -209,7 +209,7 @@ "title": "Limit jednorazowej odpowiedzi" }, "model": { - "desc": "Model ChatGPT", + "desc": "{{provider}} model", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/pt-BR/setting.json b/locales/pt-BR/setting.json index 311d144a20a9..41755005c1fb 100644 --- a/locales/pt-BR/setting.json +++ b/locales/pt-BR/setting.json @@ -209,7 +209,7 @@ "title": "Limite de resposta única" }, "model": { - "desc": "Modelo ChatGPT", + "desc": "{{provider}} modelo", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/ru-RU/setting.json b/locales/ru-RU/setting.json index 0c69181597a2..076add00f4cb 100644 --- a/locales/ru-RU/setting.json +++ b/locales/ru-RU/setting.json @@ -209,7 +209,7 @@ "title": "Максимальное количество токенов" }, "model": { - "desc": "Модель ChatGPT", + "desc": "{{provider}} модель", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/tr-TR/setting.json b/locales/tr-TR/setting.json index d57449ce46f4..8fac463d6c1f 100644 --- a/locales/tr-TR/setting.json +++ b/locales/tr-TR/setting.json @@ -209,7 +209,7 @@ "title": "Max Token Sınırlaması" }, "model": { - "desc": "ChatGPT modeli", + "desc": "{{provider}} Model", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/vi-VN/setting.json b/locales/vi-VN/setting.json index b0d253df4766..b3620b083921 100644 --- a/locales/vi-VN/setting.json +++ b/locales/vi-VN/setting.json @@ -209,7 +209,7 @@ "title": "Giới hạn phản hồi một lần" }, "model": { - "desc": "Mô hình ChatGPT", + "desc": "Mô hình {{provider}}", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json index 181aaa687054..8d29ce8b338a 100644 --- a/locales/zh-CN/setting.json +++ b/locales/zh-CN/setting.json @@ -209,7 +209,7 @@ "title": "单次回复限制" }, "model": { - "desc": "ChatGPT 模型", + "desc": "{{provider}} 模型", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/locales/zh-TW/setting.json b/locales/zh-TW/setting.json index b3e3d069a4b6..0e197b299677 100644 --- a/locales/zh-TW/setting.json +++ b/locales/zh-TW/setting.json @@ -209,7 +209,7 @@ "title": "單次回覆限制" }, "model": { - "desc": "ChatGPT 模型", + "desc": "{{provider}} 模型", "list": { "gpt-3.5-turbo": "GPT 3.5", "gpt-3.5-turbo-16k": "GPT 3.5 (16K)", diff --git a/src/features/AgentSetting/AgentModal/index.tsx b/src/features/AgentSetting/AgentModal/index.tsx index d2b560707d36..b2a5e0c61307 100644 --- a/src/features/AgentSetting/AgentModal/index.tsx +++ b/src/features/AgentSetting/AgentModal/index.tsx @@ -6,6 +6,7 @@ import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { FORM_STYLE } from '@/const/layoutTokens'; +import { useProviderName } from '@/hooks/useProviderName'; import { useStore } from '../store'; import { selectors } from '../store/selectors'; @@ -21,13 +22,15 @@ const AgentModal = memo(() => { return [config.enableMaxTokens, s.setAgentConfig]; }); + const providerName = useProviderName(useStore((s) => s.config.provider) as string); + useAgentSyncSettings(form); const model: ItemGroup = { children: [ { children: , - desc: t('settingModel.model.desc'), + desc: t('settingModel.model.desc', { provider: providerName }), label: t('settingModel.model.title'), name: 'model', tag: 'model', diff --git a/src/locales/default/setting.ts b/src/locales/default/setting.ts index 385745f1989f..0d65a9ee0add 100644 --- a/src/locales/default/setting.ts +++ b/src/locales/default/setting.ts @@ -212,7 +212,7 @@ export default { title: '单次回复限制', }, model: { - desc: 'ChatGPT 模型', + desc: '{{provider}} 模型', list: { 'gpt-3.5-turbo': 'GPT 3.5', 'gpt-3.5-turbo-16k': 'GPT 3.5 (16K)',