mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 11:53:42 +08:00
feat: support omni-moderation-latest
This commit is contained in:
@@ -4,11 +4,12 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/songquanpeng/one-api/relay/constant/role"
|
||||
"math"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/songquanpeng/one-api/relay/constant/role"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/songquanpeng/one-api/common"
|
||||
"github.com/songquanpeng/one-api/common/config"
|
||||
@@ -30,7 +31,7 @@ func getAndValidateTextRequest(c *gin.Context, relayMode int) (*relaymodel.Gener
|
||||
return nil, err
|
||||
}
|
||||
if relayMode == relaymode.Moderations && textRequest.Model == "" {
|
||||
textRequest.Model = "text-moderation-latest"
|
||||
textRequest.Model = "omni-moderation-latest"
|
||||
}
|
||||
if relayMode == relaymode.Embeddings && textRequest.Model == "" {
|
||||
textRequest.Model = c.Param("model")
|
||||
|
||||
Reference in New Issue
Block a user