【问题标题】:Rasa Bot button click not responseRasa Bot 按钮单击不响应
【发布时间】:2021-09-08 14:28:54
【问题描述】:

我尝试学习 rasa chatbot ,我尝试单击按钮并进入相关意图。但是当我单击模板中的按钮时,等待符号出现之后,我被选中而没有响应。如果尝试编写“muhtesem”机器人,请理解并回复我。如何解决此按钮问题?谢谢

class ActionCarousel(Action):
def name(self) -> Text:
    return "action_carousels"

def run(self, dispatcher, tracker: Tracker, domain: "DomainDict") -> List[Dict[Text, Any]]:
    message = {
        "type": "template",
        "payload": {
            "template_type": "generic",
            "elements": [
                {
                    "title": "Merhaba, bugün nasılsın?",
                    "subtitle": "$10",
                    "image_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSqhmyBRCngkU_OKSL6gBQxCSH-cufgmZwb2w&usqp=CAU",
                    "buttons": [ 
                        {
                        "title": "Muhteşem",
                        "payload": "happy",
                        "type": "postback"
                        },
                        {
                        "title": "Üzgün",
                        "payload": "sad",
                        "type": "postback"
                        }
                    ]
                },
                {
                    "title": "Carousel 2",
                    "subtitle": "$12",
                    "image_url": "https://image.freepik.com/free-vector/city-illustration_23-2147514701.jpg",
                    "buttons": [ 
                        {
                        "title": "Click here",
                        "url": "https://image.freepik.com/free-vector/city-illustration_23-2147514701.jpg",
                        "type": "web_url"
                        }
                    ]
                }
            ]
            }
    }
    dispatcher.utter_message(attachment=message)
    return []

这是模板代码。感谢支持。

【问题讨论】:

    标签: python rasa-nlu rasa rasa-core


    【解决方案1】:

    “Muhteşem”按钮的有效负载是“happy”,而不是“Muhteşem”。这意味着它应该相当于向机器人输入“快乐”。

    对于此类问题,您最好在 rasa 论坛上提问:https://forum.rasa.com/

    【讨论】:

    • 感谢我更改了 "payload":"muhteşem" 并完成了。
    猜你喜欢
    • 2018-10-16
    • 1970-01-01
    • 1970-01-01
    • 2019-10-12
    • 2021-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-04
    相关资源
    最近更新 更多