Skip to content

Commit d5d827d

Browse files
perf: Conceal Azure OpenAI-type large language models
1 parent f59bc96 commit d5d827d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

backend/apps/system/crud/aimodel_manage.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@ async def async_model_info():
1111
any_model_change = False
1212
if model_list:
1313
for model in model_list:
14+
current_model_change = False
1415
if model.api_domain.startswith("http"):
1516
if model.api_key:
1617
model.api_key = await sqlbot_encrypt(model.api_key)
1718
if model.api_domain:
1819
model.api_domain = await sqlbot_encrypt(model.api_domain)
19-
session.add(model)
2020
any_model_change = True
21+
current_model_change = True
22+
if model.supplier and model.supplier == 12:
23+
model.supplier = 15
24+
any_model_change = True
25+
current_model_change = True
26+
if current_model_change:
27+
session.add(model)
2128
if any_model_change:
2229
session.commit()
2330
SQLBotLogUtil.info("✅ 异步加密已有模型的密钥和地址完成")

frontend/src/entity/supplier.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import icon_txhy_colorful from '@/assets/model/icon_txhy_colorful.png'
1010
import icon_hsyq_colorful from '@/assets/model/icon_hsyq_colorful.png'
1111
// import icon_vllm_colorful from '@/assets/model/icon_vllm_colorful.png'
1212
import icon_common_openai from '@/assets/model/icon_common_openai.png'
13-
import icon_azure_openAI_colorful from '@/assets/model/icon_Azure_OpenAI_colorful.png'
13+
// import icon_azure_openAI_colorful from '@/assets/model/icon_Azure_OpenAI_colorful.png'
1414

1515
type ModelArg = { key: string; val?: string | number; type: string; range?: string }
1616
type ModelOption = { name: string; api_domain?: string; args?: ModelArg[] }
@@ -279,7 +279,7 @@ export const supplierList: Array<{
279279
},
280280
},
281281
}, */
282-
{
282+
/* {
283283
id: 12,
284284
name: 'Azure OpenAI',
285285
icon: icon_azure_openAI_colorful,
@@ -307,7 +307,7 @@ export const supplierList: Array<{
307307
],
308308
},
309309
},
310-
},
310+
}, */
311311
{
312312
id: 15,
313313
name: '通用OpenAI',

0 commit comments

Comments
 (0)