mirror of
https://github.com/PinkSheep27/SBU-Hackathon.git
synced 2026-10-11 01:40:25 -04:00
got rid of the excess whitespaces and added the maxOutputTokens into the GenerateConfig in the types.ts
This commit is contained in:
@@ -5,20 +5,20 @@ 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(
|
||||
{error: "Error with the model response "},
|
||||
{status : 500}
|
||||
{ error: "Error with the model response " },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user