salmon-exabyte-57459
07/12/2023, 9:55 AMsalmon-exabyte-57459
07/12/2023, 9:57 AMacceptable-kangaroo-64719
07/12/2023, 12:02 PMaddContext
to true to trigger it in your node with the capture card.
js
if (workflow.addContext> 0) {
console.log('\n\n\n Context hook triggered! \n\n\n')
let usr_msgs = []
event.state.session.history.map((turn) => {
if (turn.sender == 'user') {
usr_msgs.push(turn.preview)
}
})
let full_context = usr_msgs.join(' ')
event.preview = full_context //Oh I absolutely should not be allowed to do this
}
This code will mash all of the user's past messages into one big message that can be used to search the knowledge base. You can customize this as needed for your use case.
I'm really hoping to see a "Manually query knowledge base" card coming in the future. Until then, we have these workarounds and #1111026806254993459full-helmet-73535
07/12/2023, 12:06 PMcold-oyster-64572
07/12/2023, 1:51 PMsalmon-exabyte-57459
07/12/2023, 3:56 PMsalmon-exabyte-57459
07/12/2023, 4:02 PMcareful-keyboard-68830
07/14/2023, 1:59 PMcareful-keyboard-68830
07/14/2023, 1:59 PMacceptable-kangaroo-64719
07/14/2023, 2:33 PMworkflow.addContext = true
to turn it on or workplace.addContext = false
to turn it off