Skip to content

Commit

Permalink
refactor: refactor adapter code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu327 committed Dec 29, 2023
1 parent 133e3a3 commit c60e875
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func ChatProxyHandler(c *gin.Context) {
var req *adapter.ChatCompletionRequest
// Bind the JSON data from the request to the struct
if err := c.ShouldBindJSON(req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
c.JSON(http.StatusBadRequest, openai.APIError{
Code: http.StatusBadRequest,
Message: err.Error(),
})
return
}

Expand Down

0 comments on commit c60e875

Please sign in to comment.