You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

2024年如何创建Google Assistant简易“Hello World” Action?

如何创建Google Assistant的"Hello World" Action(基于当前Actions Console)

核心背景说明

由于Google Assistant对话Actions(Conversational Actions)已于2023年6月13日停用,当前自定义交互Action需通过Actions Builder的Custom类型创建,而非旧教程中的Dialogflow或其他已弃用入口。以下是针对你遇到的"仅显示Smart home类型"问题的解决步骤:

具体操作步骤

  1. 进入正确的项目创建流程
    打开Actions Console后,创建新项目(或打开空白项目),确保进入项目的Develop模块,点击左侧菜单栏的Actions选项进入Action创建页。

  2. 找到Custom类型入口
    点击Create action按钮后,若仅显示Smart home类型,需点击界面中的See more(或类似"查看更多类型"的选项),选择Custom类型,再选择Build using Actions Builder进入编辑器。

  3. 创建触发Intent
    在Actions Builder中,新建一个Intent(如命名为HelloIntent):

    • 在Training phrases中添加触发语,例如hello、say hello、hi;
    • 确保Intent的触发条件设置为匹配这些短语。
  4. 配置回复逻辑
    在Intent的Fulfillment部分,选择Inline code,输入以下极简回复代码:

    return {
      "session": {
        "id": request.session.id,
        "params": {}
      },
      "prompt": {
        "firstSimple": {
          "speech": "Hello World! This is your first Google Assistant Action.",
          "text": "Hello World! This is your first Google Assistant Action."
        }
      },
      "scene": {
        "name": "HelloScene",
        "next": {
          "name": "actions.scene.END_CONVERSATION"
        }
      }
    };
    
  5. 设置Invocation名称
    进入左侧菜单栏的Invocation页面,设置一个触发名称(如my hello action),用户可通过语音指令Hey Google, talk to my hello action触发你的Action。

  6. 测试验证
    点击右上角的Test按钮,在模拟器中输入或说出触发词,即可收到"Hello World"的回复。

额外注意事项

  • 若仍无法找到Custom类型,建议新建一个全新项目尝试(旧项目可能因历史配置限制显示内容);
  • 当前Google Assistant自定义交互仅支持Actions Builder或Actions SDK,Dialogflow已不再用于Assistant Action开发;
  • 检查账号权限与所在区域,部分受限区域可能无法使用全部功能。

内容的提问来源于stack exchange,提问作者Sandro Henriques

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 18:02:23