https://discord.gg/botpress logo
#🤝help
Old code is being executed after updating Execute Code block
# 🤝help
n

nice-twilight-90450

01/11/2024, 3:30 PM
Hey Everyone! I am busy creating an API Call to Chatbase with the following code (see below). As you can see in my code, I am using the conversationID = 'test-123456', but when I execute this block in my flow, I see that Botpress is executing 'test-12345' (my old version). What I also noticed is that Botpress is not logging the console.log(raw) and console.log('Joren'). I also didn't have this in my previous versions. So it seems that while I am updating my code, Botpress does not execute the updated code. Report-ID: a0b39917-1abd-45af-9117-ed1d799004dd Could anyone have a look at this or explain why this is happening?
Code is here: const chatbaseUrl = 'https://www.chatbase.co/api/v1/chat' const chatbaseApiKey = 'NOT IN DISCORD' const raw = JSON.stringify({ messages: [ { content: 'test', role: 'user' } ], chatbotId: 'QN_pRH7mbcxD6kBUZtFGe', conversationid: 'test-123456' }) const requestOptions = { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization:
Bearer ${chatbaseApiKey}
}, body: raw, redirect: 'follow' } console.log(raw) const response = await axios.post(chatbaseUrl, raw, requestOptions) const result = response.data console.log(result) console.log(raw) console.log('Joren') // Save the result to the workflow object workflow.result = result // Additional actions with the result if needed console.log(result) console.log(raw) console.log('Joren')
q

quick-musician-29561

01/11/2024, 3:32 PM
Sometimes this is a quick solution, if your chatbot is for some reason stuck in the previous state Type //state/reset in the Emulator for me that has fixed the problem many times
n

nice-twilight-90450

01/11/2024, 3:34 PM
Didn't work unfortunately