From eb5964df8254331c82db1255a652012ddd117be2 Mon Sep 17 00:00:00 2001 From: FishHawk Date: Tue, 22 Oct 2024 23:55:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E4=B8=8D=E5=86=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81GPT=20web=E7=BF=BB=E8=AF=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/workspace/GptWorkspace.vue | 8 +- .../workspace/components/GptWorkerModal.vue | 107 +++++------------- 2 files changed, 32 insertions(+), 83 deletions(-) diff --git a/web/src/pages/workspace/GptWorkspace.vue b/web/src/pages/workspace/GptWorkspace.vue index b97f9aa0..cc77c6d6 100644 --- a/web/src/pages/workspace/GptWorkspace.vue +++ b/web/src/pages/workspace/GptWorkspace.vue @@ -102,13 +102,7 @@ const clearCache = async () => AccessToken - - 当您添加翻译器时,若链接留空,则表示将使用OpenAI官方链接,您也可以提供链接以使用第三方GPT代理。 - - - 当使用GPT-3.5 - Web且选择官方链接时,需要安装相应的插件,详情看使用教程。 - + 不再支持GPT web,推荐使用deepseek API,价格很低。 diff --git a/web/src/pages/workspace/components/GptWorkerModal.vue b/web/src/pages/workspace/components/GptWorkerModal.vue index 119db842..dca6cfec 100644 --- a/web/src/pages/workspace/components/GptWorkerModal.vue +++ b/web/src/pages/workspace/components/GptWorkerModal.vue @@ -17,37 +17,23 @@ const workspaceRef = workspace.ref; const initFormValue = (): { id: string; - type: 'web' | 'api'; - modelWeb: string; - modelApi: string; - endpointWeb: string; - endpointApi: string; + model: string; + endpoint: string; key: string; } => { const worker = props.worker; if (worker === undefined) { return { id: '', - type: 'web', - modelWeb: 'text-davinci-002-render-sha', - modelApi: 'gpt-3.5-turbo', - endpointWeb: 'https://chat.openai.com/backend-api', - endpointApi: 'https://api.openai.com', + model: 'deepseek-chat', + endpoint: 'https://api.deepseek.com', key: '', }; } else { return { id: worker.id, - type: worker.type, - modelWeb: - worker.type === 'web' ? worker.model : 'text-davinci-002-render-sha', - modelApi: worker.type === 'api' ? worker.model : 'gpt-3.5-turbo', - endpointWeb: - worker.type === 'web' - ? worker.endpoint - : 'https://chat.openai.com/backend-api', - endpointApi: - worker.type === 'api' ? worker.endpoint : 'https://api.openai.com', + model: worker.model, + endpoint: worker.endpoint, key: worker.key, }; } @@ -101,13 +87,12 @@ const submit = async () => { }); if (!validated) return; - const { id, type, modelWeb, modelApi, endpointWeb, endpointApi, key } = - formValue.value; + const { id, model, endpoint, key } = formValue.value; const worker = { id: id.trim(), - type, - model: type === 'web' ? modelWeb.trim() : modelApi.trim(), - endpoint: type === 'web' ? endpointWeb.trim() : endpointApi.trim(), + type: 'api' as const, + model: model.trim(), + endpoint: endpoint.trim(), key: key.trim(), }; try { @@ -151,71 +136,41 @@ const verb = computed(() => (props.worker === undefined ? '添加' : '更新')); :input-props="{ spellcheck: false }" /> - - - - Web - Api - - - - - - + + + + + + - {{ - formValue.type === 'web' - ? '# 链接例子:https://chatgpt-proxy.lss233.com/api' - : '# 链接例子:https://gpt.mnxcc.com,后面不要加‘/v1’' - }} + # 链接例子:https://api.deepseek.com,后面不要加‘/v1’