(create-media styles)(create-media styles opts)§7G createMedia. styles is one style or a seq of styles (maps, string- or
keyword-keyed); a verb resolves to the FIRST style that declares it.
opts:
:on-progress (fn [{:verb :jobId :status}]) — after every poll
:http-client (fn [{:method :url :headers :body}]) -> {:status :body} — the
transport seam (default koine.http/request). Unlike the LLM
client's POST-only (url headers body) seam this one carries a
method, because the poll is a GET.
:env (fn [name]) -> value — ${VAR} lookup for header values
(default koine.env/get-env).
§7G `createMedia`. `styles` is one style or a seq of styles (maps, string- or
keyword-keyed); a verb resolves to the FIRST style that declares it.
opts:
:on-progress (fn [{:verb :jobId :status}]) — after every poll
:http-client (fn [{:method :url :headers :body}]) -> {:status :body} — the
transport seam (default koine.http/request). Unlike the LLM
client's POST-only (url headers body) seam this one carries a
method, because the poll is a GET.
:env (fn [name]) -> value — `${VAR}` lookup for header values
(default koine.env/get-env).(generate media verb args)(generate media verb args {:keys [provider-options cancel]})§7G engine — the generic function face. verb is the canonical verb name
("image" … "cloneVoice", string or keyword). args maps normalised arg
names (keyword or string) to values. opts: :provider-options (map; its
top-level keys overwrite the body last), :cancel (an atom or 0-arg fn —
truthy ⇒ cancelled). Returns MediaResult {:files [..] :text? :jobId? :status};
throws ex-info with the §7G message on any failure.
§7G engine — the generic function face. `verb` is the canonical verb name
("image" … "cloneVoice", string or keyword). `args` maps normalised arg
names (keyword or string) to values. opts: `:provider-options` (map; its
top-level keys overwrite the body last), `:cancel` (an atom or 0-arg fn —
truthy ⇒ cancelled). Returns MediaResult `{:files [..] :text? :jobId? :status}`;
throws ex-info with the §7G message on any failure.(load-style path)Read one style JSON file (§7G loadMediaStyle).
Read one style JSON file (§7G `loadMediaStyle`).
(media? x)True for a value built by create-media.
True for a value built by `create-media`.
(percent-encode s)RFC 3986: keep A-Z a-z 0-9 - . _ ~, every other UTF-8 byte as %XX.
RFC 3986: keep A-Z a-z 0-9 - . _ ~, every other UTF-8 byte as %XX.
(read-path v path)§7G dotPath read: missing ⇒ nil. A segment of only digits indexes an array. The empty path "" is the whole value.
§7G dotPath read: missing ⇒ nil. A segment of only digits indexes an array. The empty path "" is the whole value.
(tools media)§7G — one Tool (source "media") per verb the media supports, in verbs.json order. Execute never throws: an engine error is an isError ToolResult.
§7G — one Tool (source "media") per verb the media supports, in verbs.json order. Execute never throws: an engine error is an isError ToolResult.
conformance/media/verbs.json verbs, embedded verbatim (order, names, types,
descriptions, required). A test reads the fixture and asserts equality.
conformance/media/verbs.json `verbs`, embedded verbatim (order, names, types, descriptions, required). A test reads the fixture and asserts equality.
(write-path v path value)§7G dotPath write: creates objects, and arrays when the next segment is numeric (padding with nil). A scalar — or an array met by a non-numeric segment — on the path is replaced; an object met by a numeric segment is kept and the segment is written as a string key.
§7G dotPath write: creates objects, and arrays when the next segment is numeric (padding with nil). A scalar — or an array met by a non-numeric segment — on the path is replaced; an object met by a numeric segment is kept and the segment is written as a string key.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |