Running external programs simultaneously with Rasa 3.0

Good Day, I would like to run and interface a face recognition program alongside a Rasa Voicebot in a local machine. As Rasa does not support multithreading, Can you suggest any alternative methods that I can use to interface and exchange the processed information between two programs. If possible, can you recommend any video tutorial ? Thank you.

Welcome to the community :slight_smile:

To use Rasa inside a custom application, you can use its REST API.

From the docs:

The REST channel will provide you with a REST endpoint where you can post user messages and receive the assistant’s messages in response.

  1. Add the REST channel to your credentials.yml:

    rest: # yes, just that
    
  2. Restart your server to make the REST channel available to receive messages:

    rasa run actions --cors "*" && rasa run --enable-api --cors "*" --debug    
    
  3. You can then POST messages to http://localhost:5005/webhooks/rest/webhook, with the following format:

    {
        "sender": "test_user", // unique ID of the user sending the message
        "message": "Hi there!"
    }
    
  4. The response from Rasa Open Source will be a JSON body of bot responses, for example:

    [
        {"text": "Hey from Rasa!"},
        {"image": "http://example.com/image.jpg"}
    ]
    

:warning: These only apply for a local installation of Rasa. If you want to deploy your app/bot on a server instead, the process is a bit different.

1 Like

Thank you Chris for the link to the doc and the explanation :). Let me try implementing and get back to you about the outcome. Thanks,

1 Like

Happy to help :slight_smile: Don’t hesitate to ask if you’re confused

1 Like