feat: add New API channel support

This commit is contained in:
CaIon
2026-07-27 15:20:19 +08:00
parent bc14c18f60
commit 398cdafecf
21 changed files with 408 additions and 128 deletions
+14
View File
@@ -79,9 +79,23 @@ func ChannelType2APIType(channelType int) (int, bool) {
apiType = constant.APITypeAdvancedCustom
case constant.ChannelTypeSub2API:
apiType = constant.APITypeSub2API
case constant.ChannelTypeNewAPI:
apiType = constant.APITypeNewAPI
}
if apiType == -1 {
return constant.APITypeOpenAI, false
}
return apiType, true
}
func IsResponsesCompactAPIType(apiType int) bool {
switch apiType {
case constant.APITypeOpenAI,
constant.APITypeCodex,
constant.APITypeSub2API,
constant.APITypeNewAPI:
return true
default:
return false
}
}
+2 -1
View File
@@ -30,10 +30,11 @@ func GetEndpointTypesByChannelType(channelType int, modelName string) []constant
endpointTypes = []constant.EndpointType{constant.EndpointTypeOpenAI, constant.EndpointTypeOpenAIResponse}
case constant.ChannelTypeSora:
endpointTypes = []constant.EndpointType{constant.EndpointTypeOpenAIVideo}
case constant.ChannelTypeSub2API:
case constant.ChannelTypeSub2API, constant.ChannelTypeNewAPI:
endpointTypes = []constant.EndpointType{
constant.EndpointTypeOpenAI,
constant.EndpointTypeOpenAIResponse,
constant.EndpointTypeOpenAIResponseCompact,
constant.EndpointTypeAnthropic,
constant.EndpointTypeGemini,
constant.EndpointTypeOpenAIAlphaSearch,