Class AnthropicResponseParser

java.lang.Object
io.agentscope.extensions.model.anthropic.formatter.AnthropicResponseParser

public class AnthropicResponseParser extends Object
Parses Anthropic API responses (both streaming and non-streaming) into AgentScope ChatResponse objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static io.agentscope.core.model.ChatResponse
    parseMessage(com.anthropic.models.messages.Message message, Instant startTime)
    Parse non-streaming Anthropic Message to ChatResponse.
    static reactor.core.publisher.Flux<io.agentscope.core.model.ChatResponse>
    parseStreamEvents(reactor.core.publisher.Flux<com.anthropic.models.messages.RawMessageStreamEvent> eventFlux, Instant startTime)
    Parse streaming Anthropic events to ChatResponse Flux.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AnthropicResponseParser

      public AnthropicResponseParser()
  • Method Details

    • parseMessage

      public static io.agentscope.core.model.ChatResponse parseMessage(com.anthropic.models.messages.Message message, Instant startTime)
      Parse non-streaming Anthropic Message to ChatResponse.
    • parseStreamEvents

      public static reactor.core.publisher.Flux<io.agentscope.core.model.ChatResponse> parseStreamEvents(reactor.core.publisher.Flux<com.anthropic.models.messages.RawMessageStreamEvent> eventFlux, Instant startTime)
      Parse streaming Anthropic events to ChatResponse Flux.