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

Function connectionOptions

testing/e2e/src/components/VideoGenUI.tsx:52–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 const [imageFile, setImageFile] = useState<File | null>(null)
51
52 const connectionOptions = () => {
53 const body = { provider, testId, aimockPort }
54
55 if (mode === 'sse') {
56 return { connection: fetchServerSentEvents('/api/video'), body }
57 }
58 if (mode === 'http-stream') {
59 return { connection: fetchHttpStream('/api/video/stream'), body }
60 }
61 return {
62 fetcher: async (input: { prompt: MediaPrompt }) => {
63 return generateVideoFn({
64 data: { prompt: input.prompt, provider, aimockPort, testId },
65 }) as Promise<VideoGenerateResult>
66 },
67 }
68 }
69
70 const { generate, result, videoStatus, isLoading, error, status } =
71 useGenerateVideo(connectionOptions())

Callers 1

VideoGenUIFunction · 0.70

Calls 2

fetchServerSentEventsFunction · 0.85
fetchHttpStreamFunction · 0.85

Tested by

no test coverage detected