initialize project with Next.js, Tailwind CSS, and essential configurations

This commit is contained in:
dayuan.jiang
2025-03-19 06:04:06 +00:00
commit e26ef731e9
28 changed files with 6176 additions and 0 deletions

13
app/api/chat/route.ts Normal file
View 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();
}