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

Function findConfig

examples/ts-react-chat/src/lib/server-audio-adapters.ts:31–43  ·  view source on GitHub ↗
(
  list: ReadonlyArray<T>,
  id: string,
)

Source from the content-addressed store, hash-verified

29} from './audio-providers'
30
31function findConfig<T extends { id: string }>(
32 list: ReadonlyArray<T>,
33 id: string,
34): T {
35 const match = list.find((entry) => entry.id === id)
36 if (!match) {
37 throw new UnknownProviderError(
38 id,
39 list.map((entry) => entry.id),
40 )
41 }
42 return match
43}
44
45export function buildSpeechAdapter(provider: SpeechProviderId): AnyTTSAdapter {
46 const config = findConfig(SPEECH_PROVIDERS, provider)

Callers 3

buildSpeechAdapterFunction · 0.85
buildAudioAdapterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected