Back to Prompt Library
implementation
Implement AI SDK Rapid WGS Endpoint
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: AI SDK Pediatric Rapid WGS Triage Agent with AutoGPT
Format
Code-aware
Lines
19
Sections
4
Linked challenge
AI SDK Pediatric Rapid WGS Triage Agent with AutoGPT
Prompt source
Original prompt text with formatting preserved for inspection.
19 lines
4 sections
No variables
0 checklist items
import { streamText, tool } from 'ai';
import { openai } from '@ai-sdk/openai';
import { z } from 'zod';
export async function POST(req: Request) {
const { hpoTerms, variants } = await req.json();
const result = streamText({
model: openai('gpt-4o'),
system: 'You are a pediatric clinical geneticist specializing in rapid WGS triage.',
prompt: `Analyze HPO terms: ${JSON.stringify(hpoTerms)} with variants: ${JSON.stringify(variants)}`,
tools: {
searchPubMed: tool({
description: 'Search PubMed for gene phenotype associations',
parameters: z.object({ query: z.string() }),
execute: async ({ query }) => ({ results: [] })
})
}
});
return result.toDataStreamResponse();
}Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.