ImageBlock
@JsonInclude(JsonInclude.Include.NON_NULL) public final class ImageBlock extends ContentBlock
io/agentscope/core/message/ImageBlock.java:36–163表示图像内容 in 消息使用 URL 或 Base64 来源。位于 io.agentscope.core.message 包,继承自 ContentBlock。核心成员包括 getSource、getMinPixels、getMaxPixels、builder、ImageBlock。
Represents image content in a message with URL or Base64 source.
This content block supports images from two sources:
-
URL source - images accessible via HTTP/HTTPS URLs or local file URLs
-
Base64 source - images encoded as Base64 strings with MIME type
Image blocks are essential for multimodal AI interactions where agents need to process visual information from images, diagrams, screenshots, or other visual content.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | 构建器,用于构建并配置目标实例。 Builder for constructing ImageBlock instances. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ImageBlock(Source source) | 创建新的图像块使用来源。 Creates a new image block with source. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Source getSource() | 获取来源的此图像。 Gets the source of this image. |
public Integer getMinPixels() | 获取 `getMinPixels`。 Gets the minimum pixel threshold for input image. |
public Integer getMaxPixels() | 获取 `getMaxPixels`。 Gets the maximum pixel threshold for input image. |
public static Builder builder()static | 返回构建器实例。 Creates a new builder for constructing ImageBlock instances. |
构造器详情Constructor Detail
ImageBlock
public ImageBlock(Source source)
创建新的图像块使用来源。
Creates a new image block with source.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
source | Source | 图像来源(URL 或 Base64)。The image source (URL or Base64) |
NullPointerException可能抛出 `NullPointerException`。if source is null
io/agentscope/core/message/ImageBlock.java:51–53方法详情Method Detail
getSource
public Source getSource()
获取来源的此图像。
Gets the source of this image.
Sourceio/agentscope/core/message/ImageBlock.java:78–80getMinPixels
public Integer getMinPixels()
获取 getMinPixels。
Gets the minimum pixel threshold for input image.
Integerio/agentscope/core/message/ImageBlock.java:87–89getMaxPixels
public Integer getMaxPixels()
获取 getMaxPixels。
Gets the maximum pixel threshold for input image.
Integerio/agentscope/core/message/ImageBlock.java:96–98builder
public static Builder builder()
返回构建器实例。
Creates a new builder for constructing ImageBlock instances.
Builderio/agentscope/core/message/ImageBlock.java:105–107嵌套类详情Nested Class Detail
Builder
public static class Builder构建器,用于构建并配置目标实例。位于 io.agentscope.core.message 包。核心成员包括 source、minPixels、maxPixels、build。
Builder for constructing ImageBlock instances.