airflow.gcp.hooks.speech_to_text

This module contains a Google Cloud Speech Hook.

Module Contents

class airflow.gcp.hooks.speech_to_text.GCPSpeechToTextHook(gcp_conn_id:str='google_cloud_default', delegate_to:str=None)[source]

Bases: airflow.contrib.hooks.gcp_api_base_hook.GoogleCloudBaseHook

Hook for Google Cloud Speech API.

Parameters
  • gcp_conn_id (str) – The connection ID to use when fetching connection info.

  • delegate_to (str) – The account to impersonate, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

get_conn(self)[source]

Retrieves connection to Cloud Speech.

Returns

Google Cloud Speech client object.

Return type

google.cloud.speech_v1.SpeechClient

recognize_speech(self, config:Union[Dict, RecognitionConfig], audio:Union[Dict, RecognitionAudio], retry:Retry=None, timeout:float=None)[source]

Recognizes audio input

Parameters