feat(api): implement streaming AI responses using Vercel AI SDK (fixes #48) - #56
feat(api): implement streaming AI responses using Vercel AI SDK (fixes #48)#56Diwakar-odds wants to merge 2 commits into
Conversation
|
@Diwakar-odds is attempting to deploy a commit to the suyashyadav1709-9626's projects Team on Vercel. A member of the Team first needs to authorize it. |
PR Analysis & Label RequestThis PR migrates the AI code parsing and generation from the frontend directly calling provider APIs into a secure, robust Next.js Edge Runtime API route ( ECSoC26 Label Justification:
Please review when you have a moment. Thank you! |
…for plain text stream
Summary
Introduces Vercel AI SDK integration for server-side LLM inference.
Motivation
Closes #48.
Changes
app/api/chat/route.ts:chatEdge endpoint to securely proxy LLM requests to Groq and OpenRouter using@ai-sdk/openai.lib/llm/provider.ts:streamTextandgenerateTextto query our new/api/chatroute and consume the data stream format.package.json:ai,@ai-sdk/openai,@upstash/ratelimit,@upstash/redisdependencies.Acceptance Criteria
provider.tsto use internal API route.Impact & Side Effects
No breaking changes to the user interface. Network traffic for AI analysis now routes through
/api/chatrather than directly to providers.How to Test
npm run dev.Quality Checklist