Google colaboratory Rasa自定义操作不起作用-Google Colab

Google colaboratory Rasa自定义操作不起作用-Google Colab,google-colaboratory,rasa-nlu,rasa,rasa-core,rasa-x,Google Colaboratory,Rasa Nlu,Rasa,Rasa Core,Rasa X,我正在尝试在Colab上实现RASA聊天机器人,发现很难自定义操作。。Rest所有工作正常,但动作除外。。我觉得我的聊天室没有进入我的行动。。谁能给我指路吗 nlu_md = """ ## intent:greet - Hello - hello - good morning ## intent:justbook - table for 1 - make reservations for me - make reservations for 1 person &q

我正在尝试在Colab上实现RASA聊天机器人,发现很难自定义操作。。Rest所有工作正常,但动作除外。。我觉得我的聊天室没有进入我的行动。。谁能给我指路吗

nlu_md = """
## intent:greet
- Hello
- hello
- good morning

## intent:justbook
- table for 1
- make reservations for me
- make reservations for 1 person
"""
%store nlu_md > nlu.md

stories_md = """

## Story 1
* greet 
    - action_print
"""
%store stories_md > stories.md


domain_yml = """
%YAML 1.1
---
actions:
- utter_booking_confirmation
- utter_greeting
- utter_thankyou
- __main__.Printer
- action_print


entities:
- time
- date
- number_of_people
intents:
- time
- when
- book
- greet
- justbook

  
templates:
  utter_greeting:
  - text: Welcome to the restaurant ! How can I help you ?
  utter_thankyou:
  - text: Thank You for using our services ! See you again soon !
  utter_confirm:
  - text: Your booking is confirmed for {number_of_people} on {date} at {time}. Thank You. See you soon  
"""

%store domain_yml > domain.yml
行动

from rasa_core_sdk import Tracker
from rasa_core_sdk import Action
from rasa_core_sdk.events import SlotSet
from rasa_core_sdk.executor import CollectingDispatcher
from rasa_core.actions import Action  

     

class Printer(Action):
        def name(self):
            return "action_print"
            
        def run(self, dispatcher, tracker, domain):
            no_of_people=tracker.slots['number_of_people']
            time=tracker.slots['time']
            date=tracker.slots['date']
            print('ENTERED PRINTER')
        
            dispatcher.utter_message('hi i am in Printer')
            #return ''
聊天室

from rasa_core.agent import Agent
from rasa_core.utils import EndpointConfig
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.utils import EndpointConfig

agent = Agent.load('models/dialogue',interpreter=RasaNLUInterpreter('/content/drive/My Drive/restaurant bot/models/nlu/default/restaurantbot'),
        action_endpoint=EndpointConfig(url="http://127.0.0.1:5055/webhook"))
print("Bot is ready to talk! Start conversation with 'hi'")
while True:
    st = input()
    if st == 'stop':
        break
    responses = agent.handle_text(st)
    for response in responses:
        print(response["text"])
预期产出
我期望输出:输入打印机HI我在打印机中。

输出我得到了我没有得到预期的输出,我只是得到了用于输入的文本框。

请共享一个独立的笔记本,它会重现您观察到的问题。您是否将操作代码作为后台服务运行?启动时,您应该看到操作服务日志
action\u print
类名。您可以对动作端点执行测试
curl