Skip to main content

Module image_gen

Module image_gen 

Source
Expand description

Image generation client: unified interface for multiple providers.

Supports two protocols:

  • Openai: OpenAI-compatible Images API (POST /images/generations).
  • Dashscope: DashScope native protocol (Wanxiang), with sync and async call modes. Async mode submits a task then polls until completion.

The model used is resolved from config (default_image_model) and is not exposed to callers - the client uses provider.model_id internally.

Structs§

GeneratedImage
A single generated image, as returned by the provider API.
ImageGenClient
ImageGenErrorInfo
Structured error info extracted from an ImageGenError, for returning to the LLM in a machine-parseable form so it can decide whether to retry.
ImageGenRequest
Parameters for an image generation request.

Enums§

ImageGenError