mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
fix: unnecessary trim
This commit is contained in:
@@ -89,12 +89,7 @@ ${finalAnswerPIP}
|
|||||||
</answer-requirements>` : ''}
|
</answer-requirements>` : ''}
|
||||||
`.trim();
|
`.trim();
|
||||||
|
|
||||||
// only add if the last user msg is not the same
|
msgs.push({role: 'user', content: removeExtraLineBreaks(userContent)});
|
||||||
// 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)});
|
|
||||||
}
|
|
||||||
return msgs;
|
return msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user