reset openai endpoint
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"opencatd-open/store"
|
"opencatd-open/store"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -90,6 +91,13 @@ type ChatCompletionResponse struct {
|
|||||||
} `json:"usage"`
|
} `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 {
|
func AuthMiddleware() gin.HandlerFunc {
|
||||||
return func(c *gin.Context) {
|
return func(c *gin.Context) {
|
||||||
if rootToken == "" {
|
if rootToken == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user