Skip to content

Commit 8e4d261

Browse files
authored
Merge pull request #4989 from ConnectAI-E/hotfix/cf-ai-gateway
update custom bytedance models, and update labels in setting page
2 parents b4ae706 + 53c1176 commit 8e4d261

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

app/components/settings.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,7 @@ export function Settings() {
11951195
<ListItem
11961196
title={Locale.Settings.Access.Baidu.Endpoint.Title}
11971197
subTitle={
1198-
Locale.Settings.Access.Anthropic.Endpoint.SubTitle +
1199-
Baidu.ExampleEndpoint
1198+
Locale.Settings.Access.Baidu.Endpoint.SubTitle
12001199
}
12011200
>
12021201
<input

app/locales/cn.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ const cn = {
360360
},
361361
Endpoint: {
362362
Title: "接口地址",
363-
SubTitle: "样例:",
363+
SubTitle: "不支持自定义前往.env配置",
364364
},
365365
},
366366
ByteDance: {

app/locales/en.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ const en: LocaleType = {
326326

327327
Endpoint: {
328328
Title: "Endpoint Address",
329-
SubTitle: "Example:",
329+
SubTitle: "Example: ",
330330
},
331331

332332
ApiVerion: {
@@ -347,7 +347,7 @@ const en: LocaleType = {
347347
},
348348
Endpoint: {
349349
Title: "Endpoint Address",
350-
SubTitle: "Example:",
350+
SubTitle: "not supported, configure in .env",
351351
},
352352
},
353353
ByteDance: {
@@ -358,7 +358,7 @@ const en: LocaleType = {
358358
},
359359
Endpoint: {
360360
Title: "Endpoint Address",
361-
SubTitle: "Example:",
361+
SubTitle: "Example: ",
362362
},
363363
},
364364
Alibaba: {
@@ -369,7 +369,7 @@ const en: LocaleType = {
369369
},
370370
Endpoint: {
371371
Title: "Endpoint Address",
372-
SubTitle: "Example:",
372+
SubTitle: "Example: ",
373373
},
374374
},
375375
CustomModel: {
@@ -385,7 +385,7 @@ const en: LocaleType = {
385385

386386
Endpoint: {
387387
Title: "Endpoint Address",
388-
SubTitle: "Example:",
388+
SubTitle: "Example: ",
389389
},
390390

391391
ApiVersion: {

app/utils/model.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,14 @@ export function collectModelTable(
7171
}
7272
// 2. if model not exists, create new model with available value
7373
if (count === 0) {
74-
const [customModelName, customProviderName] = name.split("@");
74+
let [customModelName, customProviderName] = name.split("@");
7575
const provider = customProvider(
7676
customProviderName || customModelName,
7777
);
78+
// swap name and displayName for bytedance
79+
if (displayName && provider.providerName == "ByteDance") {
80+
[customModelName, displayName] = [displayName, customModelName];
81+
}
7882
modelTable[`${customModelName}@${provider?.id}`] = {
7983
name: customModelName,
8084
displayName: displayName || customModelName,

0 commit comments

Comments
 (0)