[英]Can Google Actions be imported/exported from the Actions Console?
I'm just starting to learn how to build an Action with Scenes and Intends.我刚刚开始学习如何使用场景和意图构建动作。 Very basic.
很基础。 I see that prompts can be defined in JSON.
我看到提示可以在 JSON 中定义。 Is it possible to export the whole Action in JSON format for me to edit it outside of the UI?
是否可以以 JSON 格式导出整个操作,以便我在 UI 之外对其进行编辑? and then reimport it?
然后重新导入它?
The idea is that if a have a very simple Action (with lots of scenes, but easy intends) I can define the whole action in a much simpler format and automatically create the JSON that could be imported.这个想法是,如果有一个非常简单的动作(有很多场景,但意图很简单),我可以以更简单的格式定义整个动作,并自动创建可以导入的 JSON。 It would be much faster for me than defining each scene in the Actions Console.
对我来说,这比在 Actions Console 中定义每个场景要快得多。
Sort of.有点。
You can use the gactions command line tool to export and import the configuration files.您可以使用gactions命令行工具来导出和导入配置文件。 These completely represent the same things that you can edit using the web-based graphical editor.
这些完全代表了您可以使用基于 Web 的图形编辑器编辑的相同内容。
However... these files are in YAML, not JSON.但是...这些文件位于 YAML 中,而不是 JSON 中。 Semantically, they're identical, so you will still be able to create something that generates the files.
从语义上讲,它们是相同的,因此您仍然可以创建生成文件的内容。
To download your configuration into the current directory you'd use the gactions pull
command and specify your project ID with the --project-id
parameter:要将您的配置下载到当前目录,您可以使用
gactions pull
命令并使用--project-id
参数指定您的项目 ID:
gactions pull --project-id some-project-4242
You'll see that the Scenes and Intents each have their own folders under custom
where you'll be doing your editing.您会看到 Scenes 和 Intents 每个都有自己的
custom
文件夹,您将在其中进行编辑。
Once you've made the changes, you can upload the configuration with进行更改后,您可以使用以下命令上传配置
gactions push
(Note that you can't specify the project ID, since this is in one of the configuration files.) (请注意,您不能指定项目 ID,因为它位于配置文件之一中。)
You can then reload the test simulator and test your changes.然后,您可以重新加载测试模拟器并测试您的更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.