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
0d0191f4
authored
Feb 23, 2024
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复测试渠道指定模型时实际使用gpt-3.5-turbo的问题 (close #67)
parent
6eeb61aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
controller/channel-test.go
+2
-1
web/src/components/ChannelsTable.js
+0
-3
No files found.
controller/channel-test.go
View file @
0d0191f4
...
...
@@ -16,6 +16,7 @@ import (
)
func
testChannel
(
channel
*
model
.
Channel
,
request
ChatRequest
)
(
err
error
,
openaiErr
*
OpenAIError
)
{
common
.
SysLog
(
fmt
.
Sprintf
(
"testing channel %d with model %s"
,
channel
.
Id
,
request
.
Model
))
switch
channel
.
Type
{
case
common
.
ChannelTypePaLM
:
fallthrough
...
...
@@ -113,7 +114,7 @@ func TestChannel(c *gin.Context) {
})
return
}
testModel
:=
c
.
Param
(
"model"
)
testModel
:=
c
.
Query
(
"model"
)
channel
,
err
:=
model
.
GetChannelById
(
id
,
true
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
...
...
web/src/components/ChannelsTable.js
View file @
0d0191f4
...
...
@@ -463,11 +463,8 @@ const ChannelsTable = () => {
const
res
=
await
API
.
get
(
`/api/channel/test/
${
record
.
id
}
?model=
${
model
}
`
);
const
{
success
,
message
,
time
}
=
res
.
data
;
if
(
success
)
{
let
newChannels
=
[...
channels
];
record
.
response_time
=
time
*
1000
;
record
.
test_time
=
Date
.
now
()
/
1000
;
setChannelFormat
(
newChannels
)
showInfo
(
`通道
${
record
.
name
}
测试成功,耗时
${
time
.
toFixed
(
2
)}
秒。`
);
}
else
{
showError
(
message
);
...
...
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