Skip to content

ImageContent

autogen.llm_clients.models.content_blocks.ImageContent #

Bases: BaseContent

Image content with optional detail level.

Supports both URLs and data URIs (base64-encoded blob data): - image_url: Remote HTTP(S) URL to the image - data_uri: Base64-encoded image data (e.g., "data:image/png;base64,...")

Note: Provide either image_url OR data_uri, not both.

type class-attribute instance-attribute #

type = IMAGE

image_url class-attribute instance-attribute #

image_url = None

data_uri class-attribute instance-attribute #

data_uri = None

detail class-attribute instance-attribute #

detail = None

extra class-attribute instance-attribute #

extra = Field(default_factory=dict)

Config #

extra class-attribute instance-attribute #

extra = 'allow'

get_text #

get_text()

Extract text representation of content block.

Override in subclasses to provide specific text extraction logic. Default returns empty string for content blocks without text.

Source code in autogen/llm_clients/models/content_blocks.py
def get_text(self) -> str:
    """Extract text representation of content block.

    Override in subclasses to provide specific text extraction logic.
    Default returns empty string for content blocks without text.
    """
    return ""