Skip to main content

Introduction - Building a ChatBot

Chatbot Concept

  • Artificial intelligence that interacts using natural language
  • Able to understand user requests
  • Can integrate with external APIs and databases

Setup in Data2

Creating the Store

  1. Create a new Store in the workspace
  2. Chosen name: "Store Chatbot"
  3. Configured fields:
    • User prompt
    • Message list

Configuring the User Input

  • Used a DataFieldBlock
  • Configured to save to the Story's "prompt" field
  • Placeholder set to "Type..."

Button Interaction

  • Used the OnClick function
  • Configured a series of interactions:
    1. Setter to insert messages
    2. ArrayPush to add messages
    3. Creating an object with information:
      • Index
      • Message
      • Sender

Testing and Validation

  • Used LogService to check message insertion
  • Demonstrated inserting the message "Hello world"