api should only return new msgs

This commit is contained in:
ramnique 2025-03-07 11:51:33 +05:30
parent 3e67591367
commit 2a16a8ce31

View file

@ -210,7 +210,7 @@ export async function POST(
} while (hasToolCalls);
const responseBody: z.infer<typeof ApiResponse> = {
messages: currentMessages,
messages: currentMessages.slice(reqMessages.length),
state: currentState,
};
return Response.json(responseBody);