UChat Official

Introduction

In this detailed overview, we explore the process of creating and managing responses within a chatbot framework, specifically focusing on Dialogflow and UChat integration.

After establishing intents and entities, the next crucial step is to configure how your chatbot replies when an intent is triggered.

This guide covers two primary response typestext responses and custom payloads—and demonstrates how to implement each effectively. Additionally, we delve into testing the setup, customizing responses with images and GIFs, and integrating these responses seamlessly into your chatbot flow. By the end, you'll understand how to craft engaging, dynamic replies that enhance user experience.

Overview of Response Configuration

Response Type

Description

Features

Use Cases

Text Response

Simple reply message

Can include dynamic entity values

Confirmation messages, prompts

Custom Payload

JSON-based, customizable responses

Add images, GIFs, complex layouts

Rich media responses, flow control

Step-by-Step Process for Sending Replies to an Intent

1. Accessing Response Settings

  • Navigate to your chatbot platform (e.g., UChat).

  • Locate the Intents section and select the relevant intent.

  • Scroll down to find the Responses tab.

  • Here, you can add multiple response types.

2. Understanding Response Types

Text Response

  • Definition: A straightforward reply message.

  • Implementation:

    • Enter your message directly.

    • Use entity values to personalize responses.

  • Example:

To confirm, you are looking for a {car_brand} with the model {car_model} from {car_year}
  • Dynamic Values: Insert entity values using the dollar sign $:

You searched for a $car_brand, model $car_model, from year $car_year

Custom Payload

  • Definition: JSON-formatted response allowing rich media and complex layouts.

  • Implementation:

    • Select Custom Payload.

    • Insert JSON code that defines the response structure.

  • Example JSON:

{
  "content": {
    "block": "car_search_response"
  }
}
  • Purpose: Trigger specific blocks within UChat flows, enabling multimedia content like images, GIFs, and interactive cards.

Practical Application: Testing and Validation

1. Setting Up the Training Agent

  • Assign your Dialogflow agent (e.g., Dialect Flow) to your chatbot.

  • In UChat:

    • Go to your chatbot's Automations tab.

    • Select Subflow.

    • Choose your trained Dialect Flow agent.

2. Testing the Intent Recognition

  • Use Messenger or your preferred platform.

  • Input sample queries, e.g.:

I'm searching for a car.
BMW.
X7.
2008.
  • Observe if the chatbot correctly recognizes the intent and captures entities.

  • Confirm that the response matches expectations.

3. Verifying Responses

  • Check if the chatbot replies with the text message or custom payload.

  • Ensure dynamic entity values are correctly inserted.

  • Confirm multimedia content (images, GIFs) display properly.

Enhancing Responses with Rich Media

1. Adding Images and GIFs

  • In custom payload JSON, include media elements:

{
  "content": {
    "block": "car_search_response"
  },
  "media": [
    {
      "type": "image",
      "url": "https://example.com/image.jpg"
    },
    {
      "type": "gif",
      "url": "https://example.com/animation.gif"
    }
  ]
}

2. Using Cards and Interactive Elements

  • Create visually appealing responses with cards:

{
  "content": {
    "type": "cards",
    "cards": [
      {
        "title": "Car Details",
        "subtitle": "BMW X7 2008",
        "imageUrl": "https://example.com/bmw_x7.jpg",
        "buttons": [
          {
            "text": "View More",
            "action": "open_url",
            "url": "https://carwebsite.com/bmw_x7"
          }
        ]
      }
    ]
  }
}

3. Customizing Response Content

  • Tailor responses to match branding and tone.

  • Use images and GIFs to make interactions lively.

  • Incorporate buttons for quick actions.

Advanced Customization: Dynamic Responses and Flow Control

1. Triggering Specific Blocks

  • Use JSON payloads to invoke particular flow blocks:

{
  "content": {
    "block": "car_search_confirmation"
  }
}
  • This allows for multi-step interactions and conditional responses.

2. Incorporating Variables and Logic

  • Pass entity values into responses.

  • Use conditional logic within UChat flows to adapt replies based on user input.

Summary Table: Response Types and Their Capabilities

Response Type

Features

Best For

Example Use Cases

Text

Simple, quick replies

Confirmation, prompts

"Your car search is confirmed."

Custom Payload

Rich media, complex layouts

Product showcases, multimedia responses

Car images, GIF animations, interactive cards

Flow Trigger

Invoke specific flow blocks

Multi-step processes

Follow-up questions, detailed info

Final Thoughts

Implementing effective responses is vital for creating engaging and intuitive chatbots.

By leveraging text responses for straightforward communication and custom payloads for rich, multimedia interactions, you can significantly enhance user experience.

Testing these responses thoroughly ensures they work seamlessly across platforms like Messenger. Remember, the key is to personalize interactions with dynamic entity values and visual elements that capture user attention.