AS AgentScopeAPI 手册 / API Reference

DashScopeContentPart

@JsonInclude(JsonInclude.Include.NON_NULL) public class DashScopeContentPart
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:44–332

用于多模态消息的DashScope 内容片段 DTO。位于 io.agentscope.extensions.model.dashscope.dto 包。核心成员包括 getText、setText、getImage、setImage、getAudio、setAudio。

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

类Class类型Kind说明Description
Builder类class
构建器,用于构建并配置目标实例。
A class in io.agentscope.extensions.model.dashscope.dto that talks to model services and returns generated or embedded output.

构造器摘要Constructor Summary

构造器Constructor说明Description
public DashScopeContentPart()
初始化 `DashScopeContentPart` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getText()
获取文本。
Returns the text.
public void setText(String text)
设置文本。
Sets the text.
public String getImage()
获取图像。
Returns the image.
public void setImage(String image)
设置图像。
Sets the image.
public String getAudio()
获取音频。
Returns the audio.
public void setAudio(String audio)
设置音频。
Sets the audio.
public Object getVideo()
获取视频。
Returns the video.
public void setVideo(Object video)
设置视频。
Sets the video.
public Float getFps()
获取 `getFps`。
Returns the fps.
public void setFps(Float fps)
设置 `setFps`。
Sets the fps.
public Integer getMaxFrames()
获取 `getMaxFrames`。
Returns the max frames.
public void setMaxFrames(Integer maxFrames)
设置 `setMaxFrames`。
Sets the max frames.
public Integer getMinPixels()
获取 `getMinPixels`。
Returns the min pixels.
public void setMinPixels(Integer minPixels)
设置 `setMinPixels`。
Sets the min pixels.
public Integer getMaxPixels()
获取 `getMaxPixels`。
Returns the max pixels.
public void setMaxPixels(Integer maxPixels)
设置 `setMaxPixels`。
Sets the max pixels.
public Integer getTotalPixels()
获取 `getTotalPixels`。
Returns the total pixels.
public void setTotalPixels(Integer totalPixels)
设置 `setTotalPixels`。
Sets the total pixels.
public Map<String, String> getCacheControl()
获取 `getCacheControl`。
Get the cache control configuration.
public void setCacheControl(Map<String, String> cacheControl)
设置 `setCacheControl`。
Set the cache control configuration.
public String getVideoAsString()
获取 `getVideoAsString`。
Get video as URL string.
public List<String> getVideoAsList()
获取视频 As 列表。
Get video as frame list.
public static DashScopeContentPart text(String text)
static
创建文本内容片段。
Create a text content part.
public static DashScopeContentPart image(String imageUrl)
static
创建图像内容片段。
Create an image content part.
public static DashScopeContentPart audio(String audioUrl)
static
创建音频内容片段。
Create an audio content part.
public static DashScopeContentPart video(String videoUrl)
static
创建视频内容片段来自 URL。
Create a video content part from URL.
public static DashScopeContentPart videoFrames(List<String> frames)
static
设置该参数。
Create a video content part from frame list.
public static Builder builder()
static
返回构建器实例。
Returns the builder.

构造器详情Constructor Detail

DashScopeContentPart

public DashScopeContentPart()

初始化 DashScopeContentPart 实例。

Creates a new instance.

源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:88

方法详情Method Detail

getText

public String getText()

获取文本。

Returns the text.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:90–92

setText

public void setText(String text)

设置文本。

Sets the text.

参数Parameters
名称Name类型Type说明Description
textString文本(类型 `String`)。The text.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:94–96

getImage

public String getImage()

获取图像。

Returns the image.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:98–100

setImage

public void setImage(String image)

设置图像。

Sets the image.

参数Parameters
名称Name类型Type说明Description
imageString图像(类型 `String`)。The image.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:102–104

getAudio

public String getAudio()

获取音频。

Returns the audio.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:106–108

setAudio

public void setAudio(String audio)

设置音频。

Sets the audio.

参数Parameters
名称Name类型Type说明Description
audioString音频(类型 `String`)。The audio.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:110–112

getVideo

public Object getVideo()

获取视频。

Returns the video.

返回Returns Object
返回对象。Returns object.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:114–116

setVideo

public void setVideo(Object video)

设置视频。

Sets the video.

参数Parameters
名称Name类型Type说明Description
videoObject视频(类型 `Object`)。The video.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:118–120

getFps

public Float getFps()

获取 getFps。

Returns the fps.

返回Returns Float
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:122–124

setFps

public void setFps(Float fps)

设置 setFps。

Sets the fps.

参数Parameters
名称Name类型Type说明Description
fpsFloatfps(类型 `Float`)。The fps.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:126–128

