类 DataBlock

java.lang.Object
io.agentscope.core.message.ContentBlock
io.agentscope.core.message.DataBlock
所有已实现的接口:
State

public final class DataBlock extends ContentBlock
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.

  • 方法详细资料

    • getSource

      public Source getSource()
      Gets the source of this data block.
      返回:
      The data source containing URL or Base64 data
    • getId

      public String getId()
      Gets the identifier of this data block.
      返回:
      The block id; never null
    • getName

      public String getName()
      Gets the optional name of this data block.
      返回:
      The block name, or null if not set
    • builder

      public static DataBlock.Builder builder()
      Creates a new builder for constructing DataBlock instances.
      返回:
      A new builder instance