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
.
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 |
This project uses cohere as LLM mainly because you can run this project free of costs.
-
Setup credentials.
export RASA_PRO_LICENSE=<YOUR_RASA_LICENSE>
export COHERE_API_KEY=<YOUR_COHERE_API_KEY>
- Create a model using.
rasa train
- Run the action server in a different tab.
rasa run actions
- Run the Rasa server with an interactive shell.
rasa shell --enable-api
- 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.
- 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"
- 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!"]