类 DashScopeContentPart

java.lang.Object
io.agentscope.core.formatter.dashscope.dto.DashScopeContentPart

public class DashScopeContentPart extends Object
DashScope content part DTO for multimodal messages.

Each content part can contain one type of content: text, image, audio, or video.

Example text part:


 {"text": "What's in this image?"}
 

Example image part (URL):


 {"image": "https://example.com/image.jpg"}
 

Example image part (base64):


 {"image": "data:image/png;base64,iVBORw0KGgo..."}
 
  • 构造器详细资料

    • DashScopeContentPart

      public DashScopeContentPart()
  • 方法详细资料

    • getText

      public String getText()
    • setText

      public void setText(String text)
    • getImage

      public String getImage()
    • setImage

      public void setImage(String image)
    • getAudio

      public String getAudio()
    • setAudio

      public void setAudio(String audio)
    • getVideo

      public Object getVideo()
    • setVideo

      public void setVideo(Object video)
    • getFps

      public Float getFps()
    • setFps

      public void setFps(Float fps)
    • getMaxFrames

      public Integer getMaxFrames()
    • setMaxFrames

      public void setMaxFrames(Integer maxFrames)
    • getMinPixels

      public Integer getMinPixels()
    • setMinPixels

      public void setMinPixels(Integer minPixels)
    • getMaxPixels

      public Integer getMaxPixels()
    • setMaxPixels

      public void setMaxPixels(Integer maxPixels)
    • getTotalPixels

      public Integer getTotalPixels()
    • setTotalPixels

      public void setTotalPixels(Integer totalPixels)
    • getVideoAsString

      public String getVideoAsString()
      Get video as URL string.
      返回:
      the video URL, or null if not a string
    • getVideoAsList

      public List<String> getVideoAsList()
      Get video as frame list.
      返回:
      the video frames, or null if not a list
    • text

      public static DashScopeContentPart text(String text)
      Create a text content part.
      参数:
      text - the text content
      返回:
      a new DashScopeContentPart
    • image

      public static DashScopeContentPart image(String imageUrl)
      Create an image content part.
      参数:
      imageUrl - the image URL or base64 data URI
      返回:
      a new DashScopeContentPart
    • audio

      public static DashScopeContentPart audio(String audioUrl)
      Create an audio content part.
      参数:
      audioUrl - the audio URL or base64 data URI
      返回:
      a new DashScopeContentPart
    • video

      public static DashScopeContentPart video(String videoUrl)
      Create a video content part from URL.
      参数:
      videoUrl - the video URL
      返回:
      a new DashScopeContentPart
    • videoFrames

      public static DashScopeContentPart videoFrames(List<String> frames)
      Create a video content part from frame list.
      参数:
      frames - the list of frame URLs
      返回:
      a new DashScopeContentPart
    • builder

      public static DashScopeContentPart.Builder builder()