| | package operation_setting |
| |
|
| | import "strings" |
| |
|
| | const ( |
| | |
| | WebSearchHighTierModelPriceLow = 30.00 |
| | WebSearchHighTierModelPriceMedium = 35.00 |
| | WebSearchHighTierModelPriceHigh = 50.00 |
| | WebSearchPriceLow = 25.00 |
| | WebSearchPriceMedium = 27.50 |
| | WebSearchPriceHigh = 30.00 |
| | |
| | FileSearchPrice = 2.5 |
| | ) |
| |
|
| | const ( |
| | |
| | Gemini25FlashPreviewInputAudioPrice = 1.00 |
| | Gemini25FlashNativeAudioInputAudioPrice = 3.00 |
| | Gemini20FlashInputAudioPrice = 0.70 |
| | ) |
| |
|
| | func GetWebSearchPricePerThousand(modelName string, contextSize string) float64 { |
| | |
| | |
| | |
| | isHighTierModel := (strings.HasPrefix(modelName, "gpt-4.1") || strings.HasPrefix(modelName, "gpt-4o")) && |
| | !strings.Contains(modelName, "mini") |
| | |
| | var priceWebSearchPerThousandCalls float64 |
| | switch contextSize { |
| | case "low": |
| | if isHighTierModel { |
| | priceWebSearchPerThousandCalls = WebSearchHighTierModelPriceLow |
| | } else { |
| | priceWebSearchPerThousandCalls = WebSearchPriceLow |
| | } |
| | case "medium": |
| | if isHighTierModel { |
| | priceWebSearchPerThousandCalls = WebSearchHighTierModelPriceMedium |
| | } else { |
| | priceWebSearchPerThousandCalls = WebSearchPriceMedium |
| | } |
| | case "high": |
| | if isHighTierModel { |
| | priceWebSearchPerThousandCalls = WebSearchHighTierModelPriceHigh |
| | } else { |
| | priceWebSearchPerThousandCalls = WebSearchPriceHigh |
| | } |
| | default: |
| | |
| | if isHighTierModel { |
| | priceWebSearchPerThousandCalls = WebSearchHighTierModelPriceMedium |
| | } else { |
| | priceWebSearchPerThousandCalls = WebSearchPriceMedium |
| | } |
| | } |
| | return priceWebSearchPerThousandCalls |
| | } |
| |
|
| | func GetFileSearchPricePerThousand() float64 { |
| | return FileSearchPrice |
| | } |
| |
|
| | func GetGeminiInputAudioPricePerMillionTokens(modelName string) float64 { |
| | if strings.HasPrefix(modelName, "gemini-2.5-flash-preview") { |
| | return Gemini25FlashPreviewInputAudioPrice |
| | } else if strings.HasPrefix(modelName, "gemini-2.5-flash-preview-native-audio") { |
| | return Gemini25FlashNativeAudioInputAudioPrice |
| | } else if strings.HasPrefix(modelName, "gemini-2.0-flash") { |
| | return Gemini20FlashInputAudioPrice |
| | } |
| | return 0 |
| | } |
| |
|