| 1 | package config |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | |
| 6 | "reasonix/internal/provider" |
| 7 | "reasonix/internal/provider/openai" |
| 8 | ) |
| 9 | |
| 10 | func deepSeekV4EffortOverrides() map[string]ProviderModelOverride { |
| 11 | flash := ProviderModelOverride{SupportedEfforts: []string{"disabled", "low", "high", "max"}, DefaultEffort: "high"} |
| 12 | return map[string]ProviderModelOverride{ |
| 13 | "deepseek-flash": flash, |
| 14 | "deepseek-v4-flash": flash, |
| 15 | openai.OfficialDeepSeekVisionModel: flash, |
| 16 | "deepseek-v4-pro": {SupportedEfforts: []string{"disabled", "low", "high", "max"}, DefaultEffort: "high"}, |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | func isOfficialDeepSeekResponsesProvider(p *ProviderEntry) bool { |
| 21 | return p != nil && strings.EqualFold(strings.TrimSpace(p.Kind), "responses") && |
| 22 | officialProviderHost(p.BaseURL) == "api.deepseek.com" |
| 23 | } |
| 24 | |
| 25 | // backfillOfficialDeepSeekResponsesProPrice fills Prices[pro] when a legacy |
| 26 | // singular Price would otherwise make Pro inherit the Flash list price. |
| 27 | func backfillOfficialDeepSeekResponsesProPrice(p *ProviderEntry) { |
| 28 | if p == nil || !p.HasModel("deepseek-v4-pro") || p.Prices["deepseek-v4-pro"] != nil { |
| 29 | return |
| 30 | } |
| 31 | currency := p.ProviderBillingCurrency() |
| 32 | if currency == "" { |
| 33 | currency = "USD" |
| 34 | } |
| 35 | price := deepSeekV4PriceForModel(currency, "deepseek-v4-pro") |
| 36 | if price == nil { |
| 37 | return |
| 38 | } |
| 39 | if p.Prices == nil { |
| 40 | p.Prices = map[string]*provider.Pricing{} |
| 41 | } |
| 42 | p.Prices["deepseek-v4-pro"] = price |
| 43 | } |
| 44 |