0

I have seen examples in Google's DialogFlow where "Cards" are output and an image is shown to the user. I am using Python as a backend, with ngrok hosting a local website to connect the webhook to Google's fulfillment. However, these cards require an image's URL to show the image after an intent is activated. I am using matplotlib to generate a plot, which is saved locally. I want this image to be displayed after an intent is achieved.

Would it be better to immediately save this plot online somehow, or to send it to ngrok's server for me to use in fulfillment? Or is it possible to just upload the local file?

Jacob A
  • 109
  • 1
  • 10
  • Can you clarify exactly what you mean by "local website" and "saved locally"? Are these two referring to the same machine? – Prisoner Dec 17 '19 at 11:06
  • @Prisoner It is my first time using any web clients like this.. but I am using ngrok to host (?) the server (?) https://cb2344d0.ngrok.io on the local 5000 port to which I connect DialogFlow's webhook. By "saved locally" I just mean that the matplotlib fig is saved as a jpg in my local machine's drive. – Jacob A Dec 17 '19 at 19:57
  • You would have to use additional http server, see https://stackoverflow.com/questions/23438032/host-html-file-with-ngrok – Filip Kwiatkowski Dec 28 '19 at 14:08
  • Sidebar, I'd use `pyngrok` to manage the `ngrok` tunnel programmatically. Use a lightweight framework like Flask for the endpoints, or not, in either case you can easily use `pyngrok` to manage your tunnels. [Here are the docs with examples](https://pyngrok.readthedocs.io/en/latest). – alexdlaird Apr 26 '20 at 23:33

0 Answers0