haive.core.engine.embedding.providers.CohereEmbeddingConfigΒΆ

Cohere embedding configuration.

ClassesΒΆ

CohereEmbeddingConfig

Configuration for Cohere embeddings.

Module ContentsΒΆ

class haive.core.engine.embedding.providers.CohereEmbeddingConfig.CohereEmbeddingConfig[source]ΒΆ

Bases: haive.core.engine.embedding.base.BaseEmbeddingConfig

Configuration for Cohere embeddings.

This configuration provides access to Cohere’s embedding models including embed-english-v3.0, embed-multilingual-v3.0, and other specialized models.

Examples

Basic usage:

config = CohereEmbeddingConfig(
    name="cohere_embeddings",
    model="embed-english-v3.0",
    api_key="your-api-key"
)

embeddings = config.instantiate()

With custom input type:

config = CohereEmbeddingConfig(
    name="cohere_embeddings",
    model="embed-english-v3.0",
    input_type="search_document",
    api_key="your-api-key"
)

Using environment variables:

# Set COHERE_API_KEY environment variable
config = CohereEmbeddingConfig(
    name="cohere_embeddings",
    model="embed-english-v3.0"
)
embedding_typeΒΆ

Always EmbeddingType.COHERE

modelΒΆ

Cohere model name (e.g., β€œembed-english-v3.0”)

api_keyΒΆ

Cohere API key (auto-resolved from COHERE_API_KEY env var)

input_typeΒΆ

Input type for embeddings (search_document, search_query, etc.)

truncateΒΆ

How to handle inputs longer than max length

get_default_model()[source]ΒΆ

Get the default model for Cohere embeddings.

Return type:

str

get_input_types()[source]ΒΆ

Get list of supported input types.

Return type:

list[str]

get_model_info()[source]ΒΆ

Get information about the configured model.

Return type:

dict

get_supported_models()[source]ΒΆ

Get list of supported Cohere embedding models.

Return type:

list[str]

get_truncate_options()[source]ΒΆ

Get list of supported truncate options.

Return type:

list[str]

instantiate()[source]ΒΆ

Create a Cohere embeddings instance.

Returns:

CohereEmbeddings instance configured with the provided parameters

Raises:
Return type:

Any

classmethod validate_input_type(v)[source]ΒΆ

Validate input type.

Return type:

Any

classmethod validate_model(v)[source]ΒΆ

Validate the Cohere model name.

Return type:

Any

classmethod validate_truncate(v)[source]ΒΆ

Validate truncate parameter.

Return type:

Any