mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 07:33:41 +08:00
fix: now the input field can be array type now (close #149)
This commit is contained in:
@@ -38,7 +38,7 @@ type GeneralOpenAIRequest struct {
|
||||
Temperature float64 `json:"temperature"`
|
||||
TopP float64 `json:"top_p"`
|
||||
N int `json:"n"`
|
||||
Input string `json:"input"`
|
||||
Input any `json:"input"`
|
||||
}
|
||||
|
||||
type ChatRequest struct {
|
||||
@@ -189,7 +189,7 @@ func relayHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
||||
case RelayModeCompletions:
|
||||
promptTokens = countTokenText(textRequest.Prompt, textRequest.Model)
|
||||
case RelayModeModeration:
|
||||
promptTokens = countTokenText(textRequest.Input, textRequest.Model)
|
||||
promptTokens = countTokenInput(textRequest.Input, textRequest.Model)
|
||||
}
|
||||
preConsumedTokens := common.PreConsumedQuota
|
||||
if textRequest.MaxTokens != 0 {
|
||||
|
||||
Reference in New Issue
Block a user