mirror of
https://github.com/PinkSheep27/SBU-Hackathon.git
synced 2026-10-11 01:20:27 -04:00
fix the ai and it should be working
This commit is contained in:
@@ -8,22 +8,19 @@ export async function POST(request: Request) {
|
||||
const { userMessage, history, settings } = await request.json() as {
|
||||
userMessage: string;
|
||||
history: ChatHistory;
|
||||
settings: ChatSetting;
|
||||
settings?: ChatSetting; // settings is optional from the request
|
||||
};
|
||||
|
||||
const aiResponse = await chatToGemini(userMessage, history, settings);
|
||||
return NextResponse.json({ response: aiResponse });
|
||||
// Call the Gemini helper function
|
||||
const geminiResponse = await chatToGemini(userMessage, history, settings || {});
|
||||
|
||||
return NextResponse.json({ response: geminiResponse });
|
||||
}
|
||||
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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user