Проблема с голосовым потоком для Google Action / Voice - сбой после «предложений» будет игнорироваться, поскольку они используются в «final_response» » - PullRequest
0 голосов
/ 08 октября 2019

Я использую VoiceFlow для создания простого приложения для потоковой передачи музыки, которое воспроизводит MP3-файлы и позволяет пользователю останавливать / запускать / пропускать / воспроизводить дорожки в соответствии с методами по умолчанию.

Это отлично работает с Alexa, но когдаЯ тестирую его в Google Action / Voice, сразу после начала воспроизведения первого файла (который запускается автоматически для моей программы) я получаю следующую ошибку:

UnnecessaryField final_response.rich_response: 'suggestions' will be ignored since they are used in 'final_response'. 

И вот отладочная информация из Google Action:

{
  "response": "Alright. Getting the test version of my test app.\nHello, welcome to My music. I'll now play my favorite My music for you. You can skip ahead to the next track by saying, Hey Google, next. Or go back to the previous one by saying, Hey Google, previous. You can also pause the music by saying, Hey Google, pause. If you want to stop the music, say Hey Google, stop.Sorry, something went wrong. When you're ready, give it another try.",
  "expectUserResponse": false,
  "conversationToken": "Evwo5dm...",
  "audioResponse": "//NExG...",
  "ssmlMarkList": [],
  "debugInfo": {
    "assistantToAgentDebug": {
      "curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=b1eb03ce32b1' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: eyJhbGciOiJSUzI1NiIsImtpZCI6ImVlNGRiZDA2YzA2NjgzkZGNhNmI4OGMzZTQ3M2I2OTE1YjkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhdWQiOiJiYXJvcXVlbXVzaWMtNDQ3OWQiLCJuYmYiOjE1NzA2NTE2OTQsImlhdCI6MTU3MDY1MTk5NCwiZXhwIjoxNTcwNjUyMTE0LCJqdGkiOiI4DK0Q4nY_KgaP57R_U0BLbsXzsraHwEiwzrJOTtu-VBlypZ0ujPph6WWGzlmfRhek09QjaCTVAR9gQOzrfkvnMwrmLH9CskopziyVRK3Yj99IArZp5bht0uvma78p-mxYwVfmGpDLt2A2nVpx3P-XMaswq-b3WA-s3-Y3sNpZO5MPkSmATXWxFdoA9xnKpWrGSbJ3TksylVygrhFPzw_gQ2bQ'  -A Google-ActionsOnGoogle/1.0 -X POST -d '{\"user\":{\"locale\":\"en-US\",\"lastSeen\":\"2019-10-09T20:13:04Z\",\"userStorage\":\"{\\\"data\\\":{\\\"userId\\\":\\\"2cd086-9896-4ddf-a59c-a2d9a3229\\\"}}\",\"userVerificationStatus\":\"VERIFIED\"},\"conversation\":{\"conversationId\":\"ABwppHFmu4qLfj_d0VPLm1k4MJOFKTmjb8NQJ6iH5TOJBilnPK5Gf1z-hvlIMqB8XVpP\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"VOICE\",\"query\":\"Talk to my test app\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.ACCOUNT_LINKING\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]},\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}]}'",
      "assistantToAgentJson": "{\"user\":{\"locale\":\"en-US\",\"lastSeen\":\"2019-10-09T20:13:04Z\",\"userStorage\":\"{\\\"data\\\":{\\\"userId\\\":\\\"2c60d086-6-4ddf-a59c-a21c3229\\\"}}\",\"userVerificationStatus\":\"VERIFIED\"},\"conversation\":{\"conversationId\":\"ABwppHxEQQ7pSIgVULfj_d0VPLm1kTmjb8NQJ6iHHDWaxHI5TOJBilnlIMqB8XVpP\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"VOICE\",\"query\":\"Talk to my test app\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.ACCOUNT_LINKING\"},{\"name\":\"actions.capability.MEDIA_RESPONSE_AUDIO\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]},\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.SCREEN_OUTPUT\"},{\"name\":\"actions.capability.WEB_BROWSER\"},{\"name\":\"actions.capability.AUDIO_OUTPUT\"}]}]}",
      "delegatedRequest": {
        "delegatedRequest": ""
      }
    },
    "agentToAssistantDebug": {
      "agentToAssistantJson": "{\n  \"conversationToken\": \"[]\",\n  \"finalResponse\": {\n    \"richResponse\": {\n      \"items\": [{\n        \"simpleResponse\": {\n          \"textToSpeech\": \"\\u003cspeak\\u003eHello, welcome to My music.  I\\u0027ll now play my favorite My music for you. You can skip ahead to the next track by  saying, Hey Google, next. Or go back to the previous one by saying, Hey Google, previous. You can also pause the music by saying, Hey Google, pause. If you want to stop the music, say Hey Google, stop.\\u003c/speak\\u003e\"\n        }\n      }, {\n        \"mediaResponse\": {\n          \"mediaType\": \"AUDIO\",\n          \"mediaObjects\": [{\n            \"name\": \"Albinoni - Adagio in G minor\",\n            \"contentUrl\": \"https://s3.amazonaws.com/com.getstoryflow.audio.production/file.mp3\"\n          }]\n        }\n      }],\n      \"suggestions\": [{\n        \"title\": \"exit\"\n      }]\n    }\n  },\n  \"responseMetadata\": {\n    \"status\": {\n      \"message\": \"Success (200)\"\n    },\n    \"queryMatchInfo\": {\n      \"queryMatched\": true,\n      \"intent\": \"4eaa-eae8-438a-880a-cc9e27a936fc\"\n    }\n  }\n}",
      "delegatedResponse": {
        "delegatedResponse": ""
      }
    },
    "sharedDebugInfoList": [
      {
        "name": "ResponseValidation",
        "debugInfo": "",
        "subDebugEntryList": [
          {
            "name": "UnnecessaryField",
            "debugInfo": "final_response.rich_response: 'suggestions' will be ignored since they are used in 'final_response'.",
            "subDebugEntryList": []
          }
        ]
      }
    ],
    "conversationBuilderExecutionEventsList": []
  },
  "visualResponse": {
    "visualElementsList": [
      {
        "simulatorMediaResponse": {
          "mediaResponse": {
            "mediaType": 1,
            "mediaObjectsList": [
              {
                "name": "File",
                "description": "",
                "contentUrl": "https://s3.amazonaws.com/com.getstoryflow.audio.production/file.mp3"
              }
            ],
            "startOffsetMs": 0
          },
          "mediaSessionId": "324532373494015"
        }
      },
      {
        "displayText": {
          "content": "Alright. Getting the test version of my test app."
        }
      },
      {
        "displayText": {
          "content": "Hello, welcome to My music.  I'll now play my favorite My music for you. You can skip ahead to the next track by  saying, Hey Google, next. Or go back to the previous one by saying, Hey Google, previous. You can also pause the music by saying, Hey Google, pause. If you want to stop the music, say Hey Google, stop."
        }
      },
      {
        "displayText": {
          "content": "Sorry, something went wrong. When you're ready, give it another try."
        }
      }
    ],
    "suggestionsList": [],
    "agentLogoUrl": "https://www.gstatic.com/voice/opa/partner_icons/generic_3p_avatar.png",
    "agentStyle": {
      "primaryColor": "",
      "fontFamily": "",
      "borderRadius": 0,
      "backgroundColor": "",
      "backgroundImageUrl": ""
    }
  },
  "clientError": 0,
  "is3pResponse": true,
  "clientOperationList": [
    {
      "operationType": 4,
      "startIndicatorPayLoad": {
        "status": 1
      }
    },
    {
      "operationType": 7,
      "exitIndicatorPayLoad": {
        "status": 1
      }
    }
  ],
  "projectName": "",
  "renderedHtml": ""
}

Я должен иметь возможность взаимодействовать с приложением, делая паузу, останавливаясь, пропуская или возвращаясь к предыдущему треку.

Вместо этого возникает ошибка, которая вылетает из приложения.

Очевидно, у меня нет прямого доступа к коду, так как VoiceFlow управляет им как черным ящиком.

Но кто-нибудь знает, как я могу это исправить?

...