( entry: CatalogProviderEntry, wire: ProviderType, )
| 107 | * family SDKs append `/chat/completions` to a `/v1` base, so those pass through. |
| 108 | */ |
| 109 | export function catalogBaseUrl( |
| 110 | entry: CatalogProviderEntry, |
| 111 | wire: ProviderType, |
| 112 | ): string | undefined { |
| 113 | const api = entry.api; |
| 114 | if (typeof api !== 'string' || api.length === 0) return undefined; |
| 115 | if (wire === 'anthropic') return api.replace(/\/v1\/?$/, ''); |
| 116 | return api; |
| 117 | } |
| 118 | |
| 119 | /** Normalizes one catalog model entry into a {@link CatalogModel}; skips invalid entries. */ |
| 120 | export function catalogModelToCapability(model: CatalogModelEntry): CatalogModel | undefined { |
no outgoing calls
no test coverage detected