perf: ChatGPT 支持自定义 Base URL

This commit is contained in:
kuaifan 2025-02-04 00:58:22 +09:00
parent 5c564524a3
commit 80313f613e
3 changed files with 9 additions and 1 deletions

View File

@ -66,7 +66,7 @@ class Setting extends AbstractModel
}
$array = [];
$aiList = ['openai', 'claude', 'gemini', 'zhipu', 'qianwen', 'wenxin'];
$fieldList = ['key', 'model', 'agency', 'system', 'secret'];
$fieldList = ['key', 'model', 'base_url', 'agency', 'system', 'secret'];
foreach ($aiList as $aiName) {
foreach ($fieldList as $fieldName) {
$key = $aiName . '_' . $fieldName;

View File

@ -427,6 +427,7 @@ class BotReceiveMsgTask extends AbstractTask
'model_name' => $setting[$type . '_model'],
'system_message' => $setting[$type . '_system'],
'api_key' => $setting[$type . '_key'],
'base_url' => $setting[$type . '_base_url'],
'agency' => $setting[$type . '_agency'],
'server_url' => $serverUrl,
];

View File

@ -104,6 +104,13 @@ export default {
tipPrefix: '查看说明',
link: 'https://platform.openai.com/docs/models'
},
{
label: 'Base URL',
prop: 'openai_base_url',
type: 'input',
placeholder: 'Enter base URL...',
tip: 'API请求的基础URL路径如果没有请留空'
},
{
label: '使用代理',
prop: 'openai_agency',