ImageModelV1: Image Model V1 (Abstract Base Class)

ImageModelV1R Documentation

Image Model V1 (Abstract Base Class)

Description

Abstract interface for image generation and editing models.

Public fields

specification_version

The version of this specification.

provider

The provider identifier.

model_id

The model identifier.

capabilities

Model capability flags.

Methods

Public methods


Method new()

Initialize the image model.

Usage
ImageModelV1$new(provider, model_id, capabilities = list())
Arguments
provider

Provider name.

model_id

Model ID.

capabilities

Optional list of capability flags.


Method has_capability()

Check if the image model has a specific capability.

Usage
ImageModelV1$has_capability(cap)
Arguments
cap

Capability name.

Returns

Logical.


Method generate_image()

Public image generation method.

Usage
ImageModelV1$generate_image(...)
Arguments
...

Call options passed to do_generate_image().

Returns

A GenerateImageResult object.


Method edit_image()

Public image editing method.

Usage
ImageModelV1$edit_image(...)
Arguments
...

Call options passed to do_edit_image().

Returns

A GenerateImageResult object.


Method do_generate_image()

Generate images. Abstract method.

Usage
ImageModelV1$do_generate_image(params)
Arguments
params

A list of call options.

Returns

A GenerateImageResult object.


Method do_edit_image()

Edit images. Abstract method.

Usage
ImageModelV1$do_edit_image(params)
Arguments
params

A list of call options.

Returns

A GenerateImageResult object.


Method do_stream_image()

Stream image generation with partial-image previews. Optional — subclasses that support it override. Default raises an informative error so stream_image() callers can fall back to generate_image() on providers without streaming support.

Usage
ImageModelV1$do_stream_image(params, callback)
Arguments
params

A list of call options.

callback

A function called with each event list.

Returns

A GenerateImageResult object with the final image.


Method stream_image()

Public image streaming method.

Usage
ImageModelV1$stream_image(callback, ...)
Arguments
callback

A function receiving each event list.

...

Call options passed to do_stream_image().

Returns

A GenerateImageResult object.


Method clone()

The objects of this class are cloneable with this method.

Usage
ImageModelV1$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


aisdk documentation built on May 29, 2026, 9:07 a.m.