diff --git a/core/http/endpoints/openai/request.go b/core/http/endpoints/openai/request.go index 505244c4..1f845c6f 100644 --- a/core/http/endpoints/openai/request.go +++ b/core/http/endpoints/openai/request.go @@ -185,6 +185,14 @@ func updateRequestConfig(config *config.BackendConfig, input *schema.OpenAIReque config.RepeatPenalty = input.RepeatPenalty } + if input.FrequencyPenalty!= 0 { + config.FrequencyPenalty = input.FrequencyPenalty + } + + if input.PresencePenalty!= 0 { + config.PresencePenalty = input.PresencePenalty + } + if input.Keep != 0 { config.Keep = input.Keep } diff --git a/core/schema/openai.go b/core/schema/openai.go index 1c13847c..6aa0f1b0 100644 --- a/core/schema/openai.go +++ b/core/schema/openai.go @@ -108,7 +108,7 @@ type ChatCompletionResponseFormat struct { type OpenAIRequest struct { PredictionOptions - Context context.Context `json:"-"` + Context context.Context `json:"-"` Cancel context.CancelFunc `json:"-"` // whisper diff --git a/core/schema/prediction.go b/core/schema/prediction.go index d75e5eb8..4933f2d2 100644 --- a/core/schema/prediction.go +++ b/core/schema/prediction.go @@ -25,6 +25,7 @@ type PredictionOptions struct { Keep int `json:"n_keep" yaml:"n_keep"` FrequencyPenalty float64 `json:"frequency_penalty" yaml:"frequency_penalty"` + PresencePenalty float64 `json:"presence_penalty" yaml:"presence_penalty"` TFZ float64 `json:"tfz" yaml:"tfz"` TypicalP float64 `json:"typical_p" yaml:"typical_p"`