...
Prerequisites
NodeJS
PostgreSQL
Kafka(optional)
Key Functionalities
Build a chat flow to facilitate a user to interact with rainmaker modules
Link a chat flow with backend services
Deployment Details
Deploy the latest version of xstate-chatbot
Configure /xstate-chatbot to be a whitelisted open endpoint in zuul
Add indexer-config to the egov-indexer to index all the telemetry messages
Environment Variable | Description |
---|---|
| The provider through which WhatsApp messages are sent & received. An adapter for ValueFirst is written. If there is any new provider a separate adapter will have to be implemented. A default |
| The database used to store the chat state. Currently, an adapter for PostgreSQL is provided. An |
| If it’s value is configured to be eGov, it will call the backend rainmaker services. If the value is configured as Dummy, dummy data would be used rather than fetching data from APIs. Dummy option is provided for initial dialog development, and is only to be used locally. |
| A list of comma separated locales supported by the chatbot. |
Other configuration details are mentioned as part of the XState-Chatbot Integration Document.
Overall Philosophy of Chatbot
...
The chat states would only include dialog-specific code. Any code related to backend service should be written as a part of a separate …-service.js file.
Any code that doesn’t include any asynchronous API call can be written as a part of the onEntry function or an action.
If the function needs to make an API call, that would have to be written with the invoke-onDone pattern. The asynchronous function should be written as a part of the service file. The consolidated data returned by it can be processed in the state of the dialog file.
Helper functions are written in
dialog.js
file. It is advised to use those functions as much as possible rather than writing any custom logic in dialog files.
...