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
db024636
authored
Mar 09, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复claude渠道流模式计费可能异常
parent
e1470619
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
relay/channel/claude/relay-claude.go
+4
-0
web/src/constants/channel.constants.js
+3
-3
No files found.
relay/channel/claude/relay-claude.go
View file @
db024636
...
...
@@ -278,6 +278,10 @@ func claudeStreamHandler(requestMode int, modelName string, promptTokens int, c
}
if
requestMode
==
RequestModeCompletion
{
usage
=
*
service
.
ResponseText2Usage
(
responseText
,
modelName
,
promptTokens
)
}
else
{
if
usage
.
CompletionTokens
==
0
{
usage
=
*
service
.
ResponseText2Usage
(
responseText
,
modelName
,
usage
.
PromptTokens
)
}
}
return
nil
,
&
usage
}
...
...
web/src/constants/channel.constants.js
View file @
db024636
export
const
CHANNEL_OPTIONS
=
[
{
key
:
1
,
text
:
'OpenAI'
,
value
:
1
,
color
:
'green'
,
label
:
'OpenAI'
},
{
key
:
2
,
text
:
'Midjourney Proxy'
,
value
:
2
,
color
:
'light-blue'
,
label
:
'Midjourney Proxy'
},
{
key
:
14
,
text
:
'Anthropic Claude'
,
value
:
14
,
color
:
'
black
'
,
label
:
'Anthropic Claude'
},
{
key
:
3
,
text
:
'Azure OpenAI'
,
value
:
3
,
color
:
'
olive
'
,
label
:
'Azure OpenAI'
},
{
key
:
14
,
text
:
'Anthropic Claude'
,
value
:
14
,
color
:
'
indigo
'
,
label
:
'Anthropic Claude'
},
{
key
:
3
,
text
:
'Azure OpenAI'
,
value
:
3
,
color
:
'
teal
'
,
label
:
'Azure OpenAI'
},
{
key
:
11
,
text
:
'Google PaLM2'
,
value
:
11
,
color
:
'orange'
,
label
:
'Google PaLM2'
},
{
key
:
24
,
text
:
'Google Gemini'
,
value
:
24
,
color
:
'orange'
,
label
:
'Google Gemini'
},
{
key
:
15
,
text
:
'百度文心千帆'
,
value
:
15
,
color
:
'blue'
,
label
:
'百度文心千帆'
},
{
key
:
17
,
text
:
'阿里通义千问'
,
value
:
17
,
color
:
'orange'
,
label
:
'阿里通义千问'
},
{
key
:
18
,
text
:
'讯飞星火认知'
,
value
:
18
,
color
:
'blue'
,
label
:
'讯飞星火认知'
},
{
key
:
16
,
text
:
'智谱 ChatGLM'
,
value
:
16
,
color
:
'violet'
,
label
:
'智谱 ChatGLM'
},
{
key
:
16
,
text
:
'智谱 GLM-4V'
,
value
:
26
,
color
:
'
green
'
,
label
:
'智谱 GLM-4V'
},
{
key
:
16
,
text
:
'智谱 GLM-4V'
,
value
:
26
,
color
:
'
purple
'
,
label
:
'智谱 GLM-4V'
},
{
key
:
16
,
text
:
'Moonshot'
,
value
:
25
,
color
:
'green'
,
label
:
'Moonshot'
},
{
key
:
19
,
text
:
'360 智脑'
,
value
:
19
,
color
:
'blue'
,
label
:
'360 智脑'
},
{
key
:
23
,
text
:
'腾讯混元'
,
value
:
23
,
color
:
'teal'
,
label
:
'腾讯混元'
},
...
...
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