mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-21 17:56:38 +08:00
feat: pre to delete custom channel type
This commit is contained in:
parent
71dcf43c71
commit
5e07ff85eb
@ -15,7 +15,7 @@ const (
|
|||||||
APITypeAIProxyLibrary
|
APITypeAIProxyLibrary
|
||||||
APITypeTencent
|
APITypeTencent
|
||||||
APITypeGemini
|
APITypeGemini
|
||||||
APITypeZhipu_v4
|
APITypeZhipuV4
|
||||||
APITypeOllama
|
APITypeOllama
|
||||||
APITypePerplexity
|
APITypePerplexity
|
||||||
APITypeAws
|
APITypeAws
|
||||||
@ -48,7 +48,7 @@ func ChannelType2APIType(channelType int) (int, bool) {
|
|||||||
case common.ChannelTypeGemini:
|
case common.ChannelTypeGemini:
|
||||||
apiType = APITypeGemini
|
apiType = APITypeGemini
|
||||||
case common.ChannelTypeZhipu_v4:
|
case common.ChannelTypeZhipu_v4:
|
||||||
apiType = APITypeZhipu_v4
|
apiType = APITypeZhipuV4
|
||||||
case common.ChannelTypeOllama:
|
case common.ChannelTypeOllama:
|
||||||
apiType = APITypeOllama
|
apiType = APITypeOllama
|
||||||
case common.ChannelTypePerplexity:
|
case common.ChannelTypePerplexity:
|
||||||
|
@ -41,7 +41,7 @@ func GetAdaptor(apiType int) channel.Adaptor {
|
|||||||
return &xunfei.Adaptor{}
|
return &xunfei.Adaptor{}
|
||||||
case constant.APITypeZhipu:
|
case constant.APITypeZhipu:
|
||||||
return &zhipu.Adaptor{}
|
return &zhipu.Adaptor{}
|
||||||
case constant.APITypeZhipu_v4:
|
case constant.APITypeZhipuV4:
|
||||||
return &zhipu_4v.Adaptor{}
|
return &zhipu_4v.Adaptor{}
|
||||||
case constant.APITypeOllama:
|
case constant.APITypeOllama:
|
||||||
return &ollama.Adaptor{}
|
return &ollama.Adaptor{}
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
showError,
|
showError,
|
||||||
showInfo,
|
showInfo,
|
||||||
showSuccess,
|
showSuccess,
|
||||||
|
showWarning,
|
||||||
timestamp2string,
|
timestamp2string,
|
||||||
} from '../helpers';
|
} from '../helpers';
|
||||||
|
|
||||||
@ -309,6 +310,12 @@ const ChannelsTable = () => {
|
|||||||
|
|
||||||
const setChannelFormat = (channels) => {
|
const setChannelFormat = (channels) => {
|
||||||
for (let i = 0; i < channels.length; i++) {
|
for (let i = 0; i < channels.length; i++) {
|
||||||
|
if (channels[i].type === 8) {
|
||||||
|
showWarning(
|
||||||
|
'检测到您使用了“自定义渠道”类型,请更换为“OpenAI”渠道类型!',
|
||||||
|
);
|
||||||
|
showWarning('下个版本将不再支持“自定义渠道”类型!');
|
||||||
|
}
|
||||||
channels[i].key = '' + channels[i].id;
|
channels[i].key = '' + channels[i].id;
|
||||||
let test_models = [];
|
let test_models = [];
|
||||||
channels[i].models.split(',').forEach((item, index) => {
|
channels[i].models.split(',').forEach((item, index) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user