mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 17:16:38 +08:00
Merge pull request #26 from Sagit-chu/upstream-pr-2071
[Upstream] fix: update deepseek's price
This commit is contained in:
commit
84af85df78
@ -19,9 +19,8 @@ import (
|
||||
)
|
||||
|
||||
func ConvertCompletionsRequest(textRequest model.GeneralOpenAIRequest) *Request {
|
||||
p, _ := textRequest.Prompt.(string)
|
||||
return &Request{
|
||||
Prompt: p,
|
||||
Prompt: textRequest.Prompt,
|
||||
MaxTokens: textRequest.MaxTokens,
|
||||
Stream: textRequest.Stream,
|
||||
Temperature: textRequest.Temperature,
|
||||
|
@ -337,7 +337,7 @@ var ModelRatio = map[string]float64{
|
||||
"command-r": 0.5 / 1000 * USD,
|
||||
"command-r-plus": 3.0 / 1000 * USD,
|
||||
// https://platform.deepseek.com/api-docs/pricing/
|
||||
"deepseek-chat": 0.14 * MILLI_USD,
|
||||
"deepseek-chat": 0.27 * MILLI_USD,
|
||||
"deepseek-reasoner": 0.55 * MILLI_USD,
|
||||
// https://www.deepl.com/pro?cta=header-prices
|
||||
"deepl-zh": 25.0 / 1000 * USD,
|
||||
@ -630,7 +630,7 @@ var CompletionRatio = map[string]float64{
|
||||
// whisper
|
||||
"whisper-1": 0, // only count input tokens
|
||||
// deepseek
|
||||
"deepseek-chat": 0.28 / 0.14,
|
||||
"deepseek-chat": 1.1 / 0.27,
|
||||
"deepseek-reasoner": 2.19 / 0.55,
|
||||
}
|
||||
|
||||
@ -784,9 +784,6 @@ func GetCompletionRatio(name string, channelType int) float64 {
|
||||
if strings.HasPrefix(name, "gemini-") {
|
||||
return 3
|
||||
}
|
||||
if strings.HasPrefix(name, "deepseek-") {
|
||||
return 2
|
||||
}
|
||||
|
||||
switch name {
|
||||
case "llama2-70b-4096":
|
||||
|
@ -33,6 +33,10 @@ func RelayTextHelper(c *gin.Context) *model.ErrorWithStatusCode {
|
||||
}
|
||||
meta.IsStream = textRequest.Stream
|
||||
|
||||
if reqBody, ok := c.Get(ctxkey.KeyRequestBody); ok {
|
||||
logger.Debugf(c.Request.Context(), "get text request: %s\n", string(reqBody.([]byte)))
|
||||
}
|
||||
|
||||
// map model name
|
||||
meta.OriginModelName = textRequest.Model
|
||||
textRequest.Model, _ = getMappedModelName(textRequest.Model, meta.ModelMapping)
|
||||
|
@ -61,7 +61,7 @@ type GeneralOpenAIRequest struct {
|
||||
EncodingFormat string `json:"encoding_format,omitempty"`
|
||||
Dimensions int `json:"dimensions,omitempty"`
|
||||
// https://platform.openai.com/docs/api-reference/images/create
|
||||
Prompt any `json:"prompt,omitempty"`
|
||||
Prompt string `json:"prompt,omitempty"`
|
||||
Quality *string `json:"quality,omitempty"`
|
||||
Size string `json:"size,omitempty"`
|
||||
Style *string `json:"style,omitempty"`
|
||||
|
Loading…
Reference in New Issue
Block a user