Class DashScopeContentPart
java.lang.Object
io.agentscope.extensions.model.dashscope.dto.DashScopeContentPart
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..."}
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DashScopeContentPartCreate an audio content part.static DashScopeContentPart.Builderbuilder()getAudio()Get the cache control configuration.getFps()getImage()getText()getVideo()Get video as frame list.Get video as URL string.static DashScopeContentPartCreate an image content part.voidvoidsetCacheControl(Map<String, String> cacheControl) Set the cache control configuration.voidvoidvoidsetMaxFrames(Integer maxFrames) voidsetMaxPixels(Integer maxPixels) voidsetMinPixels(Integer minPixels) voidvoidsetTotalPixels(Integer totalPixels) voidstatic DashScopeContentPartCreate a text content part.static DashScopeContentPartCreate a video content part from URL.static DashScopeContentPartvideoFrames(List<String> frames) Create a video content part from frame list.
-
Constructor Details
-
DashScopeContentPart
public DashScopeContentPart()
-
-
Method Details
-
getText
-
setText
-
getImage
-
setImage
-
getAudio
-
setAudio
-
getVideo
-
setVideo
-
getFps
-
setFps
-
getMaxFrames
-
setMaxFrames
-
getMinPixels
-
setMinPixels
-
getMaxPixels
-
setMaxPixels
-
getTotalPixels
-
setTotalPixels
-
getCacheControl
Get the cache control configuration.- Returns:
- the cache control configuration, or null when not configured
-
setCacheControl
Set the cache control configuration.- Parameters:
cacheControl- the cache control configuration
-
getVideoAsString
Get video as URL string.- Returns:
- the video URL, or null if not a string
-
getVideoAsList
Get video as frame list.- Returns:
- the video frames, or null if not a list
-
text
Create a text content part.- Parameters:
text- the text content- Returns:
- a new DashScopeContentPart
-
image
Create an image content part.- Parameters:
imageUrl- the image URL or base64 data URI- Returns:
- a new DashScopeContentPart
-
audio
Create an audio content part.- Parameters:
audioUrl- the audio URL or base64 data URI- Returns:
- a new DashScopeContentPart
-
video
Create a video content part from URL.- Parameters:
videoUrl- the video URL- Returns:
- a new DashScopeContentPart
-
videoFrames
Create a video content part from frame list.- Parameters:
frames- the list of frame URLs- Returns:
- a new DashScopeContentPart
-
builder
-