(model: SupportedChatModel)
| 72 | }; |
| 73 | |
| 74 | function resolveSupportedChatModel(model: SupportedChatModel): ResolvedModel { |
| 75 | const provider = model.provider; |
| 76 | |
| 77 | switch (provider) { |
| 78 | case "anthropic": |
| 79 | return resolveAnthropicModel(model.id); |
| 80 | case "openai": |
| 81 | return resolveOpenAIModel(model.id); |
| 82 | default: |
| 83 | return assertUnsupportedProvider(provider); |
| 84 | } |
| 85 | }; |
| 86 | |
| 87 | export function isSupportedChatModel(modelId: string): modelId is SupportedChatModelId { |
| 88 | return findSupportedChatModel(modelId) != null; |
no test coverage detected