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

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