Skip to content

Commit

Permalink
增加v1结尾路径的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitbars committed Jul 13, 2024
1 parent e1796a1 commit 3f6d465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func main() {
{
// 中间件检查路径是否以 /v1/chat/completions 结尾
v1.POST("/*path", func(c *gin.Context) {
if strings.HasSuffix(c.Request.URL.Path, "/v1/chat/completions") {
if strings.HasSuffix(c.Request.URL.Path, "/v1/chat/completions") || strings.HasSuffix(c.Request.URL.Path, "/v1") {
handler.OpenAIHandler(c)
return
}
Expand Down

0 comments on commit 3f6d465

Please sign in to comment.