mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: unnecessary trim
This commit is contained in:
parent
51440dd393
commit
de640b7b29
@ -89,12 +89,7 @@ ${finalAnswerPIP}
|
||||
</answer-requirements>` : ''}
|
||||
`.trim();
|
||||
|
||||
// only add if the last user msg is not the same
|
||||
// first find the last message whose role is 'user'
|
||||
const lastUserMsg = msgs.filter(m => m.role === 'user').pop();
|
||||
if ((lastUserMsg?.content as string).trim() !== userContent) {
|
||||
msgs.push({role: 'user', content: removeExtraLineBreaks(userContent)});
|
||||
}
|
||||
msgs.push({role: 'user', content: removeExtraLineBreaks(userContent)});
|
||||
return msgs;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user