struct

Arcana::AI::Image::Result

Inherits Struct < Value < Object

Constructors

new(output_path : String, model : String, provider : String, cost : Float64, raw_request : String = "", raw_response : String = "", usage : Usage | Nil = nil)

DEPRECATED Pass a Pricing::Cost: Pricing::Cost.reported(provider, model, usd, "image"). Removed in arcana-ai 0.6.0.

Source
new(output_path : String, model : String, provider : String, cost : Pricing::Cost | Nil = nil, raw_request : String = "", raw_response : String = "", usage : Usage | Nil = nil)
Source

Instance methods

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

What this call cost; see Pricing. at is when it was made. The provider's own figure when it reported one, otherwise its usage at the table's rates.

In arcana-ai 0.6.0 at gets a default, as for chat and embeddings, and plain cost means this.

Source
cost

DEPRECATED Use cost(at) (at: when the call was made), a Pricing::Cost or Pricing::Unpriced as for chat and embeddings; it prices OpenAI images too. In arcana-ai 0.6.0 plain #cost returns that.

Source
cost=(usd : Float64 | Nil)

DEPRECATED Set #reported_cost. Removed in arcana-ai 0.6.0.

Source
model
Source
model=(model : String)
Source
output_path
Source
output_path=(output_path : 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
reported_cost

What the provider said the call cost, when it says so itself (Runware, or a service that prices its own work); nil otherwise.

Source
reported_cost=(reported_cost : Pricing::Cost | Nil)

What the provider said the call cost, when it says so itself (Runware, or a service that prices its own work); nil otherwise.

Source
usage

What the call used, when the provider reports it in tokens (OpenAI); nil when it didn't. cost prices it.

Source
usage=(usage : Usage | Nil)

What the call used, when the provider reports it in tokens (OpenAI); nil when it didn't. cost prices it.

Source