Skip to main content

Python class

InputImageContent

InputImageContent​

class max.pipelines.request.InputImageContent(*, type='input_image', image_url, detail=None)

source

Bases: BaseModel

Image content in input messages.

Parameters:

detail​

detail: ImageDetail | None

source

image_url​

image_url: str

source

model_config​

model_config: ClassVar[ConfigDict] = {'frozen': True}

source

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type​

type: Literal['input_image']

source

validate_data_uri_only()​

validate_data_uri_only()

source

Validate that image_url is a data URI.

Web URLs (http/https) should have been converted to base64 data URIs during request preprocessing. Only data URIs are accepted at validation time.

Raises:

ValueError – If image_url is not a data URI.

Returns:

The validated InputImageContent instance.

Return type:

InputImageContent