feat(media, suggestions): handle chat history correctly

This commit is contained in:
ItzCrazyKns
2025-12-27 20:03:34 +05:30
parent be7bd62a74
commit bb7b7170ca
6 changed files with 24 additions and 8 deletions

View File

@@ -20,7 +20,10 @@ export const POST = async (req: Request) => {
const suggestions = await generateSuggestions(
{
chatHistory: body.chatHistory,
chatHistory: body.chatHistory.map(([role, content]) => ({
role: role === 'human' ? 'user' : 'assistant',
content,
})),
},
llm,
);