InstrumentedImageGenerationClient

org.llm4s.imagegeneration.InstrumentedImageGenerationClient

Decorator that wraps an ImageGenerationClient with metrics collection and trace event emission.

Records:

Note: Cost estimation uses the requested size, not the actual provider-billed dimensions. For models like dall-e-3 that normalize sizes (e.g., mapping non-standard requested sizes to their nearest supported size), the estimate may differ from actual billing. When size is unknown (e.g., edit operations without an explicit size), cost estimation is skipped.

Value parameters

config

Image generation configuration (provides model/provider info)

delegate

The underlying client to delegate actual generation to

metrics

Metrics collector; any backend that exports generic metrics exports these

tracing

Tracing backend for structured event emission

Attributes

Source
InstrumentedImageGenerationClient.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def editImage(imagePath: Path, prompt: String, maskPath: Option[Path], options: ImageEditOptions): Either[LLMError, Seq[GeneratedImage]]

Edit an existing image based on a prompt and optional mask

Edit an existing image based on a prompt and optional mask

Attributes

Definition Classes
Source
InstrumentedImageGenerationClient.scala
override def editImageAsync(imagePath: Path, prompt: String, maskPath: Option[Path], options: ImageEditOptions)(implicit ec: ExecutionContext): Future[Either[LLMError, Seq[GeneratedImage]]]

Edit an existing image asynchronously

Edit an existing image asynchronously

Attributes

Definition Classes
Source
InstrumentedImageGenerationClient.scala

Generate an image from a text prompt

Generate an image from a text prompt

Attributes

Definition Classes
Source
InstrumentedImageGenerationClient.scala

Generate an image asynchronously

Generate an image asynchronously

Attributes

Definition Classes
Source
InstrumentedImageGenerationClient.scala
override def generateImages(prompt: String, count: Int, options: ImageGenerationOptions): Either[LLMError, Seq[GeneratedImage]]

Generate multiple images from a text prompt

Generate multiple images from a text prompt

Attributes

Definition Classes
Source
InstrumentedImageGenerationClient.scala
override def generateImagesAsync(prompt: String, count: Int, options: ImageGenerationOptions)(implicit ec: ExecutionContext): Future[Either[LLMError, Seq[GeneratedImage]]]

Generate multiple images asynchronously

Generate multiple images asynchronously

Attributes

Definition Classes
Source
InstrumentedImageGenerationClient.scala
override def health(): Either[LLMError, ServiceStatus]

Check the health/status of the image generation service

Check the health/status of the image generation service

Attributes

Definition Classes
Source
InstrumentedImageGenerationClient.scala