|
72 | 72 | "xhigh" {:output_config {:effort "xhigh"} :thinking {:type "adaptive" :display "summarized"}} |
73 | 73 | "max" {:output_config {:effort "max"} :thinking {:type "adaptive" :display "summarized"}}}) |
74 | 74 |
|
| 75 | +(def ^:private deepseek-variants |
| 76 | + {"none" {:thinking {:type "disabled"}} |
| 77 | + "high" {:reasoning_effort "high"} |
| 78 | + "max" {:reasoning_effort "max"}}) |
| 79 | + |
75 | 80 | (def ^:private initial-config* |
76 | 81 | {:providers {"openai" {:api "openai-responses" |
77 | 82 | :url "${env:OPENAI_API_URL:https://api.openai.com}" |
|
188 | 193 | :variantsByModel {".*sonnet[-._]4[-._]6|opus[-._]4[-._][56]" {:variants anthropic-variants} |
189 | 194 | ".*opus[-._]4[-._]7" {:variants anthropic-v2-variants} |
190 | 195 | ".*gpt[-._]5(?:[-._](?:2|4|5)(?!\\d)|[-._]3[-._]codex)" {:variants openai-variants |
191 | | - :excludeProviders ["github-copilot"]}} |
| 196 | + :excludeProviders ["github-copilot"]} |
| 197 | + ".*deepseek[-._]v4[-._]pro" {:variants deepseek-variants |
| 198 | + :api "openai-chat"}} |
192 | 199 | :mcpTimeoutSeconds 60 |
193 | 200 | :lspTimeoutSeconds 30 |
194 | 201 | :streamIdleTimeoutSeconds 120 |
|
243 | 250 | A variant set to {} is removed from the result, allowing users to disable |
244 | 251 | built-in variants." |
245 | 252 | [config provider model-name user-variants] |
246 | | - (let [builtin (when model-name |
247 | | - (some (fn [[pattern-str {:keys [variants excludeProviders]}]] |
| 253 | + (let [provider-api (get-in config [:providers provider :api]) |
| 254 | + api-match? (fn [api config-val] |
| 255 | + (cond (sequential? config-val) (some #{api} config-val) |
| 256 | + config-val (= api config-val) |
| 257 | + :else true)) |
| 258 | + builtin (when model-name |
| 259 | + (some (fn [[pattern-str {:keys [variants excludeProviders api]}]] |
248 | 260 | (when (and (regex-matches? pattern-str model-name) |
249 | | - (not (some #{provider} excludeProviders))) |
| 261 | + (not (some #{provider} excludeProviders)) |
| 262 | + (api-match? provider-api api)) |
250 | 263 | variants)) |
251 | 264 | (:variantsByModel config))) |
252 | 265 | merged (cond |
|
0 commit comments