🔧 refactor(endpoint types): comment out unused endpoint types in constants

This commit is contained in:
CaIon
2025-07-04 15:53:46 +08:00
parent c0a23ffa62
commit 6ac7878863
4 changed files with 12 additions and 21 deletions

View File

@@ -27,9 +27,6 @@
<a href="https://goreportcard.com/report/github.com/Calcium-Ion/new-api">
<img src="https://goreportcard.com/badge/github.com/Calcium-Ion/new-api" alt="GoReportCard">
</a>
<a href="https://coderabbit.ai">
<img src="https://img.shields.io/coderabbit/prs/github/QuantumNous/new-api?utm_source=oss&utm_medium=github&utm_campaign=QuantumNous%2Fnew-api&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews" alt="CodeRabbit Pull Request Reviews">
</a>
</p>
</div>

View File

@@ -8,14 +8,14 @@ func GetEndpointTypesByChannelType(channelType int, modelName string) []constant
switch channelType {
case constant.ChannelTypeJina:
endpointTypes = []constant.EndpointType{constant.EndpointTypeJinaRerank}
case constant.ChannelTypeMidjourney, constant.ChannelTypeMidjourneyPlus:
endpointTypes = []constant.EndpointType{constant.EndpointTypeMidjourney}
case constant.ChannelTypeSunoAPI:
endpointTypes = []constant.EndpointType{constant.EndpointTypeSuno}
case constant.ChannelTypeKling:
endpointTypes = []constant.EndpointType{constant.EndpointTypeKling}
case constant.ChannelTypeJimeng:
endpointTypes = []constant.EndpointType{constant.EndpointTypeJimeng}
//case constant.ChannelTypeMidjourney, constant.ChannelTypeMidjourneyPlus:
// endpointTypes = []constant.EndpointType{constant.EndpointTypeMidjourney}
//case constant.ChannelTypeSunoAPI:
// endpointTypes = []constant.EndpointType{constant.EndpointTypeSuno}
//case constant.ChannelTypeKling:
// endpointTypes = []constant.EndpointType{constant.EndpointTypeKling}
//case constant.ChannelTypeJimeng:
// endpointTypes = []constant.EndpointType{constant.EndpointTypeJimeng}
case constant.ChannelTypeAws:
fallthrough
case constant.ChannelTypeAnthropic:

View File

@@ -8,8 +8,8 @@ const (
EndpointTypeAnthropic EndpointType = "anthropic"
EndpointTypeGemini EndpointType = "gemini"
EndpointTypeJinaRerank EndpointType = "jina-rerank"
EndpointTypeMidjourney EndpointType = "midjourney-proxy"
EndpointTypeSuno EndpointType = "suno-proxy"
EndpointTypeKling EndpointType = "kling"
EndpointTypeJimeng EndpointType = "jimeng"
//EndpointTypeMidjourney EndpointType = "midjourney-proxy"
//EndpointTypeSuno EndpointType = "suno-proxy"
//EndpointTypeKling EndpointType = "kling"
//EndpointTypeJimeng EndpointType = "jimeng"
)

View File

@@ -172,9 +172,6 @@ func CountTokenChatRequest(info *relaycommon.RelayInfo, request dto.GeneralOpenA
}
}
toolTokens := CountTokenInput(countStr, request.Model)
if err != nil {
return 0, err
}
tkm += 8
tkm += toolTokens
}
@@ -195,9 +192,6 @@ func CountTokenClaudeRequest(request dto.ClaudeRequest, model string) (int, erro
// Count tokens in system message
if request.System != "" {
systemTokens := CountTokenInput(request.System, model)
if err != nil {
return 0, err
}
tkm += systemTokens
}