Rasa CALM external triggers

The goal of this project is to showcase a flow that can be triggered from an external system using the Rasa endpoint: /conversations/<conversation_id>/trigger_intent.

Project Structure

Flow Name Description Link to flow Link to domain
Tell Conversation ID Gives you the conversation ID. Link Link
External Greeting Flow that should be triggered using an intent activated from the Rasa API. Link Link

How to run this project

Configuration

This project uses cohere as LLM mainly because you can run this project free of costs.

  1. Install Rasa Pro.

  2. Setup credentials.

export RASA_PRO_LICENSE=<YOUR_RASA_LICENSE>
export COHERE_API_KEY=<YOUR_COHERE_API_KEY>
  1. Create a model using.

rasa train

Run the components

  1. Run the action server in a different tab.

rasa run actions

  1. Run the Rasa server with an interactive shell.

rasa shell --enable-api

Run the manual test case to showcase how external triggers work in Rasa CALM

  1. Get the conversation ID.

From the Rasa shell, get the conversation ID typing something like: I'd like to have the conversation ID. It uses a custom action to get it.

  1. Trigger the intent using the Rasa API.
  • Set the conversation ID.

export conversation_id=<conversation_id>

  • Trigger the intent.

    curl -H "Content-Type: application/json" -X POST -d \
    '{"name": "EXTERNAL_hello"}' \
    "http://localhost:5005/conversations/${conversation_id}/trigger_intent"
    
  1. Verufy that the response body containins a json with the messages field set to ["Hi, dude! This message has been triggered by an external system, yeah!"]