类 Base64Source
java.lang.Object
io.agentscope.core.message.Source
io.agentscope.core.message.Base64Source
Represents Base64-encoded media content with media type and data.
This source is used for embedding media files directly in messages by encoding the binary data as Base64 strings. The format follows the standard MIME type convention with Base64 encoding.
Common media types include:
- image/jpeg, image/png, image/gif - for images
- audio/mpeg, audio/wav, audio/ogg - for audio
- video/mp4, video/avi, video/mov - for video
This approach is useful when media files need to be included directly in messages rather than referenced by URL.
-
嵌套类概要
嵌套类 -
构造器概要
构造器构造器说明Base64Source(String mediaType, String data) Creates a new Base64 source for JSON deserialization. -
方法概要
修饰符和类型方法说明static Base64Source.Builderbuilder()Creates a new builder for constructing Base64Source instances.getData()Gets the Base64-encoded media data.Gets the MIME type of the media content.
-
构造器详细资料
-
Base64Source
Creates a new Base64 source for JSON deserialization.- 参数:
mediaType- The MIME type of the media content (e.g., "image/jpeg")data- The Base64-encoded media data- 抛出:
NullPointerException- if mediaType or data is null
-
-
方法详细资料
-
getMediaType
Gets the MIME type of the media content.- 返回:
- The media type as a string (e.g., "image/jpeg")
-
getData
Gets the Base64-encoded media data.- 返回:
- The Base64 data string
-
builder
Creates a new builder for constructing Base64Source instances.- 返回:
- A new builder instance
-