Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only textToSpeech in response from Dialogflow #48

Open
BBland1999 opened this issue Jun 11, 2020 · 6 comments
Open

Only textToSpeech in response from Dialogflow #48

BBland1999 opened this issue Jun 11, 2020 · 6 comments

Comments

@BBland1999
Copy link

I having an issue where only textToSpeech responses seem to work properly. I'm trying to test that the correct suggestions appear but only the textToSpeech array does. When I test it with the google actions console, I can see that the suggestion chips are appearing. I have tried it with a card as well and had the same results.

test.js:

'use strict';
const chai = require('chai');
const winston = require('winston');
var expect = chai.expect;

winston.loggers.add('DEFAULT_LOGGER', {
    console:{
        level: 'error',
        colorize: true,
        label: 'Default logger',
        json: true,
        timestamp: true
    }
});


const { ActionsOnGoogleAva } = require('actions-on-google-testing');
const action = new ActionsOnGoogleAva(require('./test-credentials.json'));

action.startTest('NAME OF THE TEST', action => {
    return action.start('my test app')
        .then(res => {
            return action.send('lmao');
        })
        .then(res => {
            console.log("\n----------\n");
            console.log(res);
            console.log("\n----------\n");
        });        
});

test.js output:

(node:10552) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
(Use `node --trace-deprecation ...` to show where the warning was created)
| ** Starting test NAME OF THE TEST **
/ > Talk to my test app my test app
/ {
  micOpen: false,
  textToSpeech: [
    'Getting the test version of my test app.\n' +
      'Good day! What can I do for you today?'
  ],
  displayText: [],
  ssml: [],
  suggestions: []
}
- > lmao
| {
  micOpen: false,
  textToSpeech: [ 'These are suggestion chips' ],
  displayText: [],
  ssml: [],
  suggestions: []
}
/
----------

{
  micOpen: false,
  textToSpeech: [ 'These are suggestion chips' ],
  displayText: [],
  ssml: [],
  suggestions: []
}

----------

test passes
> cancel
\ {
  micOpen: false,
  textToSpeech: [],
  displayText: [],
  ssml: [],
  suggestions: []
}
test ends
/ NAME OF THE TEST


  1 test passed

raw response from actions console test:

{
  "conversationToken": "[]",
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "inputPrompt": {
        "richInitialPrompt": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "These are suggestion chips"
              }
            }
          ],
          "suggestions": [
            {
              "title": "suggest 1"
            },
            {
              "title": "suggest 2"
            },
            {
              "title": "suggest 3"
            }
          ]
        }
      },
      "possibleIntents": [
        {
          "intent": "assistant.intent.action.TEXT"
        }
      ]
    }
  ],
  "responseMetadata": {
    "status": {
      "message": "Success (200)"
    },
    "queryMatchInfo": {
      "queryMatched": true,
      "intent": "5e3602df-efba-4ac8-b6c2-1962e678c745"
    }
  }
}
@Fleker
Copy link
Member

Fleker commented Jun 11, 2020

Can you disable and re-enable testing in the console?

@BBland1999
Copy link
Author

BBland1999 commented Jun 11, 2020

Can you disable and re-enable testing in the console?

I just did (in the actions console) and am seeing the same results.

@codeforequity-at
Copy link
Contributor

I have the same problem. When going deeper into this and doing some debugging I found out that the debug_info field in the response received from the AssistRequest is always null - although this actually should contain the suggestion chips, cards etc.

In the Logs Viewer I can see the request, and Dialogflow returns everything I expected - it just isn't part of the AssistResponse.

@Fleker any idea whats wrong here ?

Received response from agent with body: HTTP/1.1 200 OK Server: nginx/1.13.6 Date: Thu, 20 Aug 2020 12:14:52 GMT Content-Type: application/json; charset=utf-8 X-Content-Type-Options: nosniff google-actions-api-version: 2 Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: Mon, 01 Jan 1990 00:00:00 GMT P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info." Content-Security-Policy: script-src 'report-sample' 'nonce-xfl/xTl7c2AWJqq0DeyH4w' 'unsafe-inline';object-src 'none';base-uri 'self';report-uri /_/DialogflowRuntimeAogHttp/cspreport;worker-src 'self' Content-Encoding: gzip X-XSS-Protection: 0 X-Frame-Options: SAMEORIGIN Set-Cookie: NID=204=aaaa expires=Fri, 19-Feb-2021 12:14:52 GMT; path=/; domain=.google.com; HttpOnly Via: 1.1 google Alt-Svc: clear Transfer-Encoding: chunked { "conversationToken": "[]", "expectUserResponse": true, "expectedInputs": [{ "inputPrompt": { "richInitialPrompt": { "items": [{ "simpleResponse": { "textToSpeech": "Default response of send buttons" } }, { "simpleResponse": { "textToSpeech": "suggestions:" } }], "suggestions": [{ "title": "Item1" }, { "title": "Item2" }, { "title": "Item3" }] } }, "possibleIntents": [{ "intent": "assistant.intent.action.TEXT" }] }], "responseMetadata": { "status": { "message": "Success (200)" }, "queryMatchInfo": { "queryMatched": true, "intent": "89404df9-1732-4016-8530-e1789008bbe6" } } }

@pglejzer
Copy link

pglejzer commented Mar 19, 2021

Any fix on this problem? @Fleker @yoichiro

@Fleker
Copy link
Member

Fleker commented Mar 22, 2021

Is your action built using Dialogflow or Actions Builder? If the latter, you should use the Assistant Conversation testing lib.

@pglejzer
Copy link

I have many projects on Dialogflow and actions builder and I'm trying to use these libraries depends what I need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants