got rid of the excess whitespaces and added the maxOutputTokens into the GenerateConfig in the types.ts

This commit is contained in:
Ivan Rudik
2025-11-09 05:42:16 +00:00
parent 3686ae72da
commit 73668377bf
16 changed files with 366 additions and 371 deletions
+9 -9
View File
@@ -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 }
);
}
}
+7 -7
View File
@@ -6,18 +6,18 @@ import { ChatSetting } from "@/app/exportType/types";
export async function POST(request: Request) {
try {
const { prompt, settings } = await request.json() as {
prompt :string;
settings : ChatSetting;
prompt: string;
settings: ChatSetting;
};
const aiResponse = await chatToGemini(prompt , [], settings);
return NextResponse.json({response : aiResponse});
const aiResponse = await chatToGemini(prompt, [], 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 }
);
}
}