assistant.google.pushtotalk#

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

Bases: AssistantPlugin

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

Triggers:

Requires:

  • tenacity (pip install tenacity)

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

  • google-auth (pip install google-auth)

__init__(credentials_file='/root/.config/google-oauthlib-tool/credentials.json', device_config='/root/.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(*_, language: str | None = None, tts_plugin: str | None = None, tts_args: Dict[str, Any] | None = None, **__)[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.