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
40aa5490
authored
Oct 10, 2025
by
Calcium-Ion
Committed by
GitHub
Oct 10, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1995 from seefs001/fix/test-channel-1993
fix: test model #1993
parents
30112005
015d4880
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
controller/channel-test.go
+15
-12
No files found.
controller/channel-test.go
View file @
40aa5490
...
...
@@ -59,6 +59,21 @@ func testChannel(channel *model.Channel, testModel string, endpointType string)
w
:=
httptest
.
NewRecorder
()
c
,
_
:=
gin
.
CreateTestContext
(
w
)
testModel
=
strings
.
TrimSpace
(
testModel
)
if
testModel
==
""
{
if
channel
.
TestModel
!=
nil
&&
*
channel
.
TestModel
!=
""
{
testModel
=
strings
.
TrimSpace
(
*
channel
.
TestModel
)
}
else
{
models
:=
channel
.
GetModels
()
if
len
(
models
)
>
0
{
testModel
=
strings
.
TrimSpace
(
models
[
0
])
}
if
testModel
==
""
{
testModel
=
"gpt-4o-mini"
}
}
}
requestPath
:=
"/v1/chat/completions"
// 如果指定了端点类型,使用指定的端点类型
...
...
@@ -90,18 +105,6 @@ func testChannel(channel *model.Channel, testModel string, endpointType string)
Header
:
make
(
http
.
Header
),
}
if
testModel
==
""
{
if
channel
.
TestModel
!=
nil
&&
*
channel
.
TestModel
!=
""
{
testModel
=
*
channel
.
TestModel
}
else
{
if
len
(
channel
.
GetModels
())
>
0
{
testModel
=
channel
.
GetModels
()[
0
]
}
else
{
testModel
=
"gpt-4o-mini"
}
}
}
cache
,
err
:=
model
.
GetUserCache
(
1
)
if
err
!=
nil
{
return
testResult
{
...
...
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