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

Function fetchAudioViaRoute

testing/e2e/src/components/AudioGenUI.tsx:14–31  ·  view source on GitHub ↗
(payload: {
  prompt: string
  provider: Provider
  testId?: string
  aimockPort?: number
  feature?: Feature
})

Source from the content-addressed store, hash-verified

12}
13
14async function fetchAudioViaRoute(payload: {
15 prompt: string
16 provider: Provider
17 testId?: string
18 aimockPort?: number
19 feature?: Feature
20}): Promise<AudioGenerationResult> {
21 const response = await fetch('/api/audio', {
22 method: 'POST',
23 headers: { 'Content-Type': 'application/json' },
24 body: JSON.stringify({ data: payload }),
25 })
26 const body = await response.json()
27 if (!response.ok) {
28 throw new Error(body.error || `HTTP ${response.status}`)
29 }
30 return body.result as AudioGenerationResult
31}
32
33export function AudioGenUI({
34 provider,

Callers 1

generateFunction · 0.85

Calls 2

jsonMethod · 0.80
fetchFunction · 0.50

Tested by

no test coverage detected