https://discord.gg/botpress logo
why wont any exicute code work? this is the code i...
# 💻developers
b
why wont any exicute code work? this is the code i am trying to get worrking: workflow.chatHistory = [] event.state.session.history.map((message) => { if (message.preview != 'what would you like to know about these Estimates?') { workflow.chatHistory.push(
${message.sender}:${message.preview}
) } }) const myStr =
Copy code
Using the provided vehicleInfoQuery information and chat history as context, try to answer the question as honestly as possible. if you don't know the answer, say "i don't know."
\You Answer should be friendly and complete, using the same words form the question as much as possible.
vehicle info: ${JSON.stringify(workflow.vehicleInfoQuery)}
Chat history: ${JSON.stringify(workflow.chatHistory)}
User question: ${event.preview}}
console.log(
The prompt is ${myStr.length} characters long
) if (myStr.length > 5000) { console.log('The prompt is too long! Omitting the chat history...') workflow.chatHistory = [] }