platypush.plugins.assistant.google.pushtotalk

class platypush.plugins.assistant.google.pushtotalk.AssistantGooglePushtotalkPlugin(credentials_file='/home/blacklight/.config/google-oauthlib-tool/credentials.json', device_config='/home/blacklight/.config/googlesamples-assistant/device_config.json', language='en-US', play_response=True, tts_plugin=None, tts_args=None, **kwargs)[source]

Plugin for the Google Assistant push-to-talk API.

Triggers:

Requires:

  • tenacity (pip install tenacity)

  • google-assistant-sdk (pip install google-assistant-sdk[samples])

__init__(credentials_file='/home/blacklight/.config/google-oauthlib-tool/credentials.json', device_config='/home/blacklight/.config/googlesamples-assistant/device_config.json', language='en-US', play_response=True, tts_plugin=None, tts_args=None, **kwargs)[source]
Parameters
on_conversation_end()[source]

Conversation end handler

on_conversation_start()[source]

Conversation start handler

on_response()[source]

Response handler

on_speech_recognized()[source]

Speech recognized handler

on_volume_changed()[source]

Volume changed event

set_mic_mute(muted: bool = True)[source]

Programmatically mute/unmute the microphone.

Parameters

muted – Set to True or False.

start_conversation(*args, language: Optional[str] = None, tts_plugin: Optional[str] = None, tts_args: Optional[Dict[str, Any]] = None, **kwargs)[source]

Start a conversation

Parameters
  • language – Language code override (default: default configured language).

  • tts_plugin – Optional text-to-speech plugin to be used for rendering text.

  • tts_args – Optional arguments for the TTS plugin say method.

Returns

A list of the interactions that happen within the conversation.

[
    {
        "request": "request 1",
        "response": "response 1"
    },
    {
        "request": "request 2",
        "response": "response 2"
    }
]

stop_conversation()[source]

Stop a conversation.