...
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
Audio input can also be provided in the form of an audio file
the audio input sent to the Google API has to be a bytestream
the audio length for one request can be maximum 1 minute, as per https://cloud.google.com/dialogflow/quotas#es-agent_2
actuators: None
services:
stream_audio
parameters:
Dialogflow keyfile pathaudio:
str
Dialogflow project ID:
str
- The parameters are set at
BasicSICConnector
instantiation timevalue: 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:
Create a Dialogflow agent by clicking the following link: https://dialogflow.cloud.google.com/
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.
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
'sset_dialogflow_key(<path to keyfile>)
method
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
'sset_dialogflow_voice(<voice ID>)
method
Output
sensors: none
actuators: none
The output consists of a collection of information of the type dict
:
Code Block | ||
---|---|---|
| ||
{'intent': '[YOUR_INTENT]', 'parameters': {'[YOUR_PARAMETER]': '[PARAMETER_RESPONSE]'}, 'confidence': [CONFIDENCE_VALUE], 'text': '[RESPONSE_TEXT]', 'source': 'audio'} |
...