diff --git a/common/model-ratio.go b/common/model-ratio.go index e16df566..81559be5 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -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 { diff --git a/relay/channel/tencent/adaptor.go b/relay/channel/tencent/adaptor.go index e262bfb7..4e99b3f0 100644 --- a/relay/channel/tencent/adaptor.go +++ b/relay/channel/tencent/adaptor.go @@ -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 } diff --git a/relay/channel/tencent/constants.go b/relay/channel/tencent/constants.go index 1d13066d..fe176c2c 100644 --- a/relay/channel/tencent/constants.go +++ b/relay/channel/tencent/constants.go @@ -1,5 +1,7 @@ package tencent var ModelList = []string{ + "ChatPro", + "ChatStd", "hunyuan", }