Builder
public static class Builder
源码Source
io/agentscope/core/message/ImageBlock.java:112–162构建器,用于构建并配置目标实例。位于 io.agentscope.core.message 包。核心成员包括 source、minPixels、maxPixels、build。
Builder for constructing ImageBlock instances.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder source(Source source) | 设置来源用于图像。 Sets the source for the image. |
public Builder minPixels(Integer minPixels) | 设置该配置项。 Sets the minimum pixel threshold for input image frames. |
public Builder maxPixels(Integer maxPixels) | 设置该配置项。 Sets the maximum pixel threshold for input image frames. |
public ImageBlock build() | 构建并返回最终实例。 Builds a new ImageBlock with the configured source. |
方法详情Method Detail
source
public Builder source(Source source)
设置来源用于图像。
Sets the source for the image.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
source | Source | 图像来源(URL 或 Base64)。The image source (URL or Base64) |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ImageBlock.java:126–129minPixels
public Builder minPixels(Integer minPixels)
设置该配置项。
Sets the minimum pixel threshold for input image frames.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
minPixels | Integer | 最小 Pixels(类型 `Integer`)。The minimum pixel threshold |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ImageBlock.java:137–140maxPixels
public Builder maxPixels(Integer maxPixels)
设置该配置项。
Sets the maximum pixel threshold for input image frames.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxPixels | Integer | 最大 Pixels(类型 `Integer`)。The maximum pixel threshold |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/ImageBlock.java:148–151build
public ImageBlock build()
构建并返回最终实例。
Builds a new ImageBlock with the configured source.
ImageBlock一种新的ImageBlock 实例。A new ImageBlock instance
NullPointerException可能抛出 `NullPointerException`。if source is null
源码Source
io/agentscope/core/message/ImageBlock.java:159–161