Merge remote-tracking branch 'origin/patch/images-edits' into patch/replicate-flux-inpainting

This commit is contained in:
Laisky.Cai
2024-12-16 09:26:52 +00:00
15 changed files with 62 additions and 23 deletions

View File

@@ -64,6 +64,7 @@ func SetupContextForSelectedChannel(c *gin.Context, channel *model.Channel, mode
if channel.SystemPrompt != nil && *channel.SystemPrompt != "" {
c.Set(ctxkey.SystemPrompt, *channel.SystemPrompt)
}
c.Set(ctxkey.ContentType, c.Request.Header.Get("Content-Type"))
c.Set(ctxkey.ModelMapping, channel.GetModelMapping())
c.Set(ctxkey.OriginalModel, modelName) // for retry
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))

View File

@@ -2,6 +2,7 @@ package middleware
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/common/helper"
)

View File

@@ -2,6 +2,7 @@ package middleware
import (
"context"
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/common/helper"
)

View File

@@ -2,11 +2,12 @@ package middleware
import (
"fmt"
"strings"
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/common"
"github.com/songquanpeng/one-api/common/helper"
"github.com/songquanpeng/one-api/common/logger"
"strings"
)
func abortWithMessage(c *gin.Context, statusCode int, message string) {