python - RASA - rasa 运行操作 - 本地主机问题

标签 python rasa-core rasa

我正在使用 RASA 大师类 YouTube channel 学习 Rasa。 https://www.youtube.com/channel/UCJ0V6493mLvqdiVwOKWBODQ

一切都在进行,直到加载操作为止。每次我在命令提示符中使用 rasa run 操作(两个操作中的第一个)时,程序都会卡住,我必须手动终止它。当我使用 rasa shell --endpoints endpoints.yml 时,机器人可以正常工作,因为当我添加自定义操作时,我不断遇到服务器返回的无法连接到本地主机的情况,如下面的示例所示。问题是我如何解决这个问题。

*请索取更多信息

:enter image description here

我的 actions.py 如下所示:

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.events import SlotSet



class ActionFacilitySearch(Action):

    def name(self) -> Text:
        return "action_facility_search"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        facility = tracker.get_slot("facility_type")
        address = "300 Hyde St, San Francisco"
        dispatcher.utter_message("Here is the address of the {}:{}".format(facility, address))

        return []

在domain.yml中,对于我的操作部分;

actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_iamabot
- utter_ask_location
- action_facility_search

在endpoints.yml中,大部分内容已被#'d淘汰,但事件位是:

action_endpoint:
  url: "http://localhost:9000/webhook"

最佳答案

最后的答案非常简单。我需要运行两个命令窗口。第一个用于:

rasa run actions

然后是第二个窗口:

rasa x

rasa shell

然后就可以正常工作了。

关于python - RASA - rasa 运行操作 - 本地主机问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58969678/

相关文章:

python - Openerp NotImplementedError : Iteration is not allowed on browse_record(stock. 移动,159275)

python - 具有变量值的 Django 查询集

python-3.x - 如何减少 rasa 3 python 中的模型加载时间

rasa-nlu - 如何使用 gunicorn 在多线程模式下运行 RASA Server

python - Rasa 核心训练命令 : unrecognized arguments

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

Python requests-html session GET 正确用法

python - urllib.unquote_plus(s) 不会将加号转换为空格

python - 使用一行 bash 脚本安装后从 Ubuntu 中删除和清除 Rasa-x