From b948d6bf86ba4410c854a3c73df275c42be89baa Mon Sep 17 00:00:00 2001 From: suruiqiang Date: Sun, 29 Dec 2024 11:24:57 +0800 Subject: [PATCH 1/3] bug fix --- app/client/platforms/deepseek.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/platforms/deepseek.ts b/app/client/platforms/deepseek.ts index 28f15a43579..e2ae645c67c 100644 --- a/app/client/platforms/deepseek.ts +++ b/app/client/platforms/deepseek.ts @@ -35,7 +35,7 @@ export class DeepSeekApi implements LLMApi { let baseUrl = ""; if (accessStore.useCustomConfig) { - baseUrl = accessStore.moonshotUrl; + baseUrl = accessStore.deepseekUrl; } if (baseUrl.length === 0) { From 2a8a18391ebc563a9a552dfdac8a0a66d833e0d7 Mon Sep 17 00:00:00 2001 From: suruiqiang Date: Sun, 29 Dec 2024 15:31:50 +0800 Subject: [PATCH 2/3] docs: add DEEPSEEK_API_KEY and DEEPSEEK_URL in README --- README.md | 8 ++++++++ README_CN.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 9168480c5e2..228197680f1 100644 --- a/README.md +++ b/README.md @@ -312,6 +312,14 @@ ChatGLM Api Key. ChatGLM Api Url. +### `DEEPSEEK_API_KEY` (optional) + +DeepSeek Api Key. + +### `DEEPSEEK_URL` (optional) + +DeepSeek Api Url. + ### `HIDE_USER_API_KEY` (optional) > Default: Empty diff --git a/README_CN.md b/README_CN.md index 8173b9c4d1c..aa95d6b5cd5 100644 --- a/README_CN.md +++ b/README_CN.md @@ -192,6 +192,14 @@ ChatGLM Api Key. ChatGLM Api Url. +### `DEEPSEEK_API_KEY` (可选) + +DeepSeek Api Key. + +### `DEEPSEEK_URL` (可选) + +DeepSeek Api Url. + ### `HIDE_USER_API_KEY` (可选) From 90c531c2249c1e2070e4f605d25a8e31c315ebdb Mon Sep 17 00:00:00 2001 From: suruiqiang Date: Mon, 30 Dec 2024 18:23:18 +0800 Subject: [PATCH 3/3] fix issue #6009 add setting items for deepseek --- app/api/deepseek.ts | 2 +- app/components/settings.tsx | 43 +++++++++++++++++++++++++++++++++++++ app/locales/cn.ts | 11 ++++++++++ app/locales/en.ts | 11 ++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) diff --git a/app/api/deepseek.ts b/app/api/deepseek.ts index 06d97a0d606..a9879ecedeb 100644 --- a/app/api/deepseek.ts +++ b/app/api/deepseek.ts @@ -91,7 +91,7 @@ async function request(req: NextRequest) { isModelNotavailableInServer( serverConfig.customModels, jsonBody?.model as string, - ServiceProvider.Moonshot as string, + ServiceProvider.DeepSeek as string, ) ) { return NextResponse.json( diff --git a/app/components/settings.tsx b/app/components/settings.tsx index a74ff17b1f5..3b990ed2c74 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -73,6 +73,7 @@ import { Iflytek, SAAS_CHAT_URL, ChatGLM, + DeepSeek, } from "../constant"; import { Prompt, SearchService, usePromptStore } from "../store/prompt"; import { ErrorBoundary } from "./error"; @@ -1197,6 +1198,47 @@ export function Settings() { ); + const deepseekConfigComponent = accessStore.provider === + ServiceProvider.DeepSeek && ( + <> + + + accessStore.update( + (access) => (access.deepseekUrl = e.currentTarget.value), + ) + } + > + + + { + accessStore.update( + (access) => (access.deepseekApiKey = e.currentTarget.value), + ); + }} + /> + + + ); + const XAIConfigComponent = accessStore.provider === ServiceProvider.XAI && ( <>