Search code examples
phpactions-on-googlegoogle-home

How to invoke my application on google home simulator without dialog flow integration?


I want to invoke my application from google home simulator but without integration of dialogflow is that possible? i provided fulfillment url in Actions Console but it does not invoke my app and shows me an error.

You cannot use standard Google Assistant features in the Simulator. If you want to try them, use Google Assistant on your phone or other compatible devices.

below is my php code.

sendMessage(array(
  'expectUserResponse' => true,
  'expectedInputs' =>
  array (
    0 =>
    array (
      'inputPrompt' =>
      array (
        'richInitialPrompt' =>
        array (
          'items' =>
          array (
            0 =>
            array (
              'simpleResponse' =>
              array (
                'textToSpeech' => 'Hi!',
              ),
            ),
          ),
        ),
      ),
      'possibleIntents' =>
      array (
        0 =>
        array (
          'intent' => 'actions.intent.TEXT',
        ),
      ),
    ),
  ),
  'conversationToken' => '{"data":{}}',
  'userStorage' => '{"data":{}}',
));

Solution

  • You can use actions on google without any integrations with Dialogflow using the actionsSDK, but without Dialogflow you dont have a service which analyzes your users input and breaksdown intents and entities. So if you want to remove Dialogflow from your setup you will have to use a different service which takes the input from your user and analyzes it.

    Using the actions SDK, you can provide a webhook URL using the gactions CLI and here you will have to write code which sends the input to the NLP and returns an intent. Then you can use that info to do the logic that you need to create a response for the user.

    I personally haven't tried mocking the requests and tried to invoke my action with messages, but if you want a normal assistant, but without Dialogflow. That is how you can do it.