MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / POST

Function POST

examples/astro/src/pages/api/langbase/pipes/run-stream.ts:6–22  ·  view source on GitHub ↗
({request})

Source from the content-addressed store, hash-verified

4import type {APIRoute} from 'astro';
5
6export const POST: APIRoute = async ({request}) => {
7 const runOptions = await request.json();
8
9 // 1. Initiate the Pipe.
10 const pipe = new Pipe(getPipeSummary());
11
12 // 2. Run the Pipe.
13 const {stream, threadId} = await pipe.run(runOptions);
14
15 // 3. Return the ReadableStream directly.
16 return new Response(stream, {
17 status: 200,
18 headers: {
19 'lb-thread-id': threadId ?? '',
20 },
21 });
22};

Callers

nothing calls this directly

Calls 2

runMethod · 0.95
getPipeSummaryFunction · 0.85

Tested by

no test coverage detected