Webchat stops randomly, doesn't happen in studio
# 🤝help
m
It should just have to send a pre-recorded text here as well.

https://cdn.discordapp.com/attachments/1139465635492012082/1139465635827560528/image.png

https://cdn.discordapp.com/attachments/1139465635492012082/1139465636381204530/image.png

In the botpress logs it shows it sent it and kept going but it never apeared in webchat: DM [Capture] Field validation successful! Extracted: "Increase discord members". Input: Increase discord members DM [Capture] Prompt success Dialog [91b45672-a76b-40fa-89e4-8a1ac557be5f] Sending Message. Type: text. Text: Thank you. One moment, please, while I prepare your blueprint. DM Executing hook conversation_turn_action of agent "SummaryAgent" Dialog [91b45672-a76b-40fa-89e4-8a1ac557be5f] Transition from (flow:Main) [node:Desired_Outcomes] to [node:Strategy_Objectives]
Report ID: d1a2c4b4-253b-4616-9c84-48cb911fa49f
@crooked-van-25152 sorry I didnt see I had to get the report id, I have added it now
@crooked-van-25152 any luck?
@green-whale-28135 @rich-battery-69172 sorry to bug, I assume you just have a backlog, but I want to make sure that I have done everything here that I am supposed to. Company is pitching the bot later today and I want it get it back working. Let me know if I can help at all
r
@microscopic-shampoo-2255 sorry i just saw that now - looking into it. Do you have any error in your logs in the admin panel?
@microscopic-shampoo-2255 ok I got the problem replicated on my side. The issue is that the bot is waiting for everything to be processed before replying to the user. In that case, there are several API calls being made before the turn is completed, thus replying takes a while. All messages are "batched" and they await the turn to be completed before being sent so that the agents can do batch post-processing on them. It's not a bug but it's certainly not the desired outcome when you have have long processing operations like in your case. Also, published chatbots have an execution limit of 60s, so all the API calls are actually taking longer than that. I'll look into a solution tomorrow morning, but in the meantime a workaround would be to put a button "continue" to chunk the processing into smaller intermediate steps
@microscopic-shampoo-2255 OK I got a solution for you that will do the trick for your demo and while we find a better long-term solution: 1. Put this inside your execute code statements:
await bp.dm.flushSendMessages(event)
This will force sending the pending messages to the user. 2. I have temporarily raised your chatbot execution limit from 60s to 240s to acomodate your long-running API calls.
m
@rich-battery-69172 YEYYYY one sec reading
I don't my pannel shows it actually sending the messages to the webchat but doesnt show up
Ok so even if I am getting them on the console side (like the test chat inside the build?). Also what do you mean a button "continue"
r
Yeah it will show them in the logs but won't send until the very end of the processing
But with the line of code I sent you, it will "flush" send the pending messages
m
OOOO okay that makes sense, I was wondering why it was "spinning" I assume thats what you mean but a button?
(btw sorry I am a noob but I super appreciate you explaining this to me)
so quick example: add it here:

https://cdn.discordapp.com/attachments/1139465635492012082/1140495029505364119/image.png

r
By a continue button I actually meany asking the user to push a button (like a fake question) just to sort of keep the conversation bouncing but you won't need it after all
yes but make it before the API call (at the top of the file)
m

https://cdn.discordapp.com/attachments/1139465635492012082/1140495251002363944/image.png

r
put it everywhere you have API calls since they take a very long time
yes
m
❤️
thank you SOO much
r
my pleasure!
m
Oooo so I leave (event) actually as event
I know I have been a dumbass in the past andnot filled in "fillable" spots I was supposed to
r
yes you leave event !
m
THANK YOU
r
@microscopic-shampoo-2255 sorry i just deployed your limit update - can you try now with this + the line of code added and confirm it works?
m
Yes! I got farther than I did previously without it BUT I also just noticed I had gpt 4 on one of my flows that I def didnt need, so dropped that down to turbo. That should help I think, just relaunching my webserver that is hosting my langchain tools
r
ok yes you should def. avoid long calls like GPT-4. Even if it works, the user experience will suffer
yeah I see your tests but you did hit the 60s timeout we have ~ raised it to 300s for you
that seems to have worked right?
m
IT WORKSSSSS
r
🎉
m
thank you soooo much
I am sure your a busy as hell, but quick question. I know you can add giphy api, but like if I JUST want it to send a specific gif, can I add the link as a a message? Or even save the gif and add it?
r
yes send put the GIF in a send image card
m
dope thanks
r
btw if you want a better style for your demo, this new design ships tomorrow but you can apply it now: https://codepen.io/slvnperron_bp/pen/YzRmNeM
also if i may suggest, you can add this node to your flow to make the bot start the convo first:

https://cdn.discordapp.com/attachments/1139465635492012082/1140506493184135218/image.png

m
WOOO, okay I had the trigger on there, but I had taken it off when Iwas running into issues
Ok, I opened this up but kind of lost. Would this be similar to doing a configurable css like on the integration?
r
yes basically just use this css as a base if you embed it in a bubble: https://cdn.botpress.cloud/webchat/v1/themes/theme-light.css
m
OOOOO I see what happened you actually did stuff wow thanks
omg that came out wrong lol, in the link you already did stuff lol it wasnt a template
r
m
ok sorry, whats teh difference between the two you sent me.. the v1themes gives me

https://cdn.discordapp.com/attachments/1139465635492012082/1140508704366665788/image.png

r
yeah that's the URL you would copy paste into your chatbot settings stylesheet field
m

https://cdn.discordapp.com/attachments/1139465635492012082/1140508875930488862/image.png

in this part, well like open the url paste, click run and grab it?
OOOO
ok ok
r
you can also paste the code in the styler yes to customize it
m
OO nice! Okay, one more question if you have time. I want it to take up the whole screen on the website. I know I looked at a few things already, I saw something about posting into div. But I also saw on chatgpt code interpreter about setting the width as 100vh or something.
r
m
and do you have a dark theme pre done? Again, I am now asking you to help with me stuff I havent even tried to solved so def dont expect anything if I am taking up tomuch time
r
like this right
m
but full width
r

https://cdn.discordapp.com/attachments/1139465635492012082/1140509785150734426/image.png

m
like if I was going to do a page that was a full page width, like on chatgpt
Perfect
r
o wait
not yet sorry
m
No worries thank you so much again
r
np!
m
Ok and I put this as the code on my website page?
ooo yeah this is cool I get it
@wide-architect-96022 I figured I would just tag you in this instead of trying to explain it all
@rich-battery-69172 I think you are prob gone, but it seems to do this, and get caught at the bottom and under everything.

https://cdn.discordapp.com/attachments/1139465635492012082/1140517513726275706/image.png

@famous-jewelry-85388 Here
2 Views