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
69a497ef
authored
Jun 11, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: correct OpenAI error code's type
parent
e479f43c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
controller/channel-test.go
+1
-1
controller/relay.go
+1
-1
No files found.
controller/channel-test.go
View file @
69a497ef
...
@@ -59,7 +59,7 @@ func testChannel(channel *model.Channel, request *ChatRequest) error {
...
@@ -59,7 +59,7 @@ func testChannel(channel *model.Channel, request *ChatRequest) error {
return
err
return
err
}
}
if
response
.
Usage
.
CompletionTokens
==
0
{
if
response
.
Usage
.
CompletionTokens
==
0
{
return
errors
.
New
(
fmt
.
Sprintf
(
"type %s, code %
s
, message %s"
,
response
.
Error
.
Type
,
response
.
Error
.
Code
,
response
.
Error
.
Message
))
return
errors
.
New
(
fmt
.
Sprintf
(
"type %s, code %
v
, message %s"
,
response
.
Error
.
Type
,
response
.
Error
.
Code
,
response
.
Error
.
Message
))
}
}
return
nil
return
nil
}
}
...
...
controller/relay.go
View file @
69a497ef
...
@@ -65,7 +65,7 @@ type OpenAIError struct {
...
@@ -65,7 +65,7 @@ type OpenAIError struct {
Message
string
`json:"message"`
Message
string
`json:"message"`
Type
string
`json:"type"`
Type
string
`json:"type"`
Param
string
`json:"param"`
Param
string
`json:"param"`
Code
string
`json:"code"`
Code
any
`json:"code"`
}
}
type
OpenAIErrorWithStatusCode
struct
{
type
OpenAIErrorWithStatusCode
struct
{
...
...
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