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
2b4119df
authored
Mar 21, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add missing id,object,created
parent
171135bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
dto/text_response.go
+6
-1
relay/channel/openai/relay-openai.go
+2
-0
No files found.
dto/text_response.go
View file @
2b4119df
package
dto
package
dto
type
TextResponseWithError
struct
{
type
TextResponseWithError
struct
{
Choices
[]
OpenAITextResponseChoice
`json:"choices
"`
Id
string
`json:"id
"`
Object
string
`json:"object"`
Object
string
`json:"object"`
Created
int64
`json:"created"`
Choices
[]
OpenAITextResponseChoice
`json:"choices"`
Data
[]
OpenAIEmbeddingResponseItem
`json:"data"`
Data
[]
OpenAIEmbeddingResponseItem
`json:"data"`
Model
string
`json:"model"`
Model
string
`json:"model"`
Usage
`json:"usage"`
Usage
`json:"usage"`
...
@@ -10,6 +12,9 @@ type TextResponseWithError struct {
...
@@ -10,6 +12,9 @@ type TextResponseWithError struct {
}
}
type
TextResponse
struct
{
type
TextResponse
struct
{
Id
string
`json:"id"`
Object
string
`json:"object"`
Created
int64
`json:"created"`
Model
string
`json:"model"`
Model
string
`json:"model"`
Choices
[]
OpenAITextResponseChoice
`json:"choices"`
Choices
[]
OpenAITextResponseChoice
`json:"choices"`
Usage
`json:"usage"`
Usage
`json:"usage"`
...
...
relay/channel/openai/relay-openai.go
View file @
2b4119df
...
@@ -192,6 +192,8 @@ func OpenaiHandler(c *gin.Context, resp *http.Response, promptTokens int, model
...
@@ -192,6 +192,8 @@ func OpenaiHandler(c *gin.Context, resp *http.Response, promptTokens int, model
}
}
}
}
textResponse
:=
&
dto
.
TextResponse
{
textResponse
:=
&
dto
.
TextResponse
{
Id
:
responseWithError
.
Id
,
Object
:
responseWithError
.
Object
,
Choices
:
responseWithError
.
Choices
,
Choices
:
responseWithError
.
Choices
,
Model
:
responseWithError
.
Model
,
Model
:
responseWithError
.
Model
,
Usage
:
*
usage
,
Usage
:
*
usage
,
...
...
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