fix: custom_endpoint
This commit is contained in:
@@ -2,22 +2,18 @@ package router
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"opencatd-open/pkg/claude"
|
||||
oai "opencatd-open/pkg/openai"
|
||||
"opencatd-open/store"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var (
|
||||
baseUrl = "https://api.openai.com"
|
||||
GPT3Dot5Turbo = "gpt-3.5-turbo"
|
||||
GPT4 = "gpt-4"
|
||||
)
|
||||
@@ -62,13 +58,6 @@ var (
|
||||
// } `json:"usage"`
|
||||
// }
|
||||
|
||||
func init() {
|
||||
if openai_endpoint := os.Getenv("openai_endpoint"); openai_endpoint != "" {
|
||||
log.Println(fmt.Sprintf("replace %s to %s", baseUrl, openai_endpoint))
|
||||
baseUrl = openai_endpoint
|
||||
}
|
||||
}
|
||||
|
||||
func HandleProxy(c *gin.Context) {
|
||||
var (
|
||||
localuser bool
|
||||
|
||||
Reference in New Issue
Block a user