mirror of
https://github.com/PinkSheep27/SBU-Hackathon.git
synced 2026-10-11 01:40:25 -04:00
Fixed commented out programs
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
// import { NextResponse } from "next/server";
|
||||
// import { chatToGemini } from "@/app/utils/geminiHelper";
|
||||
// import { ChatSetting } from "@/app/exportType/types";
|
||||
import { NextResponse } from "next/server";
|
||||
import { chatToGemini } from "@/app/utils/geminiHelper";
|
||||
import { ChatSetting } from "@/app/exportType/types";
|
||||
|
||||
|
||||
// export async function POST(request: Request) {
|
||||
// try {
|
||||
// const { prompt, settings } = await request.json() as {
|
||||
// prompt :string;
|
||||
// settings : ChatSetting;
|
||||
// };
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const { prompt, settings } = await request.json() as {
|
||||
prompt: string;
|
||||
settings: ChatSetting;
|
||||
};
|
||||
|
||||
// const aiResponse = await chatToGemini(prompt , [], 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(prompt, [], settings);
|
||||
return NextResponse.json({ response: aiResponse });
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
return NextResponse.json(
|
||||
{ error: "Error with the model response " },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user