airflow.providers.cohere.operators.embedding

模組內容

類別

CohereEmbeddingOperator

透過與 Cohere 託管服務互動來建立嵌入基礎。

class airflow.providers.cohere.operators.embedding.CohereEmbeddingOperator(input_text, conn_id=CohereHook.default_conn_name, timeout=None, max_retries=None, **kwargs)[原始碼]

基底類別: airflow.models.BaseOperator

透過與 Cohere 託管服務互動來建立嵌入基礎。

另請參閱

如需更多關於如何使用此運算子的資訊,請參閱指南: CohereEmbeddingOperator

參數
  • input_text (list[str] | str) – 需要嵌入的單一字串文字或文字項目清單。

  • conn_id (str) – 選擇性。用於取得 Cohere 連線資訊的 Airflow 連線名稱。預設為 “cohere_default”。

  • timeout (int | None) – Cohere API 的逾時時間,單位為秒。

  • max_retries (int | None) – 在失敗前重試的次數。

template_fields: collections.abc.Sequence[str] = ('input_text',)[原始碼]
hook()[原始碼]

傳回 CohereHook 的實例。

execute(context)[原始碼]

使用 Cohere 嵌入服務嵌入文字。

這篇文章對您有幫助嗎?