Compare commits

...

3 Commits

Author SHA1 Message Date
Laisky.Cai
61a6360c71 Merge 5e3f853fa8 into 8df4a2670b 2025-02-24 15:52:21 +08:00
JustSong
8df4a2670b docs: update ByteDance Doubao model link in README
Some checks failed
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
2025-02-21 19:30:16 +08:00
Laisky.Cai
5e3f853fa8 fix: update Prompt type in GeneralOpenAIRequest and adjust related logic in ConvertCompletionsRequest 2025-02-10 02:12:17 +00:00
5 changed files with 9 additions and 9 deletions

View File

@@ -72,7 +72,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
+ [x] [Anthropic Claude 系列模型](https://anthropic.com) (支持 AWS Claude)
+ [x] [Google PaLM2/Gemini 系列模型](https://developers.generativeai.google)
+ [x] [Mistral 系列模型](https://mistral.ai/)
+ [x] [字节跳动豆包大模型](https://console.volcengine.com/ark/region:ark+cn-beijing/model)
+ [x] [字节跳动豆包大模型(火山引擎)](https://www.volcengine.com/experience/ark?utm_term=202502dsinvite&ac=DSASUQY5&rc=2QXCA1VI)
+ [x] [百度文心一言系列模型](https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html)
+ [x] [阿里通义千问系列模型](https://help.aliyun.com/document_detail/2400395.html)
+ [x] [讯飞星火认知大模型](https://www.xfyun.cn/doc/spark/Web.html)

View File

@@ -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,

View File

@@ -335,7 +335,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,
@@ -628,7 +628,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,
}
@@ -782,9 +782,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":

View File

@@ -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)

View File

@@ -59,7 +59,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"`