如何转换 python 字典以将代理上传到 Dialogflow?

How to convert python dictionary to upload agent to Dialogflow?

我是 dialogflow 的新手,正在尝试将 python 字典转换为

dict = {"Monday": "running","Tuesday": "swimming","Wednesday": "cycling"}

将代理上传到 Dialogflow。

Dialogflow 指出:文件夹应包含 JSON 意图和实体的文件

我该怎么做?

提前致谢。

agent.json中有很多键需要填写。查找参数的最佳位置是 Dialogflow 文档,即 https://dialogflow.com/docs/reference/agent-json-fields

为了创建代理。您可以导入 zip 文件。 zip 文件的文件夹结构如下所示:

-main (folder)
 - intents (folder)
   - a.json (intent json file)
   - b.json (intent json file)
 - entities (folder)
   - x.json (entity json file)
   - y.json (entity json file)
 - agent.json
 -package.json

我希望这可以帮助您构建 JSON 文件。