(options: ModelOption[])
| 605 | } |
| 606 | |
| 607 | function dedupeModelOptions(options: ModelOption[]): ModelOption[] { |
| 608 | const seen = new Set<string>() |
| 609 | return options.filter(option => { |
| 610 | const key = option.value === null ? '__default__' : option.value |
| 611 | if (seen.has(key)) return false |
| 612 | seen.add(key) |
| 613 | return true |
| 614 | }) |
| 615 | } |
| 616 | |
| 617 | /** |
| 618 | * Filter model options by the availableModels allowlist. |
no test coverage detected