MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / resolveSupportedChatModel

Function resolveSupportedChatModel

packages/server/src/lib/models.ts:74–85  ·  view source on GitHub ↗
(model: SupportedChatModel)

Source from the content-addressed store, hash-verified

72};
73
74function 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
87export function isSupportedChatModel(modelId: string): modelId is SupportedChatModelId {
88 return findSupportedChatModel(modelId) != null;

Callers 1

resolveChatModelFunction · 0.85

Calls 3

resolveAnthropicModelFunction · 0.85
resolveOpenAIModelFunction · 0.85

Tested by

no test coverage detected