DataBlock
@JsonInclude(JsonInclude.Include.NON_NULL) public final class DataBlock extends ContentBlock
io/agentscope/core/message/DataBlock.java:34–153数据块,在智能体、模型与前端之间传递结构化消息和事件。位于 io.agentscope.core.message 包,继承自 ContentBlock。核心成员包括 getSource、getId、getName、builder。
Unified data block for arbitrary binary media (image / audio / video / file).
Unlike the legacy ImageBlock, AudioBlock, VideoBlock
subclasses — which the SDK retains for back-compat — DataBlock is the
forward-looking polymorphic container for every binary modality. New code
should prefer DataBlock over the legacy subclasses; the legacy types
stay around as valid MsgRole#USER payloads to keep existing pipelines
working.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Builder | 类class | 构建器,用于构建并配置目标实例。 Builder for constructing DataBlock instances. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Source getSource() | 获取来源的此数据块。 Gets the source of this data block. |
public String getId() | 获取标识。 Gets the identifier of this data block. |
public String getName() | 获取可选名称的此数据块。 Gets the optional name of this data block. |
public static Builder builder()static | 返回构建器实例。 Creates a new builder for constructing DataBlock instances. |
方法详情Method Detail
getSource
public Source getSource()
获取来源的此数据块。
Gets the source of this data block.
Sourceio/agentscope/core/message/DataBlock.java:67–69getId
public String getId()
获取标识。
Gets the identifier of this data block.
Stringio/agentscope/core/message/DataBlock.java:76–78getName
public String getName()
获取可选名称的此数据块。
Gets the optional name of this data block.
Stringio/agentscope/core/message/DataBlock.java:85–87builder
public static Builder builder()
返回构建器实例。
Creates a new builder for constructing DataBlock instances.
Builderio/agentscope/core/message/DataBlock.java:94–96嵌套类详情Nested Class Detail
Builder
public static class Builder构建器,用于构建并配置目标实例。位于 io.agentscope.core.message 包。核心成员包括 source、id、name、build。
Builder for constructing DataBlock instances.