类 DashScopeResponseParser

java.lang.Object
io.agentscope.core.formatter.dashscope.DashScopeResponseParser

public class DashScopeResponseParser extends Object
Parses DashScope API responses to AgentScope ChatResponse.
  • 字段详细资料

    • FRAGMENT_PLACEHOLDER

      protected static final String FRAGMENT_PLACEHOLDER
      Placeholder name for tool call argument fragments in streaming responses.
      另请参阅:
  • 构造器详细资料

    • DashScopeResponseParser

      public DashScopeResponseParser()
  • 方法详细资料

    • parseResponse

      public ChatResponse parseResponse(DashScopeResponse response, Instant startTime)
      Parse DashScopeResponse to AgentScope ChatResponse.
      参数:
      response - DashScope response DTO
      startTime - Request start time for calculating duration
      返回:
      AgentScope ChatResponse
    • addToolCallsFromMessage

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