chore: tiny improvements

This commit is contained in:
JustSong 2024-04-24 21:49:38 +08:00
parent 2731a4477a
commit b11c3e0a7e
4 changed files with 12 additions and 9 deletions

View File

@ -83,6 +83,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
+ [x] [零一万物](https://platform.lingyiwanwu.com/)
+ [x] [阶跃星辰](https://platform.stepfun.com/)
+ [x] [Coze](https://www.coze.com/)
+ [x] [Cohere](https://cohere.com/)
2. 支持配置镜像以及众多[第三方代理服务](https://iamazing.cn/page/openai-api-third-party-services)。
3. 支持通过**负载均衡**的方式访问多个渠道。
4. 支持 **stream 模式**,可以通过流式传输实现打字机效果。

View File

@ -7,7 +7,6 @@ import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/songquanpeng/one-api/common/logger"
"github.com/songquanpeng/one-api/relay/adaptor"
"github.com/songquanpeng/one-api/relay/meta"
"github.com/songquanpeng/one-api/relay/model"
@ -17,7 +16,7 @@ type Adaptor struct{}
// ConvertImageRequest implements adaptor.Adaptor.
func (*Adaptor) ConvertImageRequest(request *model.ImageRequest) (any, error) {
panic("unimplemented")
return nil, errors.New("not implemented")
}
// ConvertImageRequest implements adaptor.Adaptor.
@ -32,8 +31,7 @@ func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error) {
func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Request, meta *meta.Meta) error {
adaptor.SetupCommonRequestHeader(c, req, meta)
logger.SysLog(meta.APIKey)
req.Header.Set("Authorization", "bearer "+meta.APIKey)
req.Header.Set("Authorization", "Bearer "+meta.APIKey)
return nil
}

View File

@ -1,3 +1,7 @@
package cohere
var ModelList = []string{"command", "command-light", "command-nightly", "command-light-nightly", "command-r", "command-r-plus"}
var ModelList = []string{
"command", "command-nightly",
"command-light", "command-light-nightly",
"command-r", "command-r-plus",
}

View File

@ -163,13 +163,13 @@ var ModelRatio = map[string]float64{
"step-1v-32k": 0.024 * RMB,
"step-1-32k": 0.024 * RMB,
"step-1-200k": 0.15 * RMB,
//https://cohere.com/pricing command系列没有给出定价 所以采用的openrouter的标准
// https://cohere.com/pricing
"command": 0.5,
"command-light": 0.5,
"command-nightly": 0.5,
"command-light": 0.5,
"command-light-nightly": 0.5,
"command-r": 0.25,
"command-r-plus ": 1.5,
"command-r": 0.5 / 1000 * USD,
"command-r-plus ": 3.0 / 1000 * USD,
}
var CompletionRatio = map[string]float64{}