feat: gpt-4-gizmo-g-* model is supported

This commit is contained in:
RockYang
2024-01-15 15:03:05 +08:00
parent 59fa21779b
commit dc24a8c781
14 changed files with 86 additions and 31 deletions

View File

@@ -435,7 +435,7 @@ func (h *ChatHandler) doRequest(ctx context.Context, req types.ApiRequest, platf
apiURL = strings.Replace(apiKey.ApiURL, "{model}", req.Model, 1)
break
default:
if req.Model == "gpt-4-all" {
if req.Model == "gpt-4-all" || strings.HasPrefix(req.Model, "gpt-4-gizmo-g-") {
apiURL = "https://gpt.bemore.lol/v1/chat/completions"
} else {
apiURL = apiKey.ApiURL

View File

@@ -329,7 +329,7 @@ func (h *PaymentHandler) notify(orderNo string) error {
user.ImgCalls += remark.ImgCalls
}
} else { // 非 VIP 用户
} else { // 非 VIP 用户
if remark.Days > 0 { // vip 套餐days > 0, calls == 0
user.ExpiredTime = time.Now().AddDate(0, 0, remark.Days).Unix()
user.Calls += h.App.SysConfig.VipMonthCalls

View File

@@ -21,11 +21,11 @@ func NewUploadHandler(app *core.AppServer, db *gorm.DB, manager *oss.UploaderMan
}
func (h *UploadHandler) Upload(c *gin.Context) {
fileURL, err := h.uploaderManager.GetUploadHandler().PutFile(c, "file")
file, err := h.uploaderManager.GetUploadHandler().PutFile(c, "file")
if err != nil {
resp.ERROR(c, err.Error())
return
}
resp.SUCCESS(c, fileURL)
resp.SUCCESS(c, file)
}