2

我在纯音频设备(例如 google home)上为用户提供响应,当我在 simpleResponse 中使用 textToSpeech 字段进行响应时,语音不会在模拟器中读出。

有没有人经历过这个并且知道如何解决?

我尝试了不同的响应类型,但没有一个能读出 textToSpeech 字段。还尝试在 Dialogflow 中勾选/取消勾选结束对话切换,并在使用 JSON 响应时期望用户输入 true/false 无济于事。

该响应当前由一个使用 JSON v2 实现 blob 响应的 webhook 实现,并且模拟器接收到没有错误的响应,但不会将其读出。

回复 -

{
  "payload": {
    "google": {
      "expectUserResponse": true,
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "Here are the 3 closest restaurants that match your criteria,"
            }
          }
        ]
      }
    }
  }
}

要求 -

{
  "responseId": "404f3b65-73a5-47db-9c17-0fc8b31560a5",
  "queryResult": {
    "queryText": "actions_intent_NEW_SURFACE",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "outputContexts": [
      {
        "name": "projects/my-project/agent/sessions/sessionId/contexts/findrestaurantswithcuisineandlocation-followup",
        "lifespanCount": 98,
        "parameters": {
          "location.original": "Shoreditch",
          "cuisine.original": "international",
          "cuisine": "International",
          "location": {
            "subadmin-area": "Shoreditch",
            "subadmin-area.original": "Shoreditch",
            "subadmin-area.object": {}
          }
        }
      },
      {
        "name": "projects/my-project/agent/sessions/sessionId/contexts/actions_capability_account_linking"
      },
      {
        "name": "projects/my-project/agent/sessions/sessionId/contexts/actions_capability_audio_output"
      },
      {
        "name": "projects/my-project/agent/sessions/sessionId/contexts/google_assistant_input_type_voice"
      },
      {
        "name": "projects/my-project/agent/sessions/sessionId/contexts/actions_capability_media_response_audio"
      },
      {
        "name": "projects/my-project/agent/sessions/sessionId/contexts/actions_intent_new_surface",
        "parameters": {
          "text": "no",
          "NEW_SURFACE": {
            "@type": "type.googleapis.com/google.actions.v2.NewSurfaceValue",
            "status": "CANCELLED"
          }
        }
      }
    ],
    "intent": {
      "name": "projects/my-project/agent/intents/0baefc9d-689c-4c33-b2b8-4e130f626de1",
      "displayName": "Send restaurants to mobile"
    },
    "intentDetectionConfidence": 1,
    "languageCode": "en-us"
  },
  "originalDetectIntentRequest": {
    "source": "google",
    "version": "2",
    "payload": {
      "isInSandbox": true,
      "surface": {
        "capabilities": [
          {
            "name": "actions.capability.AUDIO_OUTPUT"
          },
          {
            "name": "actions.capability.MEDIA_RESPONSE_AUDIO"
          },
          {
            "name": "actions.capability.ACCOUNT_LINKING"
          }
        ]
      },
      "requestType": "SIMULATOR",
      "inputs": [
        {
          "rawInputs": [
            {
              "query": "no",
              "inputType": "VOICE"
            }
          ],
          "arguments": [
            {
              "extension": {
                "@type": "type.googleapis.com/google.actions.v2.NewSurfaceValue",
                "status": "CANCELLED"
              },
              "name": "NEW_SURFACE"
            },
            {
              "rawText": "no",
              "textValue": "no",
              "name": "text"
            }
          ],
          "intent": "actions.intent.NEW_SURFACE"
        }
      ],
      "user": {
        "userStorage": "{\"data\":{}}",
        "lastSeen": "2019-04-12T14:31:23Z",
        "locale": "en-US",
        "userId": "userID"
      },
      "conversation": {
        "conversationId": "sessionId",
        "type": "ACTIVE",
        "conversationToken": "[\"defaultwelcomeintent-followup\",\"findrestaurantswithcuisineandlocation-followup\",\"findrestaurantswithcuisineandlocation-followup-2\"]"
      },
      "availableSurfaces": [
        {
          "capabilities": [
            {
              "name": "actions.capability.AUDIO_OUTPUT"
            },
            {
              "name": "actions.capability.SCREEN_OUTPUT"
            },
            {
              "name": "actions.capability.WEB_BROWSER"
            }
          ]
        }
      ]
    }
  },
  "session": "projects/my-project/agent/sessions/sessionId"
}

我希望模拟器能读出 textToSpeech 的结果,但目前没有。

4

0 回答 0