m-chat
Status
  • 👋Welcome!
  • 🏁 Getting Started
    • Building a chatbot
    • Testing a chatbot
    • Publishing your bot
      • Web
        • Embed chatbots on website
      • WhatsApp
        • Meta
        • 360Dialog
        • GupShup
        • Twillo
        • TechAlpha
      • Instagram
      • Facebook Messenger
      • SMS
      • Mobile App
    • Utility Tools
    • Contacts
      • Scheduling a Contact Report
      • Exporting a Contact List
    • Chatbot Appearance
      • Custom CSS
      • Image dimensions
      • Pop-up messages
  • BOT BUILDER
    • Action blocks
      • Trigger
      • Send message
      • Collect input
      • Buttons
      • Reply buttons
      • Carousel
      • Answer AI
      • Set AI
      • List
      • Send an email
      • Condition
      • Dynamic data
      • Talk to human
      • Javascript
      • Webhook
      • Jump
      • Flow
      • Options
      • Collect file
      • Form
      • Calendar
      • Delay
      • Codeblock
      • Slider
      • Image gallery
      • Send WhatsApp
      • Send SMS
      • Send Email
      • Send Status
      • WhatsApp flow
      • Catalogue
    • Outbound bots
      • Building Ongoing Campaign
      • Building One Off Campaign
    • Variables
    • Cloning bots
    • Connecting action blocks
    • Creating a loop
  • ✨ AI STUDIO
    • Building a GPT chatbot
    • Knowledge base
    • Custom Answers
    • Functional call
    • Prompts
    • Tokens
    • Refresh frequency
  • 💬 LIVE CHAT
    • Overview
    • Building a bot with live chat
    • Creating views
    • Adding Labels
    • Saved replies
    • Settings
  • 🔗 Integrations
    • HTTP request
    • Events
  • 💬 WhatsApp Business API
    • Getting a WhatsApp API
      • Getting WhatsApp API (Old approach)
      • Sandbox WhatsApp API
    • Facebook Business Manager (FBM) Verification
    • Creating a WhatsApp Template
    • Cost
    • Messaging Limits, Quality Rating
    • Official Business Account (Green tick verification)
  • 📊 Reporting
    • Chatbot Analytics
    • Agent Analytics
    • Outbound analytics
    • Link analytics
    • Weekly email report
  • 🛠️ Troubleshooting
    • Getting notification for leads
    • JS functions to trigger chat widget
    • Setting up link tracking
    • How do I hard refresh my browser?
    • Notifications
    • Tracking Facebook Pixel
    • Inviting teammates
    • Teams
  • 🧑‍💻 Support
    • Creating a ticket
    • Book a demo
    • Purchase a subscription
    • Cancelling a subscription
    • Refund policy
    • Reset Password
    • Deleting account
Powered by GitBook
On this page
  • Step 1: Define the prompt/instruction
  • Instructions/Prompt
  • Step 2: Store the response in a variable
  1. BOT BUILDER
  2. Action blocks

Set AI

Uses an LLM-based AI model to generate an response based on the prompt given.

PreviousAnswer AINextList

Last updated 6 months ago

The Set AI action block is used to generate a response to the prompt supplied to it.

When using the Set AI block, the user submits a prompt, which is then either processed by the AI Studio or the LLM model to generate a response. This response is then stored into a variable

m-chat uses OpenAI GPT APIs to generate an response.

Process in which the Set AI works,

  1. A prompt is supplied

  2. AI generates the response

  3. Response is stored in a variable

Step 1: Define the prompt/instruction

LLM models require guidance to be able to generate a relevant and accurate answer. There are some tools you can use to guide your AI; they are:

Instructions/Prompt

A prompt is nothing but an instruction that helps the LLM know what to remember and follow while generating an answer.

The more clear, concise and brief your instruction, the more accurate your answers will be from the AI.

Things to write in your prompt:

  • Objective - What is its objective

  • Output format - Typically would be HTML/markdown.

  • Writing style - How should the answers be written.

  • Don'ts - Clear instructions of what to avoid.

  • Examples - Examples of question and answer.

An example prompt could be:

Given the ‘user’s question’: “[QUESTION]”

And the detailed information provided in ‘chunks’: “[CHUNKS]”

Determine, whether a clarifying question is required.

Instructions:

1. Analyse the 'chunks' and the 'user's question' to identify the specificity of the query and the scope of the information in 'chunks'.

2. If the query is broad and the 'chunks' have multiple categories or types, output '#' and guide the chatbot to ask for clarification.

3. If the query aligns well with a specific part of the 'chunks' that provides a comprehensive answer, output '~'.

Output format: [Decision: '~' or '#', (if '#') then clarification is required. If '#' also, 'specify the type of information or category that would help better address their question. This should be based on 'chunks'.

Important: if the user's question is likely to have a device specific answer, then you should ask for more information.

If the user has given a device, then we don't need to clarify.

Step 2: Store the response in a variable

The AI would process the instruction/prompt and generate a response. To get an ideal response, make sure you include in the instructions what kind of response you want to receive.

For example, if you want to check if the user has asked for a follow up question, you can write the instruction like:

Examine the user's last utterance:

"[LAST INPUT]"

Determine if the user has asked a follow-up question by looking for:

- Interrogative words (who, what, where, when, why, how, etc.)

- Phrases that indicate a desire for additional information (e.g., "I would like to know", "Can you tell me about", "I'm interested in", "Could you explain")

- Continuation phrases or conjunctions that introduce new topics or questions (e.g., "but", "however", "also", "in addition")

- Output '1' if any of these indicators suggest a follow-up question is present.

- Output '0' if no follow-up question is detected.

[Note: Only output '1' or '0' based on this analysis.]

Choose the variable you want to store the response in. .

Learn more about variables