Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin-flow-builder: resolve keywords, smart intents and intents in first interaction #2853

Open
wants to merge 10 commits into
base: master-lts
Choose a base branch
from

Conversation

Iru89
Copy link
Contributor

@Iru89 Iru89 commented Jun 13, 2024

Description

If the user sends a text that matches a keyword, smart intent or intent in the first interaction, the bot's response is the contents of the start conversation followed by the contents of the match.

If the bot has an active knowledge base after trying to match the above and not getting a match, it will attempt to respond using the knowledge base. If it has sufficient knowledge and the response is faithful the bot will display the start contents followed by the response generated using the knowledge base.

Context

We want the bot in platforms that are not proactive (such as Whatsapp) where the user is the first to write, if the user asks something in the first inbox, the bot will solve it the first time. But the initial contents have to be shown because they usually contain the GDPR and the AI disclaimer.

Approach taken / Explain the design

I have created a function that replicates the logic used in the plugin's pre function to resolve the user input.
In the pre function if it is the first interaction the user input is not resolved because we always want to show the first contents of the flow.
Refactor the ways to get the content in the action by splitting into different files how the content is obtained depending on whether it is the first interaction, has a payload in the input, uses a knowledge base or is the fallback. In the first interaction file, the other methods for resolving the follow ups are used.

Testing

Add test to check first interaction with:

  • an input that no match any keyword, smart-intent, intent or knowledge base.
  • an input that match with a keyword
  • an input that match with a keyword that point to start contents
  • an input that match with a keyword that point to a content
  • an input that match with a smart-intent that point to a content
  • an input that match with an intent that point to a content
  • an input that generate a knowledge response content

@Iru89 Iru89 changed the title feat(plugin-flow-builder): resolve keywords, smart intents and intent… plugin-flow-builder: resolve keywords, smart intents and intents in first interaction Jun 13, 2024
@Iru89 Iru89 marked this pull request as draft June 13, 2024 15:20
@Iru89 Iru89 marked this pull request as ready for review June 14, 2024 14:57
@Iru89 Iru89 force-pushed the BLT-738-first-interaction-x-intents-keywords branch 2 times, most recently from 857c154 to 1df992d Compare June 19, 2024 15:26
@Iru89 Iru89 force-pushed the BLT-738-first-interaction-x-intents-keywords branch from 1df992d to a4785ce Compare June 28, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants