haive.core.engine.embedding.providers.CohereEmbeddingConfigΒΆ
Cohere embedding configuration.
ClassesΒΆ
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
- instantiate()[source]ΒΆ
Create a Cohere embeddings instance.
- Returns:
CohereEmbeddings instance configured with the provided parameters
- Raises:
ImportError β If langchain-cohere is not installed
ValueError β If configuration is invalid
- Return type:
Any