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
3f7d9c4b
authored
Mar 01, 2025
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Improve error handling for model ratio and price validation #800
parent
159f39d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
controller/channel-test.go
+2
-2
No files found.
controller/channel-test.go
View file @
3f7d9c4b
...
@@ -147,8 +147,8 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
...
@@ -147,8 +147,8 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
}
}
modelPrice
,
usePrice
:=
common
.
GetModelPrice
(
testModel
,
false
)
modelPrice
,
usePrice
:=
common
.
GetModelPrice
(
testModel
,
false
)
modelRatio
,
success
:=
common
.
GetModelRatio
(
testModel
)
modelRatio
,
success
:=
common
.
GetModelRatio
(
testModel
)
if
!
success
{
if
!
usePrice
&&
!
success
{
return
fmt
.
Errorf
(
"模型 %s 倍率未设置"
,
testModel
),
nil
return
fmt
.
Errorf
(
"模型 %s 倍率
和价格均
未设置"
,
testModel
),
nil
}
}
completionRatio
:=
common
.
GetCompletionRatio
(
testModel
)
completionRatio
:=
common
.
GetCompletionRatio
(
testModel
)
ratio
:=
modelRatio
ratio
:=
modelRatio
...
...
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