Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
fix nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
linweiyuan committed Sep 26, 2023
1 parent 1d8c5db commit 47f92fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/imitate/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ var (
reg *regexp.Regexp
)

func init() {
reg, _ = regexp.Compile("[^a-zA-Z0-9]+")
}

func CreateChatCompletions(c *gin.Context) {
var originalRequest APIRequest
err := c.BindJSON(&originalRequest)
Expand Down

0 comments on commit 47f92fd

Please sign in to comment.