Skip to content

Commit 90c531c

Browse files
committed
fix issue ChatGPTNextWeb#6009 add setting items for deepseek
1 parent d56566c commit 90c531c

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

app/api/deepseek.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async function request(req: NextRequest) {
9191
isModelNotavailableInServer(
9292
serverConfig.customModels,
9393
jsonBody?.model as string,
94-
ServiceProvider.Moonshot as string,
94+
ServiceProvider.DeepSeek as string,
9595
)
9696
) {
9797
return NextResponse.json(

app/components/settings.tsx

+43
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import {
7373
Iflytek,
7474
SAAS_CHAT_URL,
7575
ChatGLM,
76+
DeepSeek,
7677
} from "../constant";
7778
import { Prompt, SearchService, usePromptStore } from "../store/prompt";
7879
import { ErrorBoundary } from "./error";
@@ -1197,6 +1198,47 @@ export function Settings() {
11971198
</>
11981199
);
11991200

1201+
const deepseekConfigComponent = accessStore.provider ===
1202+
ServiceProvider.DeepSeek && (
1203+
<>
1204+
<ListItem
1205+
title={Locale.Settings.Access.DeepSeek.Endpoint.Title}
1206+
subTitle={
1207+
Locale.Settings.Access.DeepSeek.Endpoint.SubTitle +
1208+
DeepSeek.ExampleEndpoint
1209+
}
1210+
>
1211+
<input
1212+
aria-label={Locale.Settings.Access.DeepSeek.Endpoint.Title}
1213+
type="text"
1214+
value={accessStore.deepseekUrl}
1215+
placeholder={DeepSeek.ExampleEndpoint}
1216+
onChange={(e) =>
1217+
accessStore.update(
1218+
(access) => (access.deepseekUrl = e.currentTarget.value),
1219+
)
1220+
}
1221+
></input>
1222+
</ListItem>
1223+
<ListItem
1224+
title={Locale.Settings.Access.DeepSeek.ApiKey.Title}
1225+
subTitle={Locale.Settings.Access.DeepSeek.ApiKey.SubTitle}
1226+
>
1227+
<PasswordInput
1228+
aria-label={Locale.Settings.Access.DeepSeek.ApiKey.Title}
1229+
value={accessStore.deepseekApiKey}
1230+
type="text"
1231+
placeholder={Locale.Settings.Access.DeepSeek.ApiKey.Placeholder}
1232+
onChange={(e) => {
1233+
accessStore.update(
1234+
(access) => (access.deepseekApiKey = e.currentTarget.value),
1235+
);
1236+
}}
1237+
/>
1238+
</ListItem>
1239+
</>
1240+
);
1241+
12001242
const XAIConfigComponent = accessStore.provider === ServiceProvider.XAI && (
12011243
<>
12021244
<ListItem
@@ -1733,6 +1775,7 @@ export function Settings() {
17331775
{alibabaConfigComponent}
17341776
{tencentConfigComponent}
17351777
{moonshotConfigComponent}
1778+
{deepseekConfigComponent}
17361779
{stabilityConfigComponent}
17371780
{lflytekConfigComponent}
17381781
{XAIConfigComponent}

app/locales/cn.ts

+11
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,17 @@ const cn = {
462462
SubTitle: "样例:",
463463
},
464464
},
465+
DeepSeek: {
466+
ApiKey: {
467+
Title: "接口密钥",
468+
SubTitle: "使用自定义DeepSeek API Key",
469+
Placeholder: "DeepSeek API Key",
470+
},
471+
Endpoint: {
472+
Title: "接口地址",
473+
SubTitle: "样例:",
474+
},
475+
},
465476
XAI: {
466477
ApiKey: {
467478
Title: "接口密钥",

app/locales/en.ts

+11
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,17 @@ const en: LocaleType = {
446446
SubTitle: "Example: ",
447447
},
448448
},
449+
DeepSeek: {
450+
ApiKey: {
451+
Title: "DeepSeek API Key",
452+
SubTitle: "Use a custom DeepSeek API Key",
453+
Placeholder: "DeepSeek API Key",
454+
},
455+
Endpoint: {
456+
Title: "Endpoint Address",
457+
SubTitle: "Example: ",
458+
},
459+
},
449460
XAI: {
450461
ApiKey: {
451462
Title: "XAI API Key",

0 commit comments

Comments
 (0)