reset openai endpoint
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"opencatd-open/store"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -90,6 +91,13 @@ type ChatCompletionResponse struct {
|
||||
} `json:"usage"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
if openai_endpoint := os.Getenv("openai_endpoint"); openai_endpoint != "" {
|
||||
log.Println("replace %s to %s", baseUrl, openai_endpoint)
|
||||
baseUrl = openai_endpoint
|
||||
}
|
||||
}
|
||||
|
||||
func AuthMiddleware() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
if rootToken == "" {
|
||||
|
||||
Reference in New Issue
Block a user