airflow.providers.cohere.operators.embedding

Module Contents

Classes

CohereEmbeddingOperator

Creates the embedding base by interacting with cohere hosted services.

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

Bases: airflow.models.BaseOperator

Creates the embedding base by interacting with cohere hosted services.

See also

For more information on how to use this operator, take a look at the guide: CohereEmbeddingOperator

Parameters
  • input_text (list[str] | str) – single string text or list of text items that need to be embedded.

  • conn_id (str) – Optional. The name of the Airflow connection to get connection information for Cohere. Defaults to “cohere_default”.

  • timeout (int | None) – Timeout in seconds for Cohere API.

  • max_retries (int | None) – Number of times to retry before failing.

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

Return an instance of the CohereHook.

execute(context)[source]

Embed texts using Cohere embed services.

Was this entry helpful?