struct

Arcana::AI::Embed::Result

Inherits Struct < Value < Object

Constructors

new(embeddings : Array(Array(Float64)), token_counts : Array(Int32) = [] of Int32, model : String = "", provider : String = "", raw_request : String = "", raw_response : String = "", usage : Usage | Nil = nil)
Source

Instance methods

cost(at : Time = Time.utc, table : Pricing::Table = Pricing::Table.default) : Pricing::Cost | Pricing::Unpriced

What this call cost; see Pricing. at is when it was made.

Source
dimensions
Source
embedding

Convenience accessor for single-text embeddings.

Source
embeddings
Source
embeddings=(embeddings : Array(Array(Float64)))
Source
model
Source
model=(model : String)
Source
provider
Source
provider=(provider : String)
Source
raw_request
Source
raw_request=(raw_request : String)
Source
raw_response
Source
raw_response=(raw_response : String)
Source
retries

Retries embed_with_retry needed, and the time spent waiting.

Source
retries=(retries : Int32)

Retries embed_with_retry needed, and the time spent waiting.

Source
retry_wait
Source
retry_wait=(retry_wait : Time::Span)
Source
token_counts
Source
token_counts=(token_counts : Array(Int32))
Source
usage

The tokens the provider billed, as a Usage (all input); nil when it reported none. Pricing prices it.

Source
usage=(usage : Usage | Nil)

The tokens the provider billed, as a Usage (all input); nil when it reported none. Pricing prices it.

Source