MCPcopy Create free account
hub / github.com/TanStack/ai / resolveModel

Function resolveModel

examples/ts-react-chat/src/lib/server-audio-adapters.ts:150–158  ·  view source on GitHub ↗
(
  config: (typeof AUDIO_PROVIDERS)[number],
  modelOverride: string | undefined,
)

Source from the content-addressed store, hash-verified

148}
149
150function resolveModel(
151 config: (typeof AUDIO_PROVIDERS)[number],
152 modelOverride: string | undefined,
153): string {
154 if (!modelOverride) return config.model
155 const allowedModels = config.models?.map((m) => m.id) ?? []
156 if (allowedModels.includes(modelOverride)) return modelOverride
157 throw new InvalidModelOverrideError(config.id, modelOverride, allowedModels)
158}

Callers 1

buildAudioAdapterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected