Liking cljdoc? Tell your friends :D

toolnexus.media


a2e-media-clientclj/s

(a2e-media-client)
(a2e-media-client config)

A2EMediaClient (a2e): the embedded a2e.json style (§7G.9). :key or A2E_API_KEY at call time; :url replaces baseUrl; :model is written to the image body's model_type; gather defaults to download.

A2EMediaClient (`a2e`): the embedded a2e.json style (§7G.9). :key or
A2E_API_KEY at call time; :url replaces baseUrl; :model is written to the
image body's model_type; gather defaults to download.
sourceraw docstring

a2e-style-jsonclj/s

examples/media-styles/a2e.json, byte for byte (a test asserts the copy). A string literal rather than a resource: it is the one shipping form that both hosts (JVM classpath, cljgo AOT) read identically.

examples/media-styles/a2e.json, byte for byte (a test asserts the copy). A
string literal rather than a resource: it is the one shipping form that both
hosts (JVM classpath, cljgo AOT) read identically.
sourceraw docstring

availableclj/s

(available style)

§7G.10b style.available() on a loaded style -> {:installed :loggedIn :reason}, fast, generating nothing and reading no secret. CLI preset: the command (config :command first element, else the CLI name) is found, and the CLI's own login file EXISTS (never read). Mock preset: always available unless TOOLNEXUS_MEDIA_MOCK_AVAILABLE=0. HTTP style: config :key, or every ${VAR} in its headers set. Env is read through config :env when given.

§7G.10b `style.available()` on a loaded style -> {:installed :loggedIn :reason},
fast, generating nothing and reading no secret. CLI preset: the command
(config :command first element, else the CLI name) is found, and the CLI's own
login file EXISTS (never read). Mock preset: always available unless
TOOLNEXUS_MEDIA_MOCK_AVAILABLE=0. HTTP style: config :key, or every ${VAR}
in its headers set. Env is read through config :env when given.
sourceraw docstring

cli-media-clientclj/s

(cli-media-client spec config)

CliMediaClient (§7G.10): run a local CLI once, headless, read its JSON-lines stdout, collect files, kill on cancel/timeout. spec: :name client name :verbs #{"image" …} :default-command executable when config :command is absent :argv (fn [{:keys [prompt cwd model]}]) -> [arg …] :env fixed child env {name value} :templates {verb "… {prompt} …"} :parse (fn [obj line]) -> {:session :text :paths :error :status} :folder optional (fn [config session]) -> dir to scan :unavailable (fn [verb error]) -> message when unavailable, else nil :mock true => never spawn; return a fixed file (§7G CLI mock presets) CLI clients accept prompt plus size hints (image: width, height, aspectRatio; video: seconds, aspectRatio), folded into the prompt by fold-media-prompt.

CliMediaClient (§7G.10): run a local CLI once, headless, read its JSON-lines
stdout, collect files, kill on cancel/timeout. `spec`:
  :name             client name
  :verbs            #{"image" …}
  :default-command  executable when config :command is absent
  :argv             (fn [{:keys [prompt cwd model]}]) -> [arg …]
  :env              fixed child env {name value}
  :templates        {verb "… {prompt} …"}
  :parse            (fn [obj line]) -> {:session :text :paths :error :status}
  :folder           optional (fn [config session]) -> dir to scan
  :unavailable      (fn [verb error]) -> message when unavailable, else nil
  :mock             true => never spawn; return a fixed file (§7G CLI mock presets)
CLI clients accept prompt plus size hints (image: width, height,
aspectRatio; video: seconds, aspectRatio), folded into the prompt by
`fold-media-prompt`.
sourceraw docstring

clone-voiceclj/s

(clone-voice m args)
(clone-voice m args ctx)
source

codex-media-clientclj/s

(codex-media-client)
(codex-media-client config)

CodexMediaClient (codex): image through codex exec --json on the user's ChatGPT plan. The file comes from the reply text or $CODEX_HOME/generated_images/<thread> (§7G.10).

CodexMediaClient (`codex`): image through `codex exec --json` on the user's
ChatGPT plan. The file comes from the reply text or
$CODEX_HOME/generated_images/<thread> (§7G.10).
sourceraw docstring

create-mediaclj/s

(create-media clients)

§7G.3 createMedia: one MediaClient or a seq of them. Each verb goes to the first client that supports it; an unavailable error falls through to the next. (create-media []) throws media: no clients.

§7G.3 `createMedia`: one MediaClient or a seq of them. Each verb goes to the
first client that supports it; an `unavailable` error falls through to the
next. `(create-media [])` throws `media: no clients`.
sourceraw docstring

elevenlabs-media-clientclj/s

(elevenlabs-media-client)
(elevenlabs-media-client config)

ElevenLabsMediaClient (elevenlabs): speech, music, transcribe, cloneVoice (§7G.9). Key ELEVENLABS_API_KEY, header xi-api-key.

ElevenLabsMediaClient (`elevenlabs`): speech, music, transcribe, cloneVoice
(§7G.9). Key ELEVENLABS_API_KEY, header xi-api-key.
sourceraw docstring

fal-media-clientclj/s

(fal-media-client)
(fal-media-client config)

FalMediaClient (fal): any hosted model id over fal's queue API (§7G.9). Key FAL_API_KEY, header Authorization: Key <key>.

FalMediaClient (`fal`): any hosted model id over fal's queue API (§7G.9).
Key FAL_API_KEY, header `Authorization: Key <key>`.
sourceraw docstring

fold-media-promptclj/s

(fold-media-prompt verb args)

§7G CLI hint folding: the prompt a CLI style receives — prompt, then the present size hints in canonical verb order as " (h1, h2)"; nothing appended when none is present. args keys may be keywords or strings.

§7G CLI hint folding: the prompt a CLI style receives — `prompt`, then the
present size hints in canonical verb order as " (h1, h2)"; nothing appended
when none is present. `args` keys may be keywords or strings.
sourceraw docstring

generateclj/s

(generate media verb args)
(generate media verb args ctx)

§7G.3 — the generic function face. verb is the canonical verb name ("image" … "cloneVoice" "talk", string or keyword; :clone-voice works too). args maps canonical arg names (keyword or string) to values. ctx: :cancel (atom or 0-arg fn — truthy ⇒ cancelled), :deadline (epoch ms), :progress (fn [{:verb :client :jobId :status :elapsedMs}]), :provider-options (map; overwrites the request body's top-level keys). Returns MediaResult {:files [..] :text? :jobId? :status}; throws the media error (ex-data :status) on any failure.

§7G.3 — the generic function face. `verb` is the canonical verb name
("image" … "cloneVoice" "talk", string or keyword; :clone-voice works
too). `args` maps canonical arg names (keyword or string) to values. ctx:
`:cancel` (atom or 0-arg fn — truthy ⇒ cancelled), `:deadline` (epoch ms),
`:progress` (fn [{:verb :client :jobId :status :elapsedMs}]),
`:provider-options` (map; overwrites the request body's top-level keys).
Returns MediaResult `{:files [..] :text? :jobId? :status}`; throws the media
error (`ex-data` `:status`) on any failure.
sourceraw docstring

generate-mediaclj/s

(generate-media style verb args)
(generate-media style verb args config)

One-shot sugar: (generate (create-media (load-media-style style config)) verb args).

One-shot sugar: `(generate (create-media (load-media-style style config)) verb args)`.
sourceraw docstring

google-agy-cliclj/s

Preset: Google's Antigravity CLI agy (image).

Preset: Google's Antigravity CLI `agy` (image).
sourceraw docstring

google-agy-cli-mockclj/s

Mock twin of google-agy-cli.

Mock twin of `google-agy-cli`.
sourceraw docstring

grok-media-clientclj/s

(grok-media-client)
(grok-media-client config)

GrokMediaClient (grok): image and video through grok -p … --output-format streaming-json on the user's Grok subscription. Never edits Grok settings; under Zero Data Retention video is unavailable (§7G.10).

GrokMediaClient (`grok`): image and video through `grok -p … --output-format
streaming-json` on the user's Grok subscription. Never edits Grok settings;
under Zero Data Retention video is `unavailable` (§7G.10).
sourceraw docstring

imageclj/s

(image m args)
(image m args ctx)
source

load-media-styleclj/s

(load-media-style path-or-preset)
(load-media-style path-or-preset config)

§7G loadMediaStyle(pathOrPreset, config?) -> a loaded style, itself a MediaClient (pass it to create-media). A built-in preset name (xai-grok-cli, openai-codex-cli, google-agy-cli, or a -mock twin) is served by that CLI client; anything else is a style JSON file path (or an already-parsed style map). config (model, command, loop, gather, …) configures the client behind the style.

§7G `loadMediaStyle(pathOrPreset, config?)` -> a loaded style, itself a
MediaClient (pass it to `create-media`). A built-in preset name (`xai-grok-cli`,
`openai-codex-cli`, `google-agy-cli`, or a `-mock` twin) is served by that CLI
client; anything else is a style JSON file path (or an already-parsed style
map). `config` (model, command, loop, gather, …) configures the client
behind the style.
sourceraw docstring

load-styleclj/s

(load-style path)

Read one style JSON file (§7G loadMediaStyle).

Read one style JSON file (§7G `loadMediaStyle`).
sourceraw docstring

media-errorclj/s

(media-error msg status)
(media-error msg status job-id)

The media error: ex-info carrying :status (:failed | :timeout | :cancelled | :unavailable) and :jobId when known.

The media error: ex-info carrying `:status` (:failed | :timeout | :cancelled
| :unavailable) and `:jobId` when known.
sourceraw docstring

media?clj/s

(media? x)

True for a value built by create-media.

True for a value built by `create-media`.
sourceraw docstring

mock-available-envclj/s

Set to "0" to make every mock preset report unavailable.

Set to "0" to make every mock preset report unavailable.
sourceraw docstring

model-partsclj/s

(model-parts result)

§7G.6 model visibility: the parts of a ToolResult that reach the model. For a media tool result only image parts; any other result's parts unchanged.

§7G.6 model visibility: the parts of a ToolResult that reach the model. For a
media tool result only `image` parts; any other result's parts unchanged.
sourceraw docstring

musicclj/s

(music m args)
(music m args ctx)
source

openai-codex-cliclj/s

Preset: the codex CLI (image).

Preset: the `codex` CLI (image).
sourceraw docstring

openai-codex-cli-mockclj/s

Mock twin of openai-codex-cli.

Mock twin of `openai-codex-cli`.
sourceraw docstring

openai-media-clientclj/s

(openai-media-client)
(openai-media-client config)

OpenAIMediaClient (openai): image, video, speech, transcribe (§7G.9). Key OPENAI_API_KEY; :url points it at any OpenAI-compatible server.

OpenAIMediaClient (`openai`): image, video, speech, transcribe (§7G.9). Key
OPENAI_API_KEY; :url points it at any OpenAI-compatible server.
sourceraw docstring

openrouter-media-clientclj/s

(openrouter-media-client)
(openrouter-media-client config)

OpenRouterMediaClient (openrouter): image over chat completions (§7G.9). Key OPENROUTER_API_KEY.

OpenRouterMediaClient (`openrouter`): image over chat completions (§7G.9).
Key OPENROUTER_API_KEY.
sourceraw docstring

part-pathclj/s

(part-path part)

D20: the local path a media part came from, or nil.

D20: the local path a media part came from, or nil.
sourceraw docstring

percent-encodeclj/s

(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.
sourceraw docstring

read-pathclj/s

(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.
sourceraw docstring

speechclj/s

(speech m args)
(speech m args ctx)
source

style-media-clientclj/s

(style-media-client style)
(style-media-client style config)

§7G.7 — a MediaClient over a parsed style (map, string- or keyword-keyed), named style.name or "style". Uses config :url (replaces baseUrl), :loop, :gather (default mode "url"), :http-client, and :key — when set, what every ${…} in the style's headers expands to. A style naming a verb outside the seven, or mapping an arg to "", throws here.

§7G.7 — a MediaClient over a parsed style (map, string- or keyword-keyed),
named `style.name` or "style". Uses config :url (replaces baseUrl), :loop,
:gather (default mode "url"), :http-client, and :key — when set, what every
`${…}` in the style's headers expands to. A style naming a verb outside the
seven, or mapping an arg to "", throws here.
sourceraw docstring

supported-verbsclj/s

(supported-verbs media)

§7G media.verbs(): every verb some source supports, in canonical order.

§7G `media.verbs()`: every verb some source supports, in canonical order.
sourceraw docstring

supports?clj/s

(supports? media verb)

True when any client of media supports verb.

True when any client of `media` supports `verb`.
sourceraw docstring

talkclj/s

(talk m args)
(talk m args ctx)
source

toolsclj/s

(tools media)

§7G.6 — one Tool (source "media") per verb any client supports, in verbs.json order; the schema is the first supporting client's args. Execute never throws: any error is an isError ToolResult.

§7G.6 — one Tool (source "media") per verb any client supports, in
verbs.json order; the schema is the first supporting client's args. Execute
never throws: any error is an isError ToolResult.
sourceraw docstring

transcribeclj/s

(transcribe m args)
(transcribe m args ctx)
source

unavailable?clj/s

(unavailable? e)

True for a media error whose status is :unavailable (§7G.2) — the client cannot serve the call now (no key, no credits, quota, CLI missing, ZDR).

True for a media error whose status is :unavailable (§7G.2) — the client
cannot serve the call now (no key, no credits, quota, CLI missing, ZDR).
sourceraw docstring

user-agentclj/s

§7G.12 D23: the default User-Agent of every media HTTP request.

§7G.12 D23: the default User-Agent of every media HTTP request.
sourceraw docstring

verbsclj/s

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.
sourceraw docstring

versionclj/s

The package version (kept equal to build.clj's version; a test pins it).

The package version (kept equal to build.clj's `version`; a test pins it).
sourceraw docstring

videoclj/s

(video m args)
(video m args ctx)
source

write-pathclj/s

(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.
sourceraw docstring

xai-grok-cliclj/s

Preset: the grok CLI (image, video).

Preset: the `grok` CLI (image, video).
sourceraw docstring

xai-grok-cli-mockclj/s

Mock twin of xai-grok-cli: never spawns, returns a fixed file.

Mock twin of `xai-grok-cli`: never spawns, returns a fixed file.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close