vercel-labs / vercel-labs/json-render
Cloudflare API Gateway example
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 16.8k
- Forks
- 901
- Avg merge
- 3h 14m
- Merged PRs (30d)
- 4
Description
Ia there an example showing how to use Cloudflare AI Gateway with the dashboard app? Do we have to replace the 'ai' lib with a something else? Thanks
import { streamText } from "ai";
import { componentList } from "@/lib/catalog";
export const maxDuration = 30;
export async function POST(req: Request) {
const { prompt, context } = await req.json();
let fullPrompt = prompt;
// Add data context
if (context?.data) {
fullPrompt += `\n\nAVAILABLE DATA:\n${JSON.stringify(context.data, null, 2)}`;
}
const result = streamText({
model: "anthropic/claude-haiku-4.5",
system: SYSTEM_PROMPT,
prompt: fullPrompt,
temperature: 0.7,
});
return result.toTextStreamResponse();
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the dashboard app's shown TypeScript POST handler and its use of the ai library and streamText. Document or add an example for Cloudflare AI Gateway, including whether the existing library must be replaced; done means the integration path and required changes are clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100