mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
initialize project with Next.js, Tailwind CSS, and essential configurations
This commit is contained in:
13
app/api/chat/route.ts
Normal file
13
app/api/chat/route.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { google } from "@ai-sdk/google";
|
||||
import { streamText } from "ai";
|
||||
|
||||
export const maxDuration = 30;
|
||||
|
||||
export async function POST(req: Request) {
|
||||
const { messages } = await req.json();
|
||||
const result = streamText({
|
||||
model: google("gemini-2.0-flash"),
|
||||
messages,
|
||||
});
|
||||
return result.toDataStreamResponse();
|
||||
}
|
||||
Reference in New Issue
Block a user