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
015d4880
authored
Oct 10, 2025
by
Seefs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: test model #1993
parent
3cc60f22
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 @
015d4880
...
@@ -59,6 +59,21 @@ func testChannel(channel *model.Channel, testModel string, endpointType string)
...
@@ -59,6 +59,21 @@ func testChannel(channel *model.Channel, testModel string, endpointType string)
w
:=
httptest
.
NewRecorder
()
w
:=
httptest
.
NewRecorder
()
c
,
_
:=
gin
.
CreateTestContext
(
w
)
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"
requestPath
:=
"/v1/chat/completions"
// 如果指定了端点类型,使用指定的端点类型
// 如果指定了端点类型,使用指定的端点类型
...
@@ -90,18 +105,6 @@ func testChannel(channel *model.Channel, testModel string, endpointType string)
...
@@ -90,18 +105,6 @@ func testChannel(channel *model.Channel, testModel string, endpointType string)
Header
:
make
(
http
.
Header
),
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
)
cache
,
err
:=
model
.
GetUserCache
(
1
)
if
err
!=
nil
{
if
err
!=
nil
{
return
testResult
{
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