Skip to content

v2.0.0 — generated images, inserted by DIAL file URL

Choose a tag to compare

@photonn photonn released this 20 Aug 11:02
· 38 commits to main since this release

Decks can carry generated imagery now. The server does not generate it: the orchestrator
calls its own image deployment, stores the result in DIAL file storage, and hands this
server a short file URL to embed.

The new tool

add_image_from_dial_url(presentation_id, slide_index, image_url,
                        left=1.0, top=1.0, width=None, height=None,
                        fit="contain")

The bytes are fetched server-side through DialFileClient, with the same
DIAL_AUTH_MODE resolution as export — in the default auto mode that means the end
user's own credentials and their own bucket.

Why not base64

manage_image(source_type="base64") already existed and still does, but a 1024×1024 PNG
is ~1–2 MB: passing it inline pushes roughly 2 MB of payload through the agent's context
on every insertion, which wrecks the Quick Apps iteration budget on a multi-image deck.
The URL form moves a ~50-character string instead. Keep base64 for small assets and for
deployments not running under the DIAL host.

Placement is aspect-ratio aware

slide_index is 0-based, like the other content tools. Give width and height to
define the box the picture should occupy; fit decides how it relates to that box:

  • contain (default) — largest undistorted size that fits, centred in the box.
  • cover — fills the box exactly, cropping the overflowing axis symmetrically via
    Picture.crop_* (no re-encoding).
  • stretch — forces the exact box, distorting the image.

Pass one of width/height to scale proportionally, or neither to keep the natural size
clamped to the slide, so a large generated PNG never hangs off the edge. The response
reports the geometry actually applied ("placed"), which under contain may be smaller
than the box requested — use it to lay out the text beside the image.

The non-distorting default is deliberate: visual_repair_slides can move, resize and
delete a picture, but there is no whitelisted operation that un-distorts one.

Guards

Handle, slide index, fit mode and box dimensions are validated before the download.
DIAL_IMAGE_MAX_MB (default 20) bounds what will be fetched and embedded, and non-raster
input is refused with a message telling the agent to ask its image model for PNG or JPEG
rather than SVG.

Why 2.0.0

No breaking change to existing tools — the major bump marks the scope change: the server
now also places orchestrator-generated media, not only authored content. Image generation
itself stays a Quick Apps concern.

Docs: new "Images (orchestrator-generated)" section in the README, including a drop-in
system-prompt snippet for the Quick App, plus DIAL_IMAGE_MAX_MB in the config table and
.env.example.

16 new tests (tests/test_image_tools.py); suite is 135 tests, green.