From c8ddfbb7122b2b098a4be240c385e8381ca9a0a1 Mon Sep 17 00:00:00 2001 From: Jeremy JIANG Date: Tue, 7 Jan 2025 22:59:11 +0800 Subject: [PATCH 1/2] fix: omit null TopP and Temperature fields in request body --- relay/adaptor/tencent/model.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relay/adaptor/tencent/model.go b/relay/adaptor/tencent/model.go index fb97724e93..1a465f6415 100644 --- a/relay/adaptor/tencent/model.go +++ b/relay/adaptor/tencent/model.go @@ -35,12 +35,12 @@ type ChatRequest struct { // 1. 影响输出文本的多样性,取值越大,生成文本的多样性越强。 // 2. 取值区间为 [0.0, 1.0],未传值时使用各模型推荐值。 // 3. 非必要不建议使用,不合理的取值会影响效果。 - TopP *float64 `json:"TopP"` + TopP *float64 `json:"TopP,omitempty"` // 说明: // 1. 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。 // 2. 取值区间为 [0.0, 2.0],未传值时使用各模型推荐值。 // 3. 非必要不建议使用,不合理的取值会影响效果。 - Temperature *float64 `json:"Temperature"` + Temperature *float64 `json:"Temperature,omitempty"` } type Error struct { From fd383db8f4d6abfe370d74ad623082c51e76aff3 Mon Sep 17 00:00:00 2001 From: Jeremy JIANG Date: Tue, 7 Jan 2025 23:15:46 +0800 Subject: [PATCH 2/2] feat: update Hunyuan model ratios --- relay/billing/ratio/model.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/relay/billing/ratio/model.go b/relay/billing/ratio/model.go index f83aa70c11..fb0881ad51 100644 --- a/relay/billing/ratio/model.go +++ b/relay/billing/ratio/model.go @@ -214,9 +214,19 @@ var ModelRatio = map[string]float64{ "embedding-bert-512-v1": 0.0715, // ¥0.001 / 1k tokens "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, + // https://cloud.tencent.com/document/product/1729/97731#e0e6be58-60c8-469f-bdeb-6c264ce3b4d0 + "hunyuan-turbo": 0.015 * RMB, + "hunyuan-large": 0.004 * RMB, + "hunyuan-large-longcontext": 0.006 * RMB, + "hunyuan-standard": 0.0008 * RMB, + "hunyuan-standard-256K": 0.0005 * RMB, + "hunyuan-translation-lite": 0.005 * RMB, + "hunyuan-role": 0.004 * RMB, + "hunyuan-functioncall": 0.004 * RMB, + "hunyuan-code": 0.004 * RMB, + "hunyuan-turbo-vision": 0.08 * RMB, + "hunyuan-vision": 0.018 * RMB, + "hunyuan-embedding": 0.0007 * RMB, // https://platform.moonshot.cn/pricing "moonshot-v1-8k": 0.012 * RMB, "moonshot-v1-32k": 0.024 * RMB,