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)[原始碼]

基底: 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 的鏈式帳戶列表,該帳戶將在請求中被模擬。如果設定為字串,則帳戶必須授予原始帳戶「服務帳戶權杖建立者」IAM 角色。如果設定為序列,則列表中的身分必須將「服務帳戶權杖建立者」IAM 角色授予緊鄰的前一個身分,列表中的第一個帳戶將此角色授予原始帳戶。

get_conn()[原始碼]

檢索到 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)[原始碼]

合成文字輸入。

參數
返回

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

這個條目有幫助嗎?