Activechat Manual
  • What is Activechat?
  • New? Start here
    • The basics
    • Set up your first project
    • Install the chat widget
    • Upload the knowledge
    • Explore the CRM
    • AI-assisted live chat
      • How to set context for AI hints
    • Live chat mobile app
    • Build your first automation
  • Conversational AI
    • For Customer Service Teams
    • For Product Managers
    • For Innovation Teams
    • For Marketers
    • For e-commerce
    • For developers
  • Help Guides
    • Setting up your team
    • Managing conversations
      • Customer attributes
      • User tags and segments
      • Searching for specific users
      • Agent tags (live chat groups and queues)
      • Triggering live chat sessions from the bot
      • Notifications with the TRIGGER block
    • Managing knowledge
      • Uploading business data
      • Question answering and live chat hints
      • Fine-tuning the large language model
    • Natural language automation
    • Building automations visually
      • Customizing your welcome message
      • Adding new skills
      • Navigating skills
      • Copying skills and blocks
      • Handling errors
    • Improving your virtual agent
    • Using live chat AI hints
    • Customizing automatic website page messages
    • Tracking website actions
    • Facebook Ads automation
      • How to set up a Facebook ads bot
      • How to use buttons and quick replies in a Facebook ads chatbot
    • Lead generation
    • Zapier integrations
    • Customizing your project
      • How to customize the chat widget
      • How to customize the Facebook chat widget
      • How to change bot settings
    • Pricing guide
  • Fundamentals
    • Terminology
      • Intents and entities
      • Contexts
      • Skills and events
        • Built-in system skills
          • /start
          • /default
          • /_default_fallback
          • /_start_live_chat
          • /_page_visit
          • /_error
      • Conversation elements
        • Messages
        • Buttons
        • Quick replies
        • Galleries / carousels
    • Messaging channels
      • Website chat widget
        • Installation
        • Customization
        • Voice input
      • Chat widget landing page
      • Facebook Messenger
        • Connect your page
        • 24 hour rule
        • Message tags
        • Persistent menu
      • Telegram
      • Email
      • Twilio SMS automation
    • Intents and bot skills
    • Conversation insights
    • Grow tools
      • Landing pages
      • Messenger links and QR codes
    • Broadcasting
  • Visual builder reference
    • Sending messages
      • TEXT
      • LISTEN
      • IMAGE
      • MEDIA
      • GALLERY
      • FILE
      • EMAIL
      • SMS
      • LEAD
    • Triggering events
      • SEND
      • CATCH
      • TRIGGER
      • LIVE CHAT
    • Manipulating data
      • DATA
      • ADD TAG
      • REMOVE TAG
      • JSON
      • STATUS
      • VALIDATION
    • Conditional logic
      • SWITCH
    • Timers and delays
      • TIMER
      • WAITFOR
      • WAITUNTIL
    • E-commerce blocks
      • CATEGORY
      • PRODUCT
      • VARIATIONS
      • SIMILAR
      • UPSELLS
      • CROSSSELS
      • Shopping carts
        • ADD TO CART
        • UPDATE CART
        • SHOW CART
        • CLEAR CART
        • CREATE ORDER
    • Natural Language
      • NLP
    • System attributes
    • System events
  • Integrations
    • Google services
      • Connect your Google account
      • Google Sheets
        • Searching and updating Google Sheets data
        • Building galleries with Google Sheets data
      • Google Calendar
        • Searching for events
        • Creating and updating events
    • Shopify
    • WooCommerce
    • Dialogflow
      • Building an agent
      • Using entities
      • Slot filling
      • Context management
      • E-commerce NLP
Powered by GitBook
On this page

Was this helpful?

  1. Integrations
  2. Dialogflow

Context management

PreviousSlot fillingNextE-commerce NLP

Last updated 3 years ago

Was this helpful?

When you define in , you can set one or more input or output . These contexts are used to limit the scope of specific intents so that they will be triggered only when certain conditions are met.

We’ve already discussed a simple example of a restaurant chatbot, with two different skills triggered by the same utterance – “How much will it be?”. One skill, to calculate the delivery cost, should be triggered only in the context of arranging the delivery order, and another, calculating the reservation cost, should be triggered only when the user is asking about the reservation.

Let’s build this in Dialogflow and Activechat!

We’ll be creating two different intents with the same set of training phrases. The only difference will be the contexts: we’ll set “reservation” as input context for the first one, and “delivery” as input context for another.

“how_much_reservation” intent:

Setting up input contexts in the Dialogflow intent

“how_much_delivery” intent:

If you test one of your training phrases in the Dialogflow console, you may be surprised. Even when you type the phrase exactly as it’s entered in the intent definition, Dialogflow does not recognize it and throws “Default Fallback” intent instead. How can it be?

The reason is that we have input contexts set in both of these intents. To make your chatbot able to recognize the “How much will it be?” utterance outside of any of these two contexts, you will need another intent – with the same training phrases but no contexts set.

When you specify input context for the intent, this intent will be triggered only when this context is present!

Here is how this can be done when choosing the skill from the chatbot menu:

Now, when you type “What’s the cost?” in the chatbot, one of your intents will be triggered – depending on what is the current conversation context.

Second intent with the same training phrases and different context
Intents are not triggered outside of their contexts

Let’s store the current conversation context in the $context attribute. When you are in the “reservation” skill, it should be set to “reservation” (use the block to set the value), and when your chatbot user switches to the “delivery” skill, set it to “delivery”.

Setting the context before triggering the skill

If your “reservation” and “delivery” skills are also triggered by the NLP intent, you can set the context immediately after the opening block in each of these skills.

Don’t forget to pass the context to Dialogflow, adding it to the block settings:

Passing the conversation context from Activechat to Dialogflow

Output contexts from Dialogflow intents are available in the $_nlp_contexts .

For more info on Dialogflow contexts, check the .

DATA
CATCH
NLP
system attribute
official contexts overview from Google
intent
Dialogflow
contexts