Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The dialogflow service allows using the Google Dialogflow platform within your application. Dialogflow is used to translate human speech into intents (intent recognition). In other words, not only does it (try to) convert an audio stream into readable text, it also processes this text into an intent (possibly with some additional parameters). For example, an audio stream can translate to the string "I am 15 years old", which is, in turn, converted to the intent 'answer_age' with the parameter 'age = 15'.

The service is available in multiple languages.

Docker name: dialogflow

Input

  • sensors: Microphone

  • actuators: None

  • services: stream_audio

  • parameters:

    • Dialogflow keyfile pathaudio: str

    • Dialogflow project ID: str

    • The parameters are set at BasicSICConnector instantiation time
      • value: the audio to be interpreted

      • type: bytestream

Service Configuration

The following steps will help you get the a keyfile and , project ID and select a language:

  1. Create a Dialogflow agent by clicking the following link: https://dialogflow.cloud.google.com/

  2. Use the ‘Create Agent' button at the left top to start your first project. Press the settings icon next to your agent's name at the left top to see the Project ID.

  3. Follow the steps here to retrieve your private key file in JSON format.

    • Note: the JSON file can be changed in the application at runtime using the BasicSICConnector's set_dialogflow_key(<path to keyfile>) method

  4. Choose a language for the agent from https://cloud.google.com/dialogflow/es/docs/reference/language

    • Note: the language can be changed in the application at runtime using the BasicSICConnector's set_dialogflow_voice(<voice ID>) method

Output

  • sensors: none

  • actuators: none

The output consists of a collection of information of the type dict:

Code Block
languagepy
{'intent': '[YOUR_INTENT]', 
'parameters': 
    {'[YOUR_PARAMETER]': '[PARAMETER_RESPONSE]'}, 
'confidence': [CONFIDENCE_VALUE], 
'text': '[RESPONSE_TEXT]', 
'source': 'audio'}

...