feat(agents): update suggestion generator

This commit is contained in:
ItzCrazyKns
2025-11-23 19:23:18 +05:30
parent 74bc08d189
commit 0ac8569a9e
3 changed files with 35 additions and 36 deletions

View File

@@ -19,19 +19,9 @@ export const POST = async (req: Request) => {
body.chatModel.key,
);
const chatHistory = body.chatHistory
.map((msg: any) => {
if (msg.role === 'user') {
return new HumanMessage(msg.content);
} else if (msg.role === 'assistant') {
return new AIMessage(msg.content);
}
})
.filter((msg) => msg !== undefined) as BaseMessage[];
const suggestions = await generateSuggestions(
{
chatHistory,
chatHistory: body.chatHistory,
},
llm,
);