【问题标题】:Google Action language to Dialogflow language mappingGoogle Action 语言到 Dialogflow 语言的映射
【发布时间】:2018-08-11 06:29:10
【问题描述】:

如何将我的 Google Action 语言链接到我的 Dialogflow 语言?

我的 Google Action 未通过认证,因为我的法语 Google Action 正在调用我的英语 Dialogflow。我认为 Dialogflow 足够聪明,可以从我的请求的 json 中读取 "locale": "fr-FR",并将请求路由到我的 Dialogflow 的法语版本,但显然不是因为它响应的是英语版本。

有没有办法将我的 Google Action 中的每种语言与 Dialogflow 中的对应语言进行映射?

这是我使用模拟器看到的:

请求:

{
  "user": {
    "user_id": "blah",
    "access_token": "blahblah",
    "permissions": [],
    "locale": "fr-FR",
    "last_seen": {
      "seconds": 1519777910
    },
    "package_entitlements": []
  },
  "conversation": {
    "conversation_id": "1519777935448",
    "type": 1
  },
  "inputs": [
    {
      "intent": "assistant.intent.action.MAIN",
      "raw_inputs": [
        {
          "input_type": 2,
          "query": "Parler avec Déclencher CMD",
          "annotation_sets": []
        }
      ],
      "arguments": []
    }
  ],
  "surface": {
    "capabilities": [
      {
        "name": "actions.capability.SCREEN_OUTPUT"
      },
      {
        "name": "actions.capability.AUDIO_OUTPUT"
      },
      {
        "name": "actions.capability.WEB_BROWSER"
      },
      {
        "name": "actions.capability.MEDIA_RESPONSE_AUDIO"
      }
    ]
  },
  "is_in_sandbox": true,
  "available_surfaces": [
    {
      "capabilities": [
        {
          "name": "actions.capability.AUDIO_OUTPUT"
        },
        {
          "name": "actions.capability.SCREEN_OUTPUT"
        }
      ]
    }
  ]
}

回复:

{
  "response_metadata": {
    "status": {},
    "query_match_info": {
      "query_matched": true,
      "intent": "Default Welcome Intent"
    }
  },
  "conversation_token": "[]",
  "expect_user_response": true,
  "expected_inputs": [
    {
      "input_prompt": {
        "rich_initial_prompt": {
          "items": [
            {
              "simple_response": {
                "text_to_speech": "Say something like, run calculator on laptop."
              }
            }
          ]
        },
        "no_match_prompts": [],
        "no_input_prompts": []
      },
      "possible_intents": [
        {
          "intent": "assistant.intent.action.TEXT"
        }
      ]
    }
  ]
}

【问题讨论】:

  • 您是否使用服务器进行回复?

标签: actions-on-google dialogflow-es google-home google-assistant-sdk


【解决方案1】:

您可以注意到您的请求 JSON 密钥是驼峰式大小写的,这意味着您使用的是不支持多语言的 Google 对话 API V1 上的操作。通过选中 Dialogflow 中 Google 助理集成模式的“其他设置”部分中的复选框,确保迁移到 V2(查看下图)

请注意,有些项目不显示 V2 复选框选项。如果您的项目出现这种情况,请联系支持。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多