airflow.providers.google.cloud.hooks.text_to_speech

此模組包含一個 Google Cloud Text to Speech Hook。

CloudTextToSpeechHook

Google Cloud Text to Speech API 的 Hook。

模組內容

class airflow.providers.google.cloud.hooks.text_to_speech.CloudTextToSpeechHook(gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

基類: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Google Cloud Text to Speech API 的 Hook。

Hook 中所有使用 project_id 的方法都必須使用關鍵字引數呼叫,而非位置引數。

引數
  • gcp_conn_id (str) – 獲取連線資訊時使用的連線 ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可選的服務賬號,用於使用短期憑證進行模擬,或獲取列表中最後一個賬號的 access_token 所需的賬號鏈,該賬號將在請求中被模擬。如果設定為字串,該賬號必須授予發起賬號 Service Account Token Creator IAM 角色。如果設定為序列,列表中的身份必須授予直接前一個身份 Service Account Token Creator IAM 角色,列表中第一個賬號授予發起賬號此角色。

get_conn()[source]

檢索與 Cloud Text to Speech 的連線。

返回

Google Cloud Text to Speech 客戶端物件。

返回型別

google.cloud.texttospeech_v1.TextToSpeechClient

synthesize_speech(input_data, voice, audio_config, retry=DEFAULT, timeout=None)[source]

合成文字輸入。

引數
返回

SynthesizeSpeechResponse 詳情見: https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.SynthesizeSpeechResponse

返回型別

google.cloud.texttospeech_v1.types.SynthesizeSpeechResponse

此條目是否有幫助?