mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-16 22:22:49 +00:00
perf: ChatGPT 支持自定义 Base URL
This commit is contained in:
parent
5c564524a3
commit
80313f613e
@ -66,7 +66,7 @@ class Setting extends AbstractModel
|
|||||||
}
|
}
|
||||||
$array = [];
|
$array = [];
|
||||||
$aiList = ['openai', 'claude', 'gemini', 'zhipu', 'qianwen', 'wenxin'];
|
$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 ($aiList as $aiName) {
|
||||||
foreach ($fieldList as $fieldName) {
|
foreach ($fieldList as $fieldName) {
|
||||||
$key = $aiName . '_' . $fieldName;
|
$key = $aiName . '_' . $fieldName;
|
||||||
|
|||||||
@ -427,6 +427,7 @@ class BotReceiveMsgTask extends AbstractTask
|
|||||||
'model_name' => $setting[$type . '_model'],
|
'model_name' => $setting[$type . '_model'],
|
||||||
'system_message' => $setting[$type . '_system'],
|
'system_message' => $setting[$type . '_system'],
|
||||||
'api_key' => $setting[$type . '_key'],
|
'api_key' => $setting[$type . '_key'],
|
||||||
|
'base_url' => $setting[$type . '_base_url'],
|
||||||
'agency' => $setting[$type . '_agency'],
|
'agency' => $setting[$type . '_agency'],
|
||||||
'server_url' => $serverUrl,
|
'server_url' => $serverUrl,
|
||||||
];
|
];
|
||||||
|
|||||||
@ -104,6 +104,13 @@ export default {
|
|||||||
tipPrefix: '查看说明',
|
tipPrefix: '查看说明',
|
||||||
link: 'https://platform.openai.com/docs/models'
|
link: 'https://platform.openai.com/docs/models'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Base URL',
|
||||||
|
prop: 'openai_base_url',
|
||||||
|
type: 'input',
|
||||||
|
placeholder: 'Enter base URL...',
|
||||||
|
tip: 'API请求的基础URL路径,如果没有请留空'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '使用代理',
|
label: '使用代理',
|
||||||
prop: 'openai_agency',
|
prop: 'openai_agency',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user