diff --git a/src/i18n/locales/en_US.json b/src/i18n/locales/en_US.json index e9f9f17935..23f1501822 100644 --- a/src/i18n/locales/en_US.json +++ b/src/i18n/locales/en_US.json @@ -257,15 +257,6 @@ "prompt_description": "By customizing the Prompt, you can customize the behavior of AI. $text $from $to $detect will be replaced with the text to be translated, source language, target language and detected language.", "add": "Add Prompt" }, - "ollama_polish": { - "title": "Ollama Polish" - }, - "ollama_summary": { - "title": "Ollama Summary" - }, - "ollama_custom": { - "title": "Ollama Custom" - }, "openai": { "title": "OpenAI", "service": "Service Provider", @@ -278,15 +269,6 @@ "prompt_description": "By customizing the Prompt, you can customize the behavior of OpenAI. $text $from $to $detect will be replaced with the text to be translated, source language, target language and detected language.", "add": "Add Prompt" }, - "openai_summary": { - "title": "OpenAI Summary" - }, - "openai_polish": { - "title": "OpenAI Polish" - }, - "openai_custom": { - "title": "OpenAI Custom" - }, "geminipro": { "title": "Gemini Pro", "request_path": "Request Path", @@ -295,15 +277,6 @@ "prompt_description": "By customizing the Prompt, you can customize the behavior of Gemini Pro. $text $from $to $detect will be replaced with the text to be translated, source language, target language and detected language.", "add": "Add Prompt" }, - "geminipro_summary": { - "title": "Gemini Pro Summary" - }, - "geminipro_polish": { - "title": "Gemini Pro Polish" - }, - "geminipro_custom": { - "title": "Gemini Pro Custom" - }, "chatglm": { "title": "ChatGLM", "model": "Model", @@ -315,15 +288,6 @@ "prompt_description": "By customizing the Prompt, you can customize the behavior of AI. $text $from $to $detect will be replaced with the text to be translated, source language, target language and detected language.", "add": "Add Prompt" }, - "chatglm_summary": { - "title": "ChatGLM Summary" - }, - "chatglm_polish": { - "title": "ChatGLM Polish" - }, - "chatglm_custom": { - "title": "ChatGLM Custom" - }, "yandex": { "title": "Yandex" }, diff --git a/src/services/translate/chatglm_custom/Config.jsx b/src/services/translate/chatglm_custom/Config.jsx deleted file mode 100644 index d2b7e9c71d..0000000000 --- a/src/services/translate/chatglm_custom/Config.jsx +++ /dev/null @@ -1,194 +0,0 @@ -import { Input, Button, Textarea } from '@nextui-org/react'; -import { DropdownTrigger } from '@nextui-org/react'; -import { MdDeleteOutline } from 'react-icons/md'; -import { DropdownMenu } from '@nextui-org/react'; -import { DropdownItem } from '@nextui-org/react'; -import toast, { Toaster } from 'react-hot-toast'; -import { useTranslation } from 'react-i18next'; -import { Dropdown } from '@nextui-org/react'; -import { open } from '@tauri-apps/api/shell'; -import React, { useState } from 'react'; - -import { useConfig } from '../../../hooks/useConfig'; -import { useToastStyle } from '../../../hooks'; -import { translate } from './index'; -import { Language } from './index'; - -export function Config(props) { - const { updateServiceList, onClose } = props; - const [serviceConfig, setServiceConfig] = useConfig( - 'chatglm_custom', - { - model: 'chatglm_turbo', - apiKey: '', - promptList: [ - { - role: 'user', - content: 'Hello', - }, - ], - }, - { sync: false } - ); - const [isLoading, setIsLoading] = useState(false); - - const { t } = useTranslation(); - const toastStyle = useToastStyle(); - - return ( - serviceConfig !== null && ( -
{ - e.preventDefault(); - setIsLoading(true); - translate('hello', Language.auto, Language.zh_cn, { config: serviceConfig }).then( - () => { - setIsLoading(false); - setServiceConfig(serviceConfig, true); - updateServiceList('chatglm_custom'); - onClose(); - }, - (e) => { - setIsLoading(false); - toast.error(t('config.service.test_failed') + e.toString(), { style: toastStyle }); - } - ); - }} - > - -
-

{t('services.help')}

- -
-
-

{t('services.translate.chatglm.model')}

- - - - - { - setServiceConfig({ - ...serviceConfig, - model: key, - }); - }} - > - - {t(`services.translate.chatglm.chatglm_turbo`)} - - {t(`services.translate.chatglm.chatglm_pro`)} - {t(`services.translate.chatglm.chatglm_std`)} - - {t(`services.translate.chatglm.chatglm_lite`)} - - - -
-
- { - setServiceConfig({ - ...serviceConfig, - apiKey: value, - }); - }} - /> -
- -

Prompt List

-

{t('services.translate.chatglm.prompt_description')}

- -
- {serviceConfig.promptList && - serviceConfig.promptList.map((prompt, index) => { - return ( -
-