airflow.providers.google.cloud.hooks.speech_to_text

此模块包含一个 Google Cloud Speech Hook。

CloudSpeechToTextHook

Google Cloud Speech API 的 Hook。

模块内容

class airflow.providers.google.cloud.hooks.speech_to_text.CloudSpeechToTextHook(gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[源码]

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

Google Cloud Speech API 的 Hook。

参数:
  • 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()[源码]

检索 Cloud Speech 的连接。

返回:

Google Cloud Speech 客户端对象。

返回类型:

google.cloud.speech_v1.SpeechClient

recognize_speech(config, audio, retry=DEFAULT, timeout=None)[源码]

识别音频输入。

参数:

此条目是否有帮助?