getMaxFrames

public Integer getMaxFrames()

获取 getMaxFrames。

Returns the max frames.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:130–132

setMaxFrames

public void setMaxFrames(Integer maxFrames)

设置 setMaxFrames。

Sets the max frames.

参数Parameters
名称Name类型Type说明Description
maxFramesInteger最大 Frames(类型 `Integer`)。The max frames.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:134–136

getMinPixels

public Integer getMinPixels()

获取 getMinPixels。

Returns the min pixels.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:138–140

setMinPixels

public void setMinPixels(Integer minPixels)

设置 setMinPixels。

Sets the min pixels.

参数Parameters
名称Name类型Type说明Description
minPixelsInteger最小 Pixels(类型 `Integer`)。The min pixels.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:142–144

getMaxPixels

public Integer getMaxPixels()

获取 getMaxPixels。

Returns the max pixels.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:146–148

setMaxPixels

public void setMaxPixels(Integer maxPixels)

设置 setMaxPixels。

Sets the max pixels.

参数Parameters
名称Name类型Type说明Description
maxPixelsInteger最大 Pixels(类型 `Integer`)。The max pixels.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:150–152

getTotalPixels

public Integer getTotalPixels()

获取 getTotalPixels。

Returns the total pixels.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:154–156

setTotalPixels

public void setTotalPixels(Integer totalPixels)

设置 setTotalPixels。

Sets the total pixels.

参数Parameters
名称Name类型Type说明Description
totalPixelsInteger总数 Pixels(类型 `Integer`)。The total pixels.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:158–160

getCacheControl

public Map<String, String> getCacheControl()

获取 getCacheControl。

Get the cache control configuration.

返回Returns Map<String, String>
返回映射。the cache control configuration, or null when not configured
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:167–169

setCacheControl

public void setCacheControl(Map<String, String> cacheControl)

设置 setCacheControl。

Set the cache control configuration.

参数Parameters
名称Name类型Type说明Description
cacheControlMap<String, String>缓存 Control(类型 `Map`)。the cache control configuration
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:176–178

getVideoAsString

public String getVideoAsString()

获取 getVideoAsString。

Get video as URL string.

返回Returns String
返回字符串结果。the video URL, or null if not a string
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:185–190

getVideoAsList

public List<String> getVideoAsList()

获取视频 As 列表。

Get video as frame list.

返回Returns List<String>
返回列出。the video frames, or null if not a list
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:197–203

text

public static DashScopeContentPart text(String text)
static

创建文本内容片段。

Create a text content part.

参数Parameters
名称Name类型Type说明Description
textString文本内容。the text content
返回Returns DashScopeContentPart
一种新的DashScopeContentPart。a new DashScopeContentPart
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:211–215

image

public static DashScopeContentPart image(String imageUrl)
static

创建图像内容片段。

Create an image content part.

参数Parameters
名称Name类型Type说明Description
imageUrlString图像 URL 或 base64 数据 URI。the image URL or base64 data URI
返回Returns DashScopeContentPart
一种新的DashScopeContentPart。a new DashScopeContentPart
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:223–227

audio

public static DashScopeContentPart audio(String audioUrl)
static

创建音频内容片段。

Create an audio content part.

参数Parameters
名称Name类型Type说明Description
audioUrlString音频 URL 或 base64 数据 URI。the audio URL or base64 data URI
返回Returns DashScopeContentPart
一种新的DashScopeContentPart。a new DashScopeContentPart
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:235–239

video

public static DashScopeContentPart video(String videoUrl)
static

创建视频内容片段来自 URL。

Create a video content part from URL.

参数Parameters
名称Name类型Type说明Description
videoUrlString视频 URL。the video URL
返回Returns DashScopeContentPart
一种新的DashScopeContentPart。a new DashScopeContentPart
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:247–251

videoFrames

public static DashScopeContentPart videoFrames(List<String> frames)
static

设置该参数。

Create a video content part from frame list.

参数Parameters
名称Name类型Type说明Description
framesList<String>frames(类型 `List`)。the list of frame URLs
返回Returns DashScopeContentPart
一种新的DashScopeContentPart。a new DashScopeContentPart
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:259–263

builder

public static Builder builder()
static

返回构建器实例。

Returns the builder.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/model/dashscope/dto/DashScopeContentPart.java:265–267

嵌套类详情Nested Class Detail

Builder

public static class Builder

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.model.dashscope.dto 包。核心成员包括 text、image、audio、video、fps、maxFrames。

A class in io.agentscope.extensions.model.dashscope.dto that talks to model services and returns generated or embedded output. Declared in io.agentscope.extensions.model.dashscope.dto.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.