🔧 refactor(endpoint types): comment out unused endpoint types in constants
This commit is contained in:
@@ -27,9 +27,6 @@
|
|||||||
<a href="https://goreportcard.com/report/github.com/Calcium-Ion/new-api">
|
<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">
|
<img src="https://goreportcard.com/badge/github.com/Calcium-Ion/new-api" alt="GoReportCard">
|
||||||
</a>
|
</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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ func GetEndpointTypesByChannelType(channelType int, modelName string) []constant
|
|||||||
switch channelType {
|
switch channelType {
|
||||||
case constant.ChannelTypeJina:
|
case constant.ChannelTypeJina:
|
||||||
endpointTypes = []constant.EndpointType{constant.EndpointTypeJinaRerank}
|
endpointTypes = []constant.EndpointType{constant.EndpointTypeJinaRerank}
|
||||||
case constant.ChannelTypeMidjourney, constant.ChannelTypeMidjourneyPlus:
|
//case constant.ChannelTypeMidjourney, constant.ChannelTypeMidjourneyPlus:
|
||||||
endpointTypes = []constant.EndpointType{constant.EndpointTypeMidjourney}
|
// endpointTypes = []constant.EndpointType{constant.EndpointTypeMidjourney}
|
||||||
case constant.ChannelTypeSunoAPI:
|
//case constant.ChannelTypeSunoAPI:
|
||||||
endpointTypes = []constant.EndpointType{constant.EndpointTypeSuno}
|
// endpointTypes = []constant.EndpointType{constant.EndpointTypeSuno}
|
||||||
case constant.ChannelTypeKling:
|
//case constant.ChannelTypeKling:
|
||||||
endpointTypes = []constant.EndpointType{constant.EndpointTypeKling}
|
// endpointTypes = []constant.EndpointType{constant.EndpointTypeKling}
|
||||||
case constant.ChannelTypeJimeng:
|
//case constant.ChannelTypeJimeng:
|
||||||
endpointTypes = []constant.EndpointType{constant.EndpointTypeJimeng}
|
// endpointTypes = []constant.EndpointType{constant.EndpointTypeJimeng}
|
||||||
case constant.ChannelTypeAws:
|
case constant.ChannelTypeAws:
|
||||||
fallthrough
|
fallthrough
|
||||||
case constant.ChannelTypeAnthropic:
|
case constant.ChannelTypeAnthropic:
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ const (
|
|||||||
EndpointTypeAnthropic EndpointType = "anthropic"
|
EndpointTypeAnthropic EndpointType = "anthropic"
|
||||||
EndpointTypeGemini EndpointType = "gemini"
|
EndpointTypeGemini EndpointType = "gemini"
|
||||||
EndpointTypeJinaRerank EndpointType = "jina-rerank"
|
EndpointTypeJinaRerank EndpointType = "jina-rerank"
|
||||||
EndpointTypeMidjourney EndpointType = "midjourney-proxy"
|
//EndpointTypeMidjourney EndpointType = "midjourney-proxy"
|
||||||
EndpointTypeSuno EndpointType = "suno-proxy"
|
//EndpointTypeSuno EndpointType = "suno-proxy"
|
||||||
EndpointTypeKling EndpointType = "kling"
|
//EndpointTypeKling EndpointType = "kling"
|
||||||
EndpointTypeJimeng EndpointType = "jimeng"
|
//EndpointTypeJimeng EndpointType = "jimeng"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -172,9 +172,6 @@ func CountTokenChatRequest(info *relaycommon.RelayInfo, request dto.GeneralOpenA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
toolTokens := CountTokenInput(countStr, request.Model)
|
toolTokens := CountTokenInput(countStr, request.Model)
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
tkm += 8
|
tkm += 8
|
||||||
tkm += toolTokens
|
tkm += toolTokens
|
||||||
}
|
}
|
||||||
@@ -195,9 +192,6 @@ func CountTokenClaudeRequest(request dto.ClaudeRequest, model string) (int, erro
|
|||||||
// Count tokens in system message
|
// Count tokens in system message
|
||||||
if request.System != "" {
|
if request.System != "" {
|
||||||
systemTokens := CountTokenInput(request.System, model)
|
systemTokens := CountTokenInput(request.System, model)
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
tkm += systemTokens
|
tkm += systemTokens
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user