(interleaved: CatalogModelEntry['interleaved'])
| 141 | } |
| 142 | |
| 143 | function catalogReasoningKey(interleaved: CatalogModelEntry['interleaved']): string | undefined { |
| 144 | // models.dev allows `interleaved: true` as "general support" — read it as |
| 145 | // the default `reasoning_content` field so providers without an explicit |
| 146 | // field name (e.g. some openai-compatible gateways) still round-trip. |
| 147 | if (interleaved === true) return 'reasoning_content'; |
| 148 | if (typeof interleaved !== 'object' || interleaved === null) return undefined; |
| 149 | const field = interleaved.field?.trim(); |
| 150 | return field !== undefined && field.length > 0 ? field : undefined; |
| 151 | } |
| 152 | |
| 153 | /** Extracts the valid, normalized models from a catalog provider entry. */ |
| 154 | export function catalogProviderModels(entry: CatalogProviderEntry): CatalogModel[] { |
no outgoing calls
no test coverage detected