title: Malformed Response: Failed to parse Dialogflow response into AppResponse because of empty speech response
body: <p>I am using firebase function for the webhook fulfillment in Dialogflow. I am getting webhook successful as a <code>fulfillment status</code> but it is not working. I am using version 1. When I test it on Google Assistant simulator, it says "App is not responding".</p>
  
  <p><strong>firebase function</strong></p>
  
  <pre><code>const functions = require('firebase-functions');
  
  exports.webhook = functions.https.onRequest((request, response) =&gt; {
      response.send({
          "google":{
             "richResponse":{
                "items":[
                   {
                      "simpleResponse":{
                         "textToSpeech":"Hey! Good to see you."
                      }
                   },
                   {
                      "mediaResponse":{
                         "mediaType":"AUDIO",
                         "mediaObjects":[
                            {
                               "name":"Exercises",
                               "description":"ex",
                               "largeImage":{
                                  "url":"http://res.freestockphotos.biz/pictures/17/17903-balloons-pv.jpg",
                                  "accessibilityText":"..."
                               },
                               "contentUrl":"https://theislam360.me:8080/hbd.mp3"
                            }
                         ]
                      }
                   }
                ],
                "suggestions":[
                   {
                      "title":"chips"
                   }
                ]
             }
          }
        }
     )
  });`
  </code></pre>
  
  <p>When I copy paste the response from <code>{google...</code> to the end in the custom payload manually via GUI, It works. While for webhook, it is not working.</p>
  
  <p><strong>RAW API RESPONSE</strong></p>
  
  <pre><code> {
    "id": "eaf627ed-26b5-4965-b0b0-bc77144e144b",
    "timestamp": "2019-04-15T11:54:18.948Z",
    "lang": "en",
    "result": {
      "source": "agent",
      "resolvedQuery": "play hbd",
      "action": "",
      "actionIncomplete": false,
      "parameters": {
        "any": "hbd"
      },
      "contexts": [],
      "metadata": {
        "isFallbackIntent": "false",
        "webhookResponseTime": 34,
        "intentName": "play",
        "intentId": "e60071cd-ce31-4ef9-ae9b-cc370c3362b3",
        "webhookUsed": "true",
        "webhookForSlotFillingUsed": "false"
      },
      "fulfillment": {
        "messages": []
      },
      "score": 1
    },
    "status": {
      "code": 200,
      "errorType": "success"
    },
    "sessionId": "e91bd62f-766b-b19d-d37b-2917ac20caa6"
  }
  </code></pre>
  
  <p><strong>FULFILLMENT REQUEST</strong></p>
  
  <pre><code>{
    "id": "eaf627ed-26b5-4965-b0b0-bc77144e144b",
    "timestamp": "2019-04-15T11:54:18.948Z",
    "lang": "en",
    "result": {
      "source": "agent",
      "resolvedQuery": "play hbd",
      "speech": "",
      "action": "",
      "actionIncomplete": false,
      "parameters": {
        "any": "hbd"
      },
      "contexts": [],
      "metadata": {
        "intentId": "e60071cd-ce31-4ef9-ae9b-cc370c3362b3",
        "webhookUsed": "true",
        "webhookForSlotFillingUsed": "false",
        "isFallbackIntent": "false",
        "intentName": "play"
      },
      "fulfillment": {
        "speech": "",
        "messages": []
      },
      "score": 1
    },
    "status": {
      "code": 200,
      "errorType": "success"
    },
    "sessionId": "e91bd62f-766b-b19d-d37b-2917ac20caa6"
  }
  </code></pre>
  
  <p><strong>FULFILLMENT RESPONSE</strong></p>
  
  <pre><code>{
    "google": {
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "Hey! Good to see you."
            }
          },
          {
            "mediaResponse": {
              "mediaType": "AUDIO",
              "mediaObjects": [
                {
                  "name": "Exercises",
                  "description": "ex",
                  "largeImage": {
                    "url": "http://res.freestockphotos.biz/pictures/17/17903-balloons-pv.jpg",
                    "accessibilityText": "..."
                  },
                  "contentUrl": "https://theislam360.me:8080/hbd.mp3"
                }
              ]
            }
          }
        ],
        "suggestions": [
          {
            "title": "chips"
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p><strong>FULFILLMENT STATUS</strong></p>
  
  <pre><code>Webhook execution successful
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6nmTc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6nmTc.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Firebase Logs</strong>
  <a href="https://i.stack.imgur.com/q1zkA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q1zkA.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Google Assistant Simulator Logs</strong>
  <a href="https://i.stack.imgur.com/S4iBE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S4iBE.jpg" alt="enter image description here"></a></p>