ChatBot Changing Languages As It Pleases
# 🤝help
r
Hi! I've been working on a chatbot for sometime now and I wanted to be multilingual so I used "button selection method" taught in the FAQ video about how to set your bot's language. Unfortunately it does switch the languages as it pleases in the middle of conversation. I don t really know what to do (I have like 1 day experience using Botpress and almost everything AI related is new to me), I followed the tutorial from the video, did the same thing as the teacher did, expect I did not include the AI Section part in my workflow. What can I do to fix this issue?

https://cdn.discordapp.com/attachments/1138474097563672626/1138474654164594708/Captura_de_ecran_din_2023-08-08_la_17.10.10.png

c
@acceptable-kangaroo-64719 I feel like we could use your help here! 👋
Can you please share a screenshot of your flow? @User
s
I have the exact same issue
a
Do you have "automatically detect language" enabled on your translation agent?
r
Hello
Sorry for being late withmy response
Yes, it is enabled. I must turn it off, right?
here it is @crooked-van-25152

https://cdn.discordapp.com/attachments/1138474097563672626/1138770773524353084/Captura_de_ecran_din_2023-08-09_la_12.48.13.png

I did turn off the option, still did the same thing in the middle of conversation.
a
what language is your bot's knowledge base content in?
r
romanian
and some of the text in english as well
but like 1 or 2 pages from 20 total
a
Does the bot only switch languages when it doesn't know the answer to the user's question?
r
No, I had times when it switched in the middle of conversation
a
interesting. How are you saving the user's language preference?
r
Wdym?
I dont know how to do that
In fact, every time the user is going back to the main mennu
a
what code is happening in "Standard1" ?

https://cdn.discordapp.com/attachments/1138474097563672626/1138779460812943381/image.png

r
they have to chose again the langugage
something simple like in the FAQ video bout languages

https://cdn.discordapp.com/attachments/1138474097563672626/1138779608523751454/Captura_de_ecran_din_2023-08-09_la_13.23.26.png

How can i save user preferances?
a
yep that code looks about right. You are saving user preference in that code
When the engineering team wakes up in ~4 hours, I'll get in touch with them and see if they have any ideas. Do you mind holding on until then?
r
Nope
I ll be out doing other things
a
ok. Otherwise, you can try using manual answering and pass the knowledge answer through an AI task where you prompt the AI to translate it into that language
I think we have a tutorial on #1132038253109837994 about that
r
Mhm
I ll wait for your response
r
and then we can decide what is the best thing to do
what if is because of the ai that you helped me with
in its task instructions isnt specified that he must answer based on user language prefeerance
that he/she selcted during the first phase of the bot
could that be the problem?
a
you could give it a try, sure
r
i think it s working
is there any way i could train the bot to have the chat history in mind?
no, it s not working
when the bot didnt know how to answer aquestion, it switched fromr romanian to english
a
There's no concept of bot training in cloud. Everything is done in the prompts
in your knowledge agent, what language is this bit here?

https://cdn.discordapp.com/attachments/1138474097563672626/1138784090871566406/image.png

r
it s empty
a
ok. I'm not sure what else to try, then. We'll have to wait for the engineers to wake up in ~4 hours
r
okay
what prompt i could you so instruct the bot that he must know about chat histroy
a
you can include {{conversation.SummaryAgent.transcript}} as one of the AI Task inputs
r
just copy it and paste in the ai task instruction?
a
You should also tell the AI in the prompt that you're passing in the chat history, yeah
r
now another thing happened
it gives me 2 responses o every question
a
interesting. Is manual answering enabled on your knowledge agent?
r
no
should it be?
a
if you're using the AI task to modify the answer, yes

https://cdn.discordapp.com/attachments/1138474097563672626/1138789232597532783/image.png

r
i enebled it
another thing
hahaha
it switches the languages everytime there is a simple text and it translates it from romanian, to english autoatcally
but not for every card
a
huh
is it supposed to translate from Romanian to English?
r
no
i mean, i wrote the text card
in romanian
and now when i go specific routes in the chat
it automatically translates the text from romanian to english
but not every text that i wrote in romanian
just to till now
two*
a
well the translator agent works based on the user's selected language, not the builder's language. So the bot is working typically if the user language is english.
r
but it shouldn t happen if the user selected romanian for exmple
when the flow starts
the user selects its preferance
and how it detects mine as english when i have everything in romanian
the chrome browser
my system language
everything is in romanian
a
that's interesting. Can you hit this button and share the number?

https://cdn.discordapp.com/attachments/1138474097563672626/1138791806415413248/image.png

