I am struggling with getting the Google Assistant Example to work in Docker. More precisely I am failing at getting a custom InputChannel loaded by the run.py script of Rasa Core.
My docker-compose setup works like a charm for a Telegram chatbot, so I would assume it is not a general issue. I have a file with the name google_assistant_channel.py that looks like so very similar to the tutorial:
import json import logging from flask import Blueprint, jsonify, request from rasa_core.channels.channel import CollectingOutputChannel, InputChannel, UserMessage logger = logging.getLogger(__name__) class GoogleAssistantInput(InputChannel): """Google Assistant input channel"""
In my docker-compose I map the corresponding module (that means it and an empty __init__.py file) to /app/custom in the container.
After digging a bit into the source code I found out that I should be able to simply provide the module paht in the credentials file for this to be recognised, is this assumption correct?
My credentials.yml file looks as follows:
If I run the container I get the following error:
rasa_1 | Traceback (most recent call last): rasa_1 | File "/usr/local/bin/rasa", line 10, in <module> rasa_1 | sys.exit(main()) rasa_1 | File "/usr/local/lib/python3.6/site-packages/rasa/__main__.py", line 70, in main rasa_1 | cmdline_arguments.func(cmdline_arguments) rasa_1 | File "/usr/local/lib/python3.6/site-packages/rasa/cli/run.py", line 70, in run rasa_1 | rasa.run(**vars(args)) rasa_1 | File "/usr/local/lib/python3.6/site-packages/rasa/run.py", line 61, in run rasa_1 | model, channel=channel, credentials=credentials, endpoints=_endpoints, **kwargs rasa_1 | File "/usr/local/lib/python3.6/site-packages/rasa/core/run.py", line 132, in serve_application rasa_1 | input_channels = create_http_input_channels(channel, credentials) rasa_1 | File "/usr/local/lib/python3.6/site-packages/rasa/core/run.py", line 37, in create_http_input_channels rasa_1 | return [_create_single_channel(c, k) for c, k in all_credentials.items()] rasa_1 | File "/usr/local/lib/python3.6/site-packages/rasa/core/run.py", line 37, in <listcomp> rasa_1 | return [_create_single_channel(c, k) for c, k in all_credentials.items()] rasa_1 | File "/usr/local/lib/python3.6/site-packages/rasa/core/run.py", line 56, in _create_single_channel rasa_1 | "is a proper name of a class in a module.".format(channel) rasa_1 | Exception: Failed to find input channel class for 'custom.google_assistant_channel.GoogleAssistantInput'. Unknown input channel. Check your credentials configuration to make sure the mentioned channel is not misspelled. If you are creating your own channel, make sure it is a proper name of a class in a module.
I must be doing something wrong with respect to the import paths. Do you have any idea how to tackle this?