Skip to content

ImageBlock

Base classes

Name Children Inherits
BaseContentBlock
clawd_code_sdk.models.content_blocks
Shared base for all content block types.

⋔ Inheritance diagram

graph TD
  812494646["content_blocks.ImageBlock"]
  2489835100["content_blocks.BaseContentBlock"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2489835100 --> 812494646
  3879467795 --> 2489835100
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseContentBlock

Image content block (storage-only, not emitted on the wire).

Source code in src/clawd_code_sdk/models/content_blocks.py
class ImageBlock(BaseContentBlock):
    """Image content block (storage-only, not emitted on the wire)."""

    type: Literal["image"] = "image"
    source: ImageSource

    def to_otel(self) -> BlobPart:
        from logfire._internal.integrations.llm_providers.semconv import BlobPart

        return BlobPart(
            type="blob",
            content=self.source.data,
            mime_type=self.source.media_type,
            modality="image",
        )

:fa-brands-github: Show source on GitHub