Builder
public static class Builder
源码Source
io/agentscope/core/message/Base64Source.java:90–127构建器,用于构建并配置目标实例。位于 io.agentscope.core.message 包。核心成员包括 mediaType、data、build。
Builder for constructing Base64Source instances.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder mediaType(String mediaType) | 设置该配置项。 Sets the MIME type for the media content. |
public Builder data(String data) | 设置数据。 Sets the Base64-encoded media data. |
public Base64Source build() | 构建并返回最终实例。 Builds a new Base64Source with the configured properties. |
方法详情Method Detail
mediaType
public Builder mediaType(String mediaType)
设置该配置项。
Sets the MIME type for the media content.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mediaType | String | media 类型(类型 `String`)。The MIME type (e.g., "image/jpeg") |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/Base64Source.java:102–105data
public Builder data(String data)
设置数据。
Sets the Base64-encoded media data.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
data | String | 数据(类型 `String`)。The Base64 data string |
Builder返回当前实例,以支持链式调用。This builder for chaining
源码Source
io/agentscope/core/message/Base64Source.java:113–116build
public Base64Source build()
构建并返回最终实例。
Builds a new Base64Source with the configured properties.
Base64Source一种新的Base64Source 实例。A new Base64Source instance
NullPointerException可能抛出 `NullPointerException`。if mediaType or data is null
源码Source
io/agentscope/core/message/Base64Source.java:124–126