class
Memo::Providers::Bus
- Memo::Providers::Bus
- Reference
- Object
Overview
Bus-based embedding provider.
Routes embedding requests through the Arcana bus to a remote
embedding service (e.g. openai:embed, voyage:embed).
Requires an Arcana::Client to be available — typically set once
at process startup via Memo::Providers::Bus.client = ....
Bus responses don't include per-text token counts, only total_tokens.
We distribute the total evenly across texts (same approach as
Memo::Providers::OpenAI when the API doesn't itemize).
Included Modules
Defined in:
memo/providers/bus.crConstant Summary
-
DEFAULT_TIMEOUT =
60.seconds
Constructors
Class Method Summary
-
.client : ::Arcana::Client | Nil
Process-wide Arcana::Client used by all Bus providers.
-
.client=(client : ::Arcana::Client | Nil)
Process-wide Arcana::Client used by all Bus providers.
Instance Method Summary
-
#embed_text(text : String, input_type : String | Nil = nil) : Tuple(Array(Float64), Int32)
Embed a single text
-
#embed_texts(texts : Array(String), input_type : String | Nil = nil) : EmbedResult
Embed multiple texts in a batch
- #from_address : String
- #model : String
- #target : String
Instance methods inherited from module Memo::Providers::Base
embed_text(text : String, input_type : String | Nil = nil) : Tuple(Array(Float64), Int32)
embed_text,
embed_texts(texts : Array(String), input_type : String | Nil = nil) : EmbedResult
embed_texts
Constructor Detail
Class Method Detail
Process-wide Arcana::Client used by all Bus providers. Set once at process startup (e.g. in bin/memo-arcana.cr).
Process-wide Arcana::Client used by all Bus providers. Set once at process startup (e.g. in bin/memo-arcana.cr).
Instance Method Detail
Embed a single text
Returns tuple of (embedding vector, token count) input_type: "query" or "document" (used by Voyage AI for optimized embeddings)
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)