struct

DataDungeon::Recipe

Inherits JSON::Serializable < Struct < Value < Object

How an asset was made, in the shape every app shares (DESIGN-recipes.md): its form, the settings it was made with, what its provider was sent (the prompt, and for speech and text the instructions beside it), the named wordings that went into that, and what's its own (seed, cost, when, the files it was made from). An asset made in steps has a recipe per step (steps).

Constants

FORMS = ["picture", "speech", "text"] of ::String

What a recipe makes; empty for a step without a prompt (a matte, a depth map) or for a recipe made of steps.

VERSION_SIZE = 10

A wording's version is this many hex characters of its words' SHA-256 (40 bits), so it names the same words in every store.

Constructors

in_steps(steps : Array(Recipe)) : Recipe

A recipe made of steps, each a recipe of its own, in order.

Source
new(form : String, settings : Hash = {} of String => JSON::Any, prompt : String | Nil = nil, instructions : String | Nil = nil, wordings : Array(Wording) = [] of Wording, seed : Int | Nil = nil, cost : Number | Nil = nil, cost_basis : String | Nil = nil, generated_at : Time | Nil = nil, references : Array(String) = [] of String, steps : Array(Recipe) = [] of Recipe)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

version(text : String) : String

The version of these words: the start of their SHA-256, in hex.

Source
version?(version : String) : Bool

Whether this is written as a version is.

Source
wording(kind : String, name : String, text : String) : Wording

A named wording of some kind, owner:name.

Source

Instance methods

check

Raises ArgumentError for a recipe that isn't in the standard shape: among others, a wording whose words aren't in what was sent, word for word.

Source
cost

In US dollars.

Source
cost_basis

How the cost was reached: the service's own bill (reported: runware), priced from a rate table (priced: arcana-ai 0.5.2), or estimated.

Source
form
Source
generated_at
Source
instructions

The provider's second input, beside the prompt: a voice's instructions, a text step's instructions. A picture has none.

Source
prompt

What the provider was sent: a picture's prompt, the words a speech step speaks, a text step's input.

Source
references

The files it was made from, by hash.

Source
seed
Source
settings
Source
steps
Source
wordings

The named wordings that went into the prompt and instructions, each word for word.

Source

Nested types