如何从命令行与 rasa 助手交互?

How do I interact the rasa assistant from the command line?

使用 rasa init 创建新的 rasa 助手时,我得到以下界面。退出后可以在命令行运行下什么命令回到这个界面?有时我宁愿只使用 cmd 界面而不是 运行ning rasa x 和使用浏览器。

? Do you want to speak to the trained assistant on the command line?   Yes
2020-11-03 10:01:30 INFO     root  - Connecting to channel 'cmdline' which was specified by the '--connector' argument. Any other channels will be ignored. To connect to all given channels, omit the '--connector' argument.
2020-11-03 10:01:30 INFO     root  - Starting Rasa server on http://localhost:5005
2020-11-03 10:01:32 INFO     root  - Rasa server is up and running.
Bot loaded. Type a message and press enter (use '/stop' to exit):
Your input ->  hi
Hey! How are you?
Your input ->  good
Great, carry on!
Your input ->  I am sad
Great, carry on!
Your input ->  hi
Hey! How are you?
Your input ->  bad
Here is something to cheer you up:
Image: https://i.imgur.com/nGF1K8f.jpg
Did that help you?
Your input ->  /stop
2020-11-03 10:02:38 INFO     root  - Killing Sanic server now.

因此,在 运行 宁 rasa init 之后,现在您的项目已准备就绪,并且模型已被训练。要恢复此界面,您必须在命令行界面中 运行 rasa shell 这将加载经过训练的模型并让您在命令行上与您的助手交谈。

同样为了后代,我想添加这个答案。在 运行ning rasa shell 之前,我一直在做 rasa train nlu,它正在创建一个仅限 NLU 的模型。

为了能够在命令行与助手对话,我需要先 运行 rasa train 然后 运行 rasa shell.