| 1 | package config |
| 2 | |
| 3 | import ( |
| 4 | "slices" |
| 5 | |
| 6 | "reasonix/internal/provider" |
| 7 | "reasonix/internal/provider/openai" |
| 8 | ) |
| 9 | |
| 10 | // OfficialDeepSeekPinnedVisionModels returns the official vision SKU when it is |
| 11 | // in the enabled model list. Settings can still mark other models for image |
| 12 | // input; this helper is only the stock default. |
| 13 | func OfficialDeepSeekPinnedVisionModels(models []string) []string { |
| 14 | if !slices.ContainsFunc(models, openai.IsOfficialDeepSeekVisionModel) { |
| 15 | return nil |
| 16 | } |
| 17 | return []string{openai.OfficialDeepSeekVisionModel} |
| 18 | } |
| 19 | |
| 20 | func backfillOfficialDeepSeekVisionPrice(p *ProviderEntry) { |
| 21 | sku := openai.OfficialDeepSeekVisionModel |
| 22 | if p == nil || !p.HasModel(sku) { |
| 23 | return |
| 24 | } |
| 25 | if price, ok := pricingForModelKey(p.Prices, sku); ok && price != nil { |
| 26 | return |
| 27 | } |
| 28 | currency := p.ProviderBillingCurrency() |
| 29 | if currency == "" { |
| 30 | currency = "USD" |
| 31 | } |
| 32 | price := deepSeekV4PriceForModel(currency, sku) |
| 33 | if price == nil { |
| 34 | return |
| 35 | } |
| 36 | if p.Prices == nil { |
| 37 | p.Prices = map[string]*provider.Pricing{} |
| 38 | } |
| 39 | p.Prices[sku] = price |
| 40 | } |
| 41 |