Context
Need to reuse the same intent twice or more within the same bot? Set context to your flows and make sure the bot provides the right answer.
Last updated
Was this helpful?
Need to reuse the same intent twice or more within the same bot? Set context to your flows and make sure the bot provides the right answer.
Last updated
Was this helpful?
Context makes it possible to reuse the same intent in several blocks, an important feature in bot building!
To use context in an intent:
Open the block containing the question.
Go to the NLP section.
Under Give output context and livespan, Ccreate an output context. For this example, we will call it book_ticket with a lifespan of 1.
Click Save.
Navigate to the NLP tab.
Under Required context, look for the context that you just created. In this example it will be book_ticket.
Click Save.
Follow the same process for other places in the conversation where those intents are used. That way, you can be sure that the bot provides the right answer!
A user can have multiple contexts when navigating between different conversation flows. When multiple intents and input context combinations are found, the user's context with the highest lifespan value is taken.
Make sure that you and linked them to . In this example, we'll use general_yes and general_no intents.
Open your . For instance, open the general_yes intent block.
From your bot , visualizing context at first sight can be not so straightforward.
To improve visualization, you can set the Ask a question block as a to the intent block. This creates a clear visual connection that improves readability.