Hi,
I’m trying to implement a custom connector for our internal messenger.
As per the Custom Connectors Guide, I created a python script in my application directory chatbotchannel.py
and implemented InputChannel class.
#filename : chatbotchannel.py
class ChatBot(InputChannel):
@classmethod
def name(cls):
return "chatbot"
Also added below entry in the credentials.yml
file in the app directory (this dir is created using rasa init
)
# filename : credentials.yml
# This file contains the credentials for the voice & chat platforms
# which your bot is using.
# https://rasa.com/docs/rasa/user-guide/messaging-and-voice-channels/
rest:
# # you don't need to provide anything here - this channel doesn't
# # require any credentials
#entry for custom channel
chatbotchannel.ChatBot:
I get below error when I start the server using rasa run
command.
Traceback (most recent call last):
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/core/run.py", line 50, in _create_single_channel
input_channel_class = class_from_module_path(channel)
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/utils/common.py", line 188, in class_from_module_path
m = importlib.import_module(module_name)
File ".direnv/python-3.7.3/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'chatbotchannel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".direnv/python-3.7.3/bin/rasa", line 10, in <module>
sys.exit(main())
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/__main__.py", line 70, in main
cmdline_arguments.func(cmdline_arguments)
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/cli/run.py", line 101, in run
rasa.run(**vars(args))
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/run.py", line 59, in run
**kwargs
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/core/run.py", line 138, in serve_application
input_channels = create_http_input_channels(channel, credentials)
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/core/run.py", line 37, in create_http_input_channels
return [_create_single_channel(c, k) for c, k in all_credentials.items()]
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/core/run.py", line 37, in <listcomp>
return [_create_single_channel(c, k) for c, k in all_credentials.items()]
File ".direnv/python-3.7.3/lib/python3.7/site-packages/rasa/core/run.py", line 58, in _create_single_channel
"is a proper name of a class in a module.".format(channel)
Exception: Failed to find input channel class for 'chatbotchannel.ChatBot'. 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.
What should be the correct format in credentials.yml
file to declare my custom channel python script and class?