class

Memo::Providers::Voyage

Inherits Memo::Providers::Base < Reference < Object

Voyage AI embedding provider

Generates embeddings using Voyage AI's embeddings API. Supports voyage-3, voyage-3-lite, voyage-code-3, and domain-specific models.

Constants

DEFAULT_BASE_URL = "https://api.voyageai.com/v1"

Constructors

new(api_key : String, model : String = "voyage-3", base_url : String = DEFAULT_BASE_URL)
Source

Instance methods

api_key
Source
base_url
Source
embed_text(text : String, input_type : String | Nil = nil) : Tuple(Array(Float64), Int32)

Embed a single text

Returns tuple of (embedding vector, token count) input_type: "query" or "document" (used by Voyage AI for optimized embeddings)

Source
embed_texts(texts : Array(String), input_type : String | Nil = nil) : EmbedResult

Embed multiple texts in a batch

Returns EmbedResult with embeddings and token counts input_type: "query" or "document" (used by Voyage AI for optimized embeddings)

Source
model
Source