class

Memo::Providers::Mock

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

Mock embedding provider for testing

Generates deterministic 8-dimensional vectors based on SHA256 hash. Does not make any external API calls.

Instance methods

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