feat: add New API channel support
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user