mirror of
https://github.com/songquanpeng/one-api.git
synced 2026-04-26 03:34:25 +08:00
fix: ali image model cannot be found and the error with the incorrect return format.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/songquanpeng/one-api/common/ctxkey"
|
||||
"github.com/songquanpeng/one-api/common/helper"
|
||||
"github.com/songquanpeng/one-api/common/logger"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/openai"
|
||||
@@ -19,7 +20,11 @@ import (
|
||||
func ImageHandler(c *gin.Context, resp *http.Response) (*model.ErrorWithStatusCode, *model.Usage) {
|
||||
apiKey := c.Request.Header.Get("Authorization")
|
||||
apiKey = strings.TrimPrefix(apiKey, "Bearer ")
|
||||
responseFormat := c.GetString("response_format")
|
||||
|
||||
var responseFormat string
|
||||
if req, exists := c.Get(ctxkey.ConvertedRequest); exists {
|
||||
responseFormat = req.(*ImageRequest).ResponseFormat
|
||||
}
|
||||
|
||||
var aliTaskResponse TaskResponse
|
||||
responseBody, err := io.ReadAll(resp.Body)
|
||||
|
||||
Reference in New Issue
Block a user