From 5fb4f931c9a91a0f43fe3c2dd5ecdba11db8b5ee Mon Sep 17 00:00:00 2001 From: Spike Lu Date: Sun, 5 Jan 2025 15:16:10 -0800 Subject: [PATCH] fix bug --- internal/provider/anthropic/cost.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/provider/anthropic/cost.go b/internal/provider/anthropic/cost.go index 6785fea..36680ca 100644 --- a/internal/provider/anthropic/cost.go +++ b/internal/provider/anthropic/cost.go @@ -64,7 +64,13 @@ func (ce *CostEstimator) EstimatePromptCost(model string, tks int) (float64, err } - selected := selectModel(model) + selected := "" + if strings.HasPrefix(model, "us") { + selected = convertAmazonModelToAnthropicModel(model) + } else { + selected = selectModel(model) + } + cost, ok := costMap[selected] if !ok { return 0, fmt.Errorf("%s is not present in the cost map provided", model)