Class DashScopeResponseParser

java.lang.Object
io.agentscope.extensions.model.dashscope.formatter.DashScopeResponseParser

public class DashScopeResponseParser extends Object
Parses DashScope API responses to AgentScope ChatResponse.
  • Field Details

    • FRAGMENT_PLACEHOLDER

      protected static final String FRAGMENT_PLACEHOLDER
      Placeholder name for tool call argument fragments in streaming responses.
      See Also:
  • Constructor Details

    • DashScopeResponseParser

      public DashScopeResponseParser()
  • Method Details

    • parseResponse

      public io.agentscope.core.model.ChatResponse parseResponse(DashScopeResponse response, Instant startTime)
      Parse DashScopeResponse to AgentScope ChatResponse.
      Parameters:
      response - DashScope response DTO
      startTime - Request start time for calculating duration
      Returns:
      AgentScope ChatResponse
    • addToolCallsFromMessage

      protected void addToolCallsFromMessage(DashScopeMessage message, List<io.agentscope.core.message.ContentBlock> blocks)
      Parse tool calls from DashScopeMessage and add to blocks.
      Parameters:
      message - DashScopeMessage
      blocks - Content blocks to add tool use blocks to