This commit is contained in:
Rainyy21
2025-11-09 01:43:33 -05:00
19 changed files with 1460 additions and 525 deletions
+12 -7
View File
@@ -5,20 +5,25 @@ import { ChatHistory, ChatSetting } from "@/app/exportType/types";
export async function POST(request: Request) {
try {
const { userMessage, history , settings } = await request.json() as {
userMessage :string;
history : ChatHistory;
settings : ChatSetting;
const { userMessage, history, settings } = await request.json() as {
userMessage: string;
history: ChatHistory;
settings: ChatSetting;
};
const aiResponse = await chatToGemini(userMessage , history, settings);
return NextResponse.json({response : aiResponse});
const aiResponse = await chatToGemini(userMessage, history, settings);
return NextResponse.json({ response: aiResponse });
}
catch(error){
catch (error) {
console.error(error);
return NextResponse.json(
<<<<<<< HEAD
{error: "Error with the model response " + String(error)},
{status : 500}
=======
{ error: "Error with the model response " },
{ status: 500 }
>>>>>>> ce9e6f34ed31b7bff736cc9ba9a1b8dcdec85f3a
);
}
}