From b2679cca65ef03304c826c42bbad633c440ae2d4 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sun, 21 Apr 2024 15:57:01 +0800 Subject: [PATCH] fix: fix preview completion ratio (close #1326) --- relay/billing/ratio/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/billing/ratio/model.go b/relay/billing/ratio/model.go index d86881cf..b410df94 100644 --- a/relay/billing/ratio/model.go +++ b/relay/billing/ratio/model.go @@ -260,7 +260,7 @@ func GetCompletionRatio(name string) float64 { return 4.0 / 3.0 } if strings.HasPrefix(name, "gpt-4") { - if strings.HasPrefix(name, "gpt-4-turbo") { + if strings.HasPrefix(name, "gpt-4-turbo") || strings.HasSuffix(name, "preview") { return 3 } return 2