mirror of
https://github.com/songquanpeng/one-api.git
synced 2026-03-01 09:14:26 +08:00
Compare commits
3 Commits
v0.6.11-al
...
61a6360c71
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61a6360c71 | ||
|
|
8df4a2670b | ||
|
|
5e3f853fa8 |
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user