diff --git a/README.md b/README.md index 5b09d29ae42..dda896cbfdf 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` (可选) 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/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) { 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 && ( <>