r
48a744b5-7f6d-4965-86ba-dc576c698e3b
here it is
a
thanks, I'll share this with the team
r
thank you very much!
i ll be away for some sport activities
please let me know here what you found out
And i ll review it when i come back at my desk
e
I have the same issue, but in a different language. It sometime switches over to English in my knowledge base nodes.
r
glad to hear im not alon
e
s
@acceptable-kangaroo-64719 I have a similar problem. It randomly switch from Polish to English. I don't know why it switches. I have provided Context to KBs in Polish. On this particular node i even put two "Set User Language" to "PL". And it still answers in english. Also no matter of configuration of Translator Agent, the results are pretty similiar. The only way is to disable Translator Agent completely.

https://cdn.discordapp.com/attachments/1138474097563672626/1139129838939144253/Zrzut_ekranu_2023-08-10_o_11.26.27.png

https://cdn.discordapp.com/attachments/1138474097563672626/1139129839274692669/Zrzut_ekranu_2023-08-10_o_11.26.47.png

https://cdn.discordapp.com/attachments/1138474097563672626/1139129839618621501/Zrzut_ekranu_2023-08-10_o_11.26.33.png

actually, even when I disable Translator Agent it sometimes switch to English 😅
r
@acceptable-kangaroo-64719 got any answers?
a
Not yet, sorry
Hey guys, we're hoping to push an update for the language engine soon (like in the next few days). I'll update y'all again once it is live!
c
I'm having a similar issue, without any complex logic, I'm just setting up the language at the beggining and it changes back to english for some answers.... the image is my bot. Looking forward for the update!

https://cdn.discordapp.com/attachments/1138474097563672626/1139316202037071882/Screen_Shot_2023-08-10_at_4.png

f
Confirming an update is coming to make it more robust. Gpt3.5 issue, we are working through. I will try to update this thread
r
Awesome
Thanks everybody!
r
a fix for this has just been deployed!
c
Will test now...
Didn't worked 😦

https://cdn.discordapp.com/attachments/1138474097563672626/1140824332952682567/Screen_Shot_2023-08-14_at_8.48.11_PM.png

r
@cuddly-spring-6354 is the translatoragent enabled and did you re-publish? (also, need to refresh your studio screen)
c
I got this error on the log report

https://cdn.discordapp.com/attachments/1138474097563672626/1140824568831938580/Screen_Shot_2023-08-14_at_8.49.20_PM.png

I didn't re-publish, will do it now
Something curious is that on the logs, I got the right answer in spanish as it should be, but on the bot it showed up in English

https://cdn.discordapp.com/attachments/1138474097563672626/1140824791268462592/Screen_Shot_2023-08-14_at_8.49.59_PM.png

r
Yes that was the issue before - chatGPT struggles with translation tasks when the content is already in the right language (lol)
c
My translator agent is on

https://cdn.discordapp.com/attachments/1138474097563672626/1140825220446425198/Screen_Shot_2023-08-14_at_8.51.55_PM.png

Probably I should turn off the "automatically detect user language" and "detect language every turn" ?
Will try that...
r
nah that's ok
just need to republish 🙂
c
Alright, testing now
No, the same 😦

https://cdn.discordapp.com/attachments/1138474097563672626/1140825749830500402/Screen_Shot_2023-08-14_at_8.54.05_PM.png

r
Would you mind creating a problem report and sending me the report ID? from the top left corner, click om the BP logo
c
Of course, doing it now
On which screen do I find this?
r

https://cdn.discordapp.com/attachments/1138474097563672626/1140826603014852618/image.png

c

https://cdn.discordapp.com/attachments/1138474097563672626/1140826606013792318/Screen_Shot_2023-08-14_at_8.57.30_PM.png

https://cdn.discordapp.com/attachments/1138474097563672626/1140826638804856934/Screen_Shot_2023-08-14_at_8.57.41_PM.png

Oh alright alright
r
oh sorry I just saw in your logs the issue
super easy fix let me do that right now
you don't need to send me the reportId
c
Oooh alright, I'm available right now
So... happy to test and help!
The issue is in " detected as es-ES, needs translation to "es" "... right?
Like, it translates the message twice
r
Yes that's right
the fix is deploying now, should be ready to test in 5m
c
Okay that was fast. Awesome, I'll test in 6m then
r
@cuddly-spring-6354 ok it's live, can you refresh the studio + republish?
c
Alright
Woohooo!! It's working fine now, may need a lot more testing to be sure but the previous answers that it messed up are good now
Sylvain just hire me as a tester, I'm a junior full-stack developer and passionate for cutting-edge technologies, I would even work for free for you just to learn 😄 I know more of front-end than of backend and have worked on a lot of different projects this past 3+ years. Would love to make part of your team 😄
r
awesome!!
c
Thank you very much for the fix
h
Hi, I have the same problem, could you please advise me how I can fix it?
f
hi @high-father-81818 i would recommend opening a new thread with a problem-report id. The fix worked for jesusnoro, so the issue is not related.
a
same problem here, already report: 6ee74fde-a4ba-4b9e-8ab0-47795b8d19b9
I already found a alternative: 1. store the result in the language single choice like @workflow.language.select 2. Choose the "Set language user" and copy the @workflow.language.select It worked for me 😉
51 Views