mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
13 lines
321 B
TypeScript
13 lines
321 B
TypeScript
|
|
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();
|
||
|
|
}
|