类 AudioBlock

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

public final class AudioBlock extends ContentBlock
Represents audio content in a message.

This content block supports audio from two sources:

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

Audio blocks enable multimodal AI interactions where agents need to process or generate audio content such as speech, music, sound effects, or other auditory information.

  • 构造器详细资料

    • AudioBlock

      public AudioBlock(Source source)
      Creates a new audio block for JSON deserialization.
      参数:
      source - The audio source (URL or Base64)
      抛出:
      NullPointerException - if source is null
  • 方法详细资料

    • getSource

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

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