Create an ImageContentBlock.
create_image_block(
*,
url: str | None = None,
base64: str | None = None,
file_id: str | None = None,
mime_type: str | None = None,
id: str | None = None,
index: int | str | None = None,
**kwargs: Any = {}
) -> ImageContentBlockThe id is generated automatically if not provided, using a UUID4 format
prefixed with 'lc_' to indicate it is a LangChain-generated ID.
| Name | Type | Description |
|---|---|---|
url | str | None | Default: NoneURL of the image. |
base64 | str | None | Default: NoneBase64-encoded image data. |
file_id | str | None | Default: NoneID of the image file from a file storage system. |
mime_type | str | None | Default: NoneMIME type of the image. Required for base64 data. |
id | str | None | Default: NoneContent block identifier. Generated automatically if not provided. |
index | int | str | None | Default: NoneIndex of block in aggregate response. Used during streaming. |