Pandorabots 初始机器人消息

Pandorabots Initial Bot Message

在网站的 "Chat Widget" 中,我可以写 "Initial Bot Message" 但不清楚如何在 AIML 文件中创建访问者对此初始消息的响应。 例如,我在 "Initial Bot Message" 中添加了问题 "Would you like to see live samples?" 这暗示有两种可能的响应 - "yes" 或 "no".

但是代码:

<category>
    <pattern>YES</pattern>
    <that>WOULD YOU LIKE TO SEE LIVE SAMPLES</that>
    <template>Answer YES</template>
</category>
<category>
    <pattern>NO</pattern>
    <that>WOULD YOU LIKE TO SEE LIVE SAMPLES</that>
    <template>Answer NO</template>
</category>

无效。

是的,你可以做到。首先,您需要创建一个类别,您希望您的机器人用它来欢迎您的访客。我用你的欢迎信息和两个按钮制作了一个名为 "Initial Bot Message" 的。

<category>
    <pattern>INITIAL BOT MESSAGE</pattern>
    <template>
        Would you like to see live samples?
        <button>
            <text>Yes</text>
            <postback>AnswerYES</postback>
        </button>
        <button>
            <text>No</text>
            <postback>AnswerNO</postback>
        </button>
    </template>
</category>

现在您需要修改聊天小部件代码,将 conversationOpener 部分替换为:

greetingPattern: "initial bot message",

现在机器人不会说欢迎信息,它会调用您的类别并允许您使用