Class DashScopeWebSocketClient

java.lang.Object
okhttp3.WebSocketListener
com.alibaba.cloud.ai.dashscope.protocol.DashScopeWebSocketClient

public class DashScopeWebSocketClient extends okhttp3.WebSocketListener
Author:
kevinlin09, xuguan
  • Constructor Details

  • Method Details

    • streamBinaryOut

      public reactor.core.publisher.Flux<ByteBuffer> streamBinaryOut(String text)
    • streamTextOut

      public reactor.core.publisher.Flux<String> streamTextOut(reactor.core.publisher.Flux<ByteBuffer> binary)
    • sendText

      public void sendText(String text)
    • sendBinary

      public void sendBinary(ByteBuffer binary)
    • onOpen

      public void onOpen(okhttp3.WebSocket webSocket, okhttp3.Response response)
      Overrides:
      onOpen in class okhttp3.WebSocketListener
    • onClosed

      public void onClosed(okhttp3.WebSocket webSocket, int code, String reason)
      Overrides:
      onClosed in class okhttp3.WebSocketListener
    • onClosing

      public void onClosing(okhttp3.WebSocket webSocket, int code, String reason)
      Overrides:
      onClosing in class okhttp3.WebSocketListener
    • onFailure

      public void onFailure(okhttp3.WebSocket webSocket, Throwable t, okhttp3.Response response)
      Overrides:
      onFailure in class okhttp3.WebSocketListener
    • onMessage

      public void onMessage(okhttp3.WebSocket webSocket, String text)
      Overrides:
      onMessage in class okhttp3.WebSocketListener
    • onMessage

      public void onMessage(okhttp3.WebSocket webSocket, okio.ByteString bytes)
      Overrides:
      onMessage in class okhttp3.WebSocketListener