add comment

This commit is contained in:
Shoubhit Dash 2025-10-22 23:00:08 +05:30
parent 4365fbd2a2
commit 8436229cbb

View file

@ -70,7 +70,8 @@ const addSystemPrompt = async (
const queryText =
mode !== "profile"
? params.prompt
.slice().reverse()
// Create a shallow copy before reversing to avoid mutating the original array
.slice().reverse()
.find((prompt) => prompt.role === "user")
?.content?.filter((content) => content.type === "text")
?.map((content) => (content.type === "text" ? content.text : ""))