为聊天机器人脚本

时间:2018-05-11 19:44:27

标签: json yaml chatbot

我正在创建一个基于聊天机器人的网站。我正在使用YAML为chatbot的脚本创建JSON文件。

YAML文件看起来像这样:

- Primer:
Conversation:
- Information2:
      label:
         head: Logistic Linear Regression
         ribbon: Equation Breaking 
         header: The gentle introduction to mayhem
      src: introduction
- Chat:
   messages: ['Hi {{user}}', 'Glad to see you here.']
- Information2:
      label:
         ribbon: Equation Breaking 
      src: history

Meta: {avatar: happy}
Reply:
  - Button:
     content: Hello Primer. Nice to meet you too. 
     label: Hello
  - Button:
     content: Hi Primer. It is a real pleasure seeing you too. 
     label: Hi there!

这是聊天的一个基本单位,其中机器人提问,提供一些信息,用户使用回复选择选项。

在YAML中编写此脚本非常痛苦,因为每当我编写内容时总会出现一些缩进错误。我打算为这种用法编写基于Racket的DSL,但没有取得任何成功(短时间线)。

任何人都可以建议任何更好的方法来生成我可以自由编写的JSON,知道脚本将编译为我想要的JSON。

1 个答案:

答案 0 :(得分:0)

我认为你想使用像RiveScript这样具有表现力,常用且具有相当广泛的工具集的东西。

相关问题