I want to integrate a language translation API (post) in my chatbot. The flow goes like this:
message received from user -> call the translate API -> translate to English -> process -> generate output-> translate back to the native language of the user-> display on web
Should I call the API in after_incoming_middleware_hook and before_outgoing_middleware hook to translate the incoming and outgoing messages? Please guide me through this.