RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.79k stars 4.62k forks source link

Rasa X not showing image when given local path (showing "broken image" icon instead) #4958

Closed snbuchholz closed 4 years ago

snbuchholz commented 4 years ago

Rasa version: 1.5.

Rasa SDK version (if used & relevant):

Rasa X version (if used & relevant): 0.23.3

Python version: 3.7.1

Operating system (windows, osx, ...): OSX

Issue: I want my bot to show pictures that are generated on the fly by a custom action and use Rasa X for letting test users interact with the bot. The custom action stores the picture in a local path. However, while Rasa X does show pictures when given a URL (like with moodbot's tiger cub image), it only displays the "broken image" icon when given a local path to a picture. To reproduce this issue in a minimal way, simply take Rasa's moodbot and replace the value of the image attribute in

  utter_cheer_up:
  - text: 'Here is something to cheer you up:'
    image: https://i.imgur.com/nGF1K8f.jpg

with a local path to the same image (after downloading it to there). The screenshot shows the resulting conversation in Rasa X: rasax_screenshot

PS: It works when using the Webex Teams channel, so it seems to be a Rasa X rather than a Rasa issue.

There are some related questions on the forum 1, 2, but I could not find a bug report about it.

Error (including full traceback): No error message, just "broken image" icon

Command or request that led to error: Conversation with bot in Rasa X

Content of configuration file (config.yml) (if relevant): not relevant

Content of domain file (domain.yml) (if relevant):

intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
templates:
  utter_greet:
  - text: Hey! How are you?
  utter_cheer_up:
  - text: 'Here is something to cheer you up:'
    image: file:///Users/s.buchholz/venv_my-rasa_new/nlp-rasa-code/init/tiger.jpg
  utter_did_that_help:
  - text: Did that help you?
  utter_happy:
  - text: Great, carry on!
  utter_goodbye:
  - text: Bye
  utter_iamabot:
  - text: I am a bot, powered by Rasa.
actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_iamabot

PS: I followed this forum post for the syntax for a local path. Have tried variations (without file:// prefix, with quotation marks, just relative path) as well but did not make a difference.

sara-tagger commented 4 years ago

Thanks for raising this issue, @rgstephens will get back to you about it soon✨

Please also check out the docs and the forum in case your issue was raised there too 🤗
rgstephens commented 4 years ago

Thanks for reporting this. Marking this as a bug.

vpinilla001 commented 4 years ago

Do you solve this issue?

snbuchholz commented 4 years ago

No, I didn’t

From: vpinilla001 notifications@github.com Reply to: RasaHQ/rasa reply@reply.github.com Date: Wednesday, 11 March 2020 at 11:33 To: RasaHQ/rasa rasa@noreply.github.com Cc: Sabine Buchholz s.buchholz@iesohealth.com, Author author@noreply.github.com Subject: Re: [RasaHQ/rasa] Rasa X not showing image when given local path (showing "broken image" icon instead) (#4958)

[EXTERNAL MESSAGE]

Do you solve this issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/RasaHQ/rasa/issues/4958?email_source=notifications&email_token=AASCXBWC2CBT466V4OL7YJTRG5ZHDA5CNFSM4JZ4HMG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOPGBCI#issuecomment-597581961, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AASCXBQMD4OSD56TLP6UUPDRG5ZHDANCNFSM4JZ4HMGQ.

Sabine Buchholz Senior AI Scientist w: iesohealth.com IESO_SIG_V1.01 Ieso launches Step 2 therapy service Ieso launches new digital therapeutics program, Eight Billion Minds, to address unmet global mental health needs This email is confidential. If you are not the intended recipient, please do not copy or disclose its content but contact the sender immediately upon receipt.

sivanandh commented 4 years ago

is there any solution to use local images?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed due to inactivity. Please create a new issue if you need more help.

roarnes commented 3 years ago

Found a work-around for when you're still serving rasa x locally and only using it for testing/demo purposes.

Serve your local folder that contains the image using ngrok:

`ngrok http file://<absolute_path_to_folder>`

Copy the forwarding URL from ngrok.

Then in actions.py:

`image = 'https://1b6ddff8651c.ngrok.io/bmc.png'
 dispatcher.utter_message(text = "Here is the image that you have created.", image = image)`