类 DashScopeMessage
java.lang.Object
io.agentscope.core.formatter.dashscope.dto.DashScopeMessage
DashScope message DTO.
This class represents a message in the DashScope API format. Content can be either a String (for text-only) or a List of DashScopeContentPart (for multimodal).
Example text message:
{
"role": "user",
"content": "Hello"
}
Example multimodal message:
{
"role": "user",
"content": [
{"text": "What's in this image?"},
{"image": "https://example.com/image.jpg"}
]
}
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static DashScopeMessage.Builderbuilder()Get content as List (for multimodal messages).Get content as String (for text-only messages).getName()getRole()booleanCheck if this message has multimodal content.voidsetCacheControl(Map<String, String> cacheControl) voidsetContent(Object content) voidvoidsetReasoningContent(String reasoningContent) voidvoidsetToolCallId(String toolCallId) voidsetToolCalls(List<DashScopeToolCall> toolCalls)
-
构造器详细资料
-
DashScopeMessage
public DashScopeMessage()
-
-
方法详细资料
-
getRole
-
setRole
-
getContent
-
setContent
-
getContentAsString
Get content as String (for text-only messages).- 返回:
- the content as String, or null if multimodal
-
getContentAsList
Get content as List (for multimodal messages).- 返回:
- the content as List, or null if text-only
-
isMultimodal
public boolean isMultimodal()Check if this message has multimodal content.- 返回:
- true if content is a List
-
getName
-
setName
-
getToolCallId
-
setToolCallId
-
getToolCalls
-
setToolCalls
-
getReasoningContent
-
setReasoningContent
-
getCacheControl
-
setCacheControl
-
builder
-