MCPcopy Index your code
hub / github.com/TanStack/ai / connectionOptions

Function connectionOptions

testing/e2e/src/components/TranscriptionUI.tsx:28–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26 aimockPort,
27}: TranscriptionUIProps) {
28 const connectionOptions = () => {
29 const body = { provider, testId, aimockPort }
30
31 if (mode === 'sse') {
32 return { connection: fetchServerSentEvents('/api/transcription'), body }
33 }
34 if (mode === 'http-stream') {
35 return { connection: fetchHttpStream('/api/transcription/stream'), body }
36 }
37 return {
38 fetcher: async (input: TranscriptionGenerateInput) => {
39 return generateTranscriptionFn({
40 data: {
41 audio: input.audio as string,
42 language: input.language,
43 provider,
44 aimockPort,
45 testId,
46 },
47 }) as Promise<TranscriptionResult>
48 },
49 }
50 }
51
52 const { generate, result, isLoading, error, status } =
53 useTranscription(connectionOptions())

Callers 1

TranscriptionUIFunction · 0.70

Calls 2

fetchServerSentEventsFunction · 0.85
fetchHttpStreamFunction · 0.85

Tested by

no test coverage detected