mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-03 10:18:15 +00:00
feat(agents): update suggestion generator
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user