How would I have the chat Wait for user input afte...
# 🤝help
g

https://cdn.discordapp.com/attachments/1132982445575258193/1132982605357252649/image.png

currently with this setup after the KB answers i need to ask the user a generic question
but i want after the kb answers to just wait for user question to come through
to answer that
nvm found out you can use
{{turn.KnowledgeAgent.answer}} in a new capture
a
You just beat me to it haha

https://cdn.discordapp.com/attachments/1132982445575258193/1132983875518345326/image.png

g
@acceptable-kangaroo-64719 would you know how to create a new conversation on page refresh?
a
I'm not sure if we have that feature yet
g
Ah 😓 I think it would be great if that would be the case to be honest
since having the same chat open on refresh or new session is kind of weird
a
If you open the webchat in an incognito window there shouldn't be any previous history
g
Yep. but for example lets say a customer that visits the site frequently but doesn't open the chatbox then one day they open it

https://cdn.discordapp.com/attachments/1132982445575258193/1132988513760071730/image.png

they would see this
since I'm having the chatbot send the first message
It's the same concept other live chat options have where the previous chat is hidden by scroll. (so scroll up to reveal) or it's in another tab
you can already create new conversations here. just wish it auto creates one every time

https://cdn.discordapp.com/attachments/1132982445575258193/1132988928513818686/image.png

a
I have no idea if this will work, but I think it's worth a try: What if you init the bot with a different "clientId" each time?
Like, you'd need to put the bot in its own webpage
but then in that page before you call the init script, you randomly generate a different clientId?

https://cdn.discordapp.com/attachments/1132982445575258193/1132989323327836170/image.png

g
let me test that out
a
it might totally break everything but it also might work 😁
g
client broke
since it doesnt exist
a
interesting....
g
yeah the client id + bot id are ===
so using different ones confuse it
a
yup
I'll ask the engineers when they wake up if they have other ideas
g
Thanks!
I can think of 3 options
- hide the history by a scroll - create a new chat - make a javascript function that clears history or creates new conversation
Copy code
js
window.botpressWebChat.clearhistory();
window.botpressWebChat.createNewChat();
or something
But thanks for trying 😄
a
in v12 we had something like option 3. Hopefully they're implementing something similar for cloud
g
yep I saw something like that in a github somewhere and tried it 😅 didn't work
a
ok I'm going through the archives now. Could you try adding this param to the init script?
maxMessagesHistory: 1
g
nope
i might have found a very bootleg solution
a
oh?
g
Copy code
js
    const key = localStorage.getItem("bp-chat-key-2deeffa9-5fc4-4b08-a33b-f493d405b71d");
    if (key) {
        localStorage.removeItem("bp-chat-key-2deeffa9-5fc4-4b08-a33b-f493d405b71d");
    }
on page load
a
ooooooh interesting!
g
generate a new key every time
that seems to work
It's defo not a proper solution
a
it's not, but its a workaround for sure
esp. since the engineers won't be awake for another three hours
g
Yep 😅
f
Hi,
Did you try this option in the Webchat settings?

https://cdn.discordapp.com/attachments/1132982445575258193/1133081314338295850/image.png

If you want to use the advanced configuration, then you need to check here: https://botpress.com/docs/cloud/webchat-customization/overview/ the option is "useSessionStorage"
a
was that there this whole time? 😅
f
hmmm..... I think like 2 or 3 months 😅
But the option from the webchat embedding, was there forever 😄
I think since v12 too 😄
h
I'd like to know what that option is, since I'm using v12 and still couldn't delete the conversation every time the user opens the webchat. 😅
a
danvito shared it with you in the v12 channel, its generating a new user uuid with every page refresh
2 Views