Fixed commented out programs

This commit is contained in:
PawelC4
2025-11-09 00:37:24 -05:00
parent 972df9b70b
commit 44b5a4dc49
17 changed files with 1558 additions and 1257 deletions
+21 -21
View File
@@ -1,24 +1,24 @@
// import { NextResponse } from "next/server";
// import { chatToGemini } from "@/app/utils/geminiHelper";
// import { ChatHistory, ChatSetting } from "@/app/exportType/types";
import { NextResponse } from "next/server";
import { chatToGemini } from "@/app/utils/geminiHelper";
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;
// };
export async function POST(request: Request) {
try {
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});
// }
// catch(error){
// console.error(error);
// return NextResponse.json(
// {error: "Error with the model response "},
// {status : 500}
// );
// }
// }
const aiResponse = await chatToGemini(userMessage, history, settings);
return NextResponse.json({ response: aiResponse });
}
catch (error) {
console.error(error);
return NextResponse.json(
{ error: "Error with the model response " },
{ status: 500 }
);
}
}