anyone know how to expand the chatHistory so it ho...
# 💻developers
b
anyone know how to expand the chatHistory so it holds more than 6 lines of user and bot messages?: workflow.chatHistory = [] event.state.session.history.map((message) => { if (message.preview != 'understand the user message and respond with next steps by keeping the conversation moving forward.') { workflow.chatHistory.push(
${message.sender}:${message.preview}
) } }) const myStr =
Copy code
Using the provided client information and chat history as context, try to answer the question as honestly as possible by keeping the conversation going with next steps to be taken. If you don't know the answer, say "I don't know." 

Your answer should be friendly and complete, using the same words from the question as much as possible.
Client context: ${JSON.stringify(workflow.client)}
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 = [] }