-
Notifications
You must be signed in to change notification settings - Fork 76
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
Iru89
wants to merge
10
commits into
master-lts
Choose a base branch
from
BLT-738-first-interaction-x-intents-keywords
base: master-lts
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
vanbasten17
approved these changes
Jun 18, 2024
packages/botonic-plugin-flow-builder/src/action/first-interaction.ts
Outdated
Show resolved
Hide resolved
packages/botonic-plugin-flow-builder/src/action/first-interaction.ts
Outdated
Show resolved
Hide resolved
Iru89
force-pushed
the
BLT-738-first-interaction-x-intents-keywords
branch
2 times, most recently
from
June 19, 2024 15:26
857c154
to
1df992d
Compare
AinaVendrell
approved these changes
Jun 21, 2024
…s in the first interaction
…le and reuse logic inside first-interaction
…y keyword or intents in first interaction
…of keyword or intent
…dge base response as follow up
Iru89
force-pushed
the
BLT-738-first-interaction-x-intents-keywords
branch
from
June 28, 2024 08:29
1df992d
to
a4785ce
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: