嗨,我正在尝试设置当用户重新开始对话时要发出的一些消息。我已经在 Rasa 论坛中询问 并尝试更改代码。但它返回了这个错误
AttributeError: 'Tracker' 对象没有属性 'utter_message'</p>
这是我写的代码:
class ActionRestarted(Action):
""" This is for restarting the chat"""
def name(self) -> Text:
return "action_restart"
async def run(
self,
tracker: Tracker,
dispatcher: CollectingDispatcher,
domain: Dict[Text, Any],) -> List[Event]:
from rasa.core.events import Restarted
# only utter the template if it is available
evts = await super().run(tracker, domain, dispatcher.utter_message("Restarted"))
return evts + [Restarted()]
随时指出我的错误并纠正他们谢谢