airflow.providers.cohere.hooks.cohere

属性

logger

CohereHook

使用 Cohere Python SDK 通过 API v2 与 Cohere 平台交互。

模块内容

airflow.providers.cohere.hooks.cohere.logger[源码]
class airflow.providers.cohere.hooks.cohere.CohereHook(conn_id=default_conn_name, timeout=None, max_retries=None, request_options=None)[源码]

基类: airflow.hooks.base.BaseHook

使用 Cohere Python SDK 通过 API v2 与 Cohere 平台交互。

参数:
  • conn_id (str) – Cohere 连接 ID

  • timeout (int | None) – 请求超时(秒)。可选。

  • max_retries (int | None) – 请求的最大重试次数。已弃用,请改用 request_options。可选。

  • request_options (cohere.core.request_options.RequestOptions | None) – 用于函数特定请求配置的字典。可选。

conn_name_attr = 'conn_id'[源码]
default_conn_name = 'cohere_default'[源码]
conn_type = 'cohere'[源码]
hook_name = 'Cohere'[源码]
conn_id = 'cohere_default'[源码]
timeout = None[源码]
max_retries = None[源码]
request_options = None[源码]
property get_conn: cohere.ClientV2[源码]

返回 Hook 的连接。

create_embeddings(texts, model='embed-multilingual-v3.0')[源码]
classmethod get_ui_field_behaviour()[源码]
test_connection(model='command-r-plus-08-2024', messages=None)[源码]

此条目是否有帮助?