Commit cef0cc3
authored
* fix(gemini): honor custom model ids instead of falling back to default (#227)
Selecting a custom Gemini model id not present in geminiModels (e.g.
gemini-3.5-flash) silently invoked geminiDefaultModelId. The settings
ModelPicker exposes a 'use custom model' option and useSelectedModel keeps
the configured id, so the UI and the actual request disagreed.
getModel() now honors a custom id when it looks like a Gemini model
(gemini- prefix), using the default model's structural info as a baseline
with pricing/tiers dropped so cost shows as unknown rather than the default
model's rates. Ids that don't look like Gemini still fall back to default.
* test(gemini): assert cache prices are cleared for custom models (#227)
* fix(gemini): use own-property check for known model ids (#227)
modelId in geminiModels also matches inherited Object.prototype keys
(e.g. "toString"), resolving info to a function. Use Object.hasOwn so only
real model keys match; prototype-key ids fall through to the default.
---------
Co-authored-by: Armando Vaquera <263793884+proyectoauraorg@users.noreply.github.com>
1 parent 0d3c35e commit cef0cc3
2 files changed
Lines changed: 61 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
177 | 209 | | |
178 | 210 | | |
179 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
495 | 522 | | |
496 | 523 | | |
497 | 524 | | |
| |||
0 commit comments