frail-apricot
frail-apricot16mo ago

The chatbot doesn't understand the intent

I have made this chatbot appointment booking chatbot, and everything is all set, and the testing is all good, but after WhatsApp integration with FlowBridge, the chatbot does not understand the user text at the beginning, the intent is saying "hi"
No description
No description
13 Replies
frail-apricot
frail-apricotOP16mo ago
So I made a command in the "start" with an "intend" including saying hi But after publishing it & trying to test it again, the WhatsApp chatbot still has the same problem of not understanding the text when I say "hi" But in the Transcript, it understands the "hi" intent, but it just fails to response to the right answer.
Tico | Voiceflow Assistant
It sounds like your chatbot is not recognizing the initial user text. Here are a few steps to troubleshoot and resolve this issue: 1. Check the Regex for Initial Utterance Ensure that the regex pattern for capturing the initial user text is correctly set. In your case, you might want to use a regex pattern that captures any text input. For example:
const ANYWORDREGEX = new RegExp(/.+/i);
bot.hears(ANYWORDREGEX, async (ctx) => {
let chatID = ctx.message.chat.id;
await interact(ctx, chatID, { type: 'text', payload: ctx.message.text });
});
const ANYWORDREGEX = new RegExp(/.+/i);
bot.hears(ANYWORDREGEX, async (ctx) => {
let chatID = ctx.message.chat.id;
await interact(ctx, chatID, { type: 'text', payload: ctx.message.text });
});
2. Verify API Integration Ensure that your API integration with Voiceflow is correctly set up. The interaction function should correctly send and receive data from Voiceflow:
async function interact(ctx, chatID, request) {
const response = await axios({
method: 'POST',
url: `https://general-runtime.voiceflow.com/state/user/${chatID}/interact`,
headers: { Authorization: process.env.VOICEFLOW_API_KEY },
data: request,
});

for (const trace of response.data) {
switch (trace.type) {
case 'text':
case 'speak':
await ctx.reply(trace.payload.message);
break;
case 'visual':
await ctx.replyWithPhoto(trace.payload.image);
break;
case 'end':
await ctx.reply('Conversation is over');
break;
}
}
}
async function interact(ctx, chatID, request) {
const response = await axios({
method: 'POST',
url: `https://general-runtime.voiceflow.com/state/user/${chatID}/interact`,
headers: { Authorization: process.env.VOICEFLOW_API_KEY },
data: request,
});

for (const trace of response.data) {
switch (trace.type) {
case 'text':
case 'speak':
await ctx.reply(trace.payload.message);
break;
case 'visual':
await ctx.replyWithPhoto(trace.payload.image);
break;
case 'end':
await ctx.reply('Conversation is over');
break;
}
}
}
3. Ensure Correct Intent Mapping Make sure that the intent for the initial greeting (e.g., "hi") is correctly mapped in your Voiceflow project. You can define multiple utterances for the same intent to improve recognition:
{
"intents": [
{
"name": "greeting",
"utterances": [
"hi",
"hello",
"hey",
"good morning",
"good evening"
]
}
]
}
{
"intents": [
{
"name": "greeting",
"utterances": [
"hi",
"hello",
"hey",
"good morning",
"good evening"
]
}
]
}
4. Test the Integration After making these changes, test the integration again to ensure that the chatbot correctly understands the initial user text.
frail-apricot
frail-apricotOP16mo ago
No description
frail-apricot
frail-apricotOP16mo ago
Honestly, I don't know is this my Voiceflow problem or FlowBridge thing is it because I put the intent in the start?
frail-apricot
frail-apricotOP16mo ago
No description
tame-yellow
tame-yellow16mo ago
Try to to the customer view -> select your project -> transcripts -> your transcript -> click reset user state Does that make any difference?
frail-apricot
frail-apricotOP16mo ago
WELL
frail-apricot
frail-apricotOP16mo ago
No description
frail-apricot
frail-apricotOP16mo ago
when I go to transcripts, it just shows 500 | SERVER ERROR
tame-yellow
tame-yellow16mo ago
Did you select a project on the top? like before going to the transcripts page
tame-yellow
tame-yellow16mo ago
there i mean
No description
frail-apricot
frail-apricotOP16mo ago
ayt thx man, fixed~ btw is there a way to talk to the users through the transcript page
tame-yellow
tame-yellow16mo ago
Its currently in development actually! It's a big rework of that entire system! You can checkout what we got going on, and provide feedback on our roadmap https://flowbridge.productlane.com/roadmap

Did you find this page helpful?