(raw)
| 61 | return { models: models.flat() }; |
| 62 | }, |
| 63 | parseModels(raw) { |
| 64 | const models = XAIResponse.parse(raw).models; |
| 65 | const seen = new Set<string>(); |
| 66 | const expanded: XAIModel[] = []; |
| 67 | |
| 68 | for (const model of models) { |
| 69 | if (!seen.has(model.id)) { |
| 70 | seen.add(model.id); |
| 71 | expanded.push(model); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | for (const model of models) { |
| 76 | for (const alias of model.aliases ?? []) { |
| 77 | if (seen.has(alias)) continue; |
| 78 | seen.add(alias); |
| 79 | expanded.push({ ...model, id: alias, canonical_id: model.id }); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | return expanded; |
| 84 | }, |
| 85 | translateModel(model, context) { |
| 86 | const existing = context.existing(model.id); |
| 87 | if (existing === undefined) return undefined; |
nothing calls this directly
no outgoing calls
no test coverage detected