Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
14cca53e
authored
Jul 04, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔧
refactor(endpoint types): comment out unused endpoint types in constants
parent
f45caf29
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
21 deletions
+12
-21
README.md
+0
-3
common/endpoint_type.go
+8
-8
constant/endpoint_type.go
+4
-4
service/token_counter.go
+0
-6
No files found.
README.md
View file @
14cca53e
...
@@ -27,9 +27,6 @@
...
@@ -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>
...
...
common/endpoint_type.go
View file @
14cca53e
...
@@ -8,14 +8,14 @@ func GetEndpointTypesByChannelType(channelType int, modelName string) []constant
...
@@ -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
:
...
...
constant/endpoint_type.go
View file @
14cca53e
...
@@ -8,8 +8,8 @@ const (
...
@@ -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"
)
)
service/token_counter.go
View file @
14cca53e
...
@@ -172,9 +172,6 @@ func CountTokenChatRequest(info *relaycommon.RelayInfo, request dto.GeneralOpenA
...
@@ -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
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment