feat: add ChatPro & ChatStd for tencent (#1010)

This commit is contained in:
JustSong 2024-02-18 14:40:01 +08:00
parent 28d512a675
commit 9383b638a6
3 changed files with 7 additions and 0 deletions

View File

@ -117,6 +117,8 @@ var ModelRatio = map[string]float64{
"embedding_s1_v1": 0.0715, // ¥0.001 / 1k tokens
"semantic_similarity_s1_v1": 0.0715, // ¥0.001 / 1k tokens
"hunyuan": 7.143, // ¥0.1 / 1k tokens // https://cloud.tencent.com/document/product/1729/97731#e0e6be58-60c8-469f-bdeb-6c264ce3b4d0
"ChatStd": 0.01 * RMB,
"ChatPro": 0.1 * RMB,
}
func ModelRatio2JSONString() string {

View File

@ -13,6 +13,8 @@ import (
"strings"
)
// https://cloud.tencent.com/document/api/1729/101837
type Adaptor struct {
Sign string
}
@ -24,6 +26,7 @@ func (a *Adaptor) GetRequestURL(meta *util.RelayMeta) (string, error) {
func (a *Adaptor) SetupRequestHeader(c *gin.Context, req *http.Request, meta *util.RelayMeta) error {
channel.SetupCommonRequestHeader(c, req, meta)
req.Header.Set("Authorization", a.Sign)
req.Header.Set("X-TC-Action", meta.ActualModelName)
return nil
}

View File

@ -1,5 +1,7 @@
package tencent
var ModelList = []string{
"ChatPro",
"ChatStd",
"hunyuan",
}