Class DashScopeMessageConverter
java.lang.Object
io.agentscope.extensions.model.dashscope.formatter.DashScopeMessageConverter
Converts AgentScope Msg objects to DashScope DTO message types.
This class provides unified conversion methods for both simple text messages and multimodal messages containing images, videos, and audio.
-
Constructor Summary
ConstructorsConstructorDescriptionDashScopeMessageConverter(Function<List<io.agentscope.core.message.ContentBlock>, String> toolResultConverter) -
Method Summary
Modifier and TypeMethodDescriptionconvertToMessage(io.agentscope.core.message.Msg msg, boolean useMultimodalFormat) Convert single Msg to DashScopeMessage.
-
Constructor Details
-
DashScopeMessageConverter
-
-
Method Details
-
convertToMessage
public DashScopeMessage convertToMessage(io.agentscope.core.message.Msg msg, boolean useMultimodalFormat) Convert single Msg to DashScopeMessage.This is the main entry point for message conversion. It automatically selects the appropriate format based on the message content and the hasMediaContent flag.
- Parameters:
msg- The message to convertuseMultimodalFormat- Whether to use multimodal content format (List of content parts)- Returns:
- The converted DashScopeMessage
-