类 ImageBlock

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

public final class ImageBlock extends ContentBlock
Represents image content in a message with URL or Base64 source.

This content block supports images from two sources:

  • URL source - images accessible via HTTP/HTTPS URLs or local file URLs
  • Base64 source - images encoded as Base64 strings with MIME type

Image blocks are essential for multimodal AI interactions where agents need to process visual information from images, diagrams, screenshots, or other visual content.

  • 构造器详细资料

    • ImageBlock

      public ImageBlock(Source source)
      Creates a new image block with source.
      参数:
      source - The image source (URL or Base64)
      抛出:
      NullPointerException - if source is null
  • 方法详细资料

    • getSource

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

      public Integer getMinPixels()
      Gets the minimum pixel threshold for input image.
      返回:
      The minimum pixel threshold
    • getMaxPixels

      public Integer getMaxPixels()
      Gets the maximum pixel threshold for input image.
      返回:
      The maximum pixel threshold
    • builder

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