Skip to main content

Module images

Module images 

Source
Expand description

Create/Edit Images to a Responses image-generation tool or Gemini.

Builders produce one native call; ImageRequestContext::n tells the adapter how many independent calls are required. The host chooses the generation model separately from the Responses image tool model. Explicit equivalent controls are mapped; unsupported controls fail before any resource read. In particular Gemini Developer API does not accept responseMimeType for images, and its resolution classes cannot guarantee exact Images pixel sizes.

Output MIME and dimensions come from validated PNG/JPEG/WebP containers, never from requested settings. This is container validation, not pixel decoding or transcoding. Native usage remains typed per call because generic generation counters cannot fabricate Images’ image/text token breakdown.

Structs§

GeneratedImagePart
ImageCallResult
ImageMetadata
ImageRequestContext
ImageResponseFacts
ImageTargetModels
The generation model is selected by the host. An image tool model is a separate routing decision; an absent override retains the source image model.
PreparedImageRequest
ResolvedImageInput

Enums§

ImageDialect
ImageDialectBody
ImageInput
ImageUsageFacts

Functions§

build_request
Builds ONE call; context.n is the adapter’s total call count.
decode_image
image_reference
image_response_from_gemini
image_response_from_responses
inspect_image
Container validation and dimensions; this does not decode pixels. PNG CRCs, JPEG marker framing and WebP RIFF framing are checked before publication.
preflight
Selects the source resources and return parameters used by the adapter.