WeaviateEx.API.Vectorizers.Text2VecCohere (WeaviateEx v0.7.4)

View Source

Text2Vec-Cohere vectorizer configuration.

Uses Cohere's embedding models for text vectorization.

Example

# Basic usage with model
Text2VecCohere.new(model: "embed-english-v3.0")

# With dimensions and truncation
Text2VecCohere.new(
  model: "embed-multilingual-v3.0",
  dimensions: 512,
  truncate: :end
)

# Full configuration
Text2VecCohere.new(
  model: "embed-english-v3.0",
  dimensions: 384,
  truncate: :end,
  base_url: "https://api.cohere.ai",
  vectorize_collection_name: false
)

Summary

Functions

Parse configuration from API response.

Create a new Text2Vec-Cohere configuration.

Convert configuration to API format.

Returns the vectorizer name for the API.

Types

t()

@type t() :: %WeaviateEx.API.Vectorizers.Text2VecCohere{
  base_url: String.t() | nil,
  dimensions: pos_integer() | nil,
  model: String.t() | nil,
  truncate: truncate_mode() | nil,
  vectorize_collection_name: boolean()
}

truncate_mode()

@type truncate_mode() :: :none | :start | :end

Functions

from_api(map)

@spec from_api(map()) :: t()

Parse configuration from API response.

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new Text2Vec-Cohere configuration.

Options

  • :model - Cohere model name (e.g., "embed-english-v3.0", "embed-multilingual-v3.0")
  • :dimensions - Output dimensions
  • :truncate - Truncation mode: :none, :start, or :end
  • :base_url - Custom Cohere API endpoint
  • :vectorize_collection_name - Include collection name in vectorization (default: true)

to_api(config)

@spec to_api(t()) :: map()

Convert configuration to API format.

vectorizer_name()

@spec vectorizer_name() :: String.t()

Returns the vectorizer name for the API.