类:LiveWebSocketHandler

java.lang.Object
org.springframework.web.socket.handler.AbstractWebSocketHandler
org.springframework.web.socket.handler.TextWebSocketHandler
com.google.adk.web.websocket.LiveWebSocketHandler
All Implemented Interfaces:
org.springframework.web.socket.WebSocketHandler

@Component public class LiveWebSocketHandler extends org.springframework.web.socket.handler.TextWebSocketHandler
用于 `/run_live` 端点的 WebSocket 处理程序。

负责管理实时客服交互中的双向通信。假设 `com.google.adk.runner.Runner` 类中有一个名为 `run` 的方法: public Flowable<Event> runLive(Session session, Flowable<LiveRequest> liveRequests, List<String> modalities)

  • 构造函数概述

    Constructors
    Constructor
    Description
    LiveWebSocketHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, BaseSessionService sessionService, RunnerService runnerService)
     
  • 方法概述

    Modifier and Type
    Method
    Description
    void
    afterConnectionClosed(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.CloseStatus status)
     
    void
    afterConnectionEstablished(org.springframework.web.socket.WebSocketSession wsSession)
     
    protected void
    handleTextMessage(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.TextMessage message)
     
    void
    handleTransportError(org.springframework.web.socket.WebSocketSession wsSession, Throwable exception)
     

    Methods inherited from class org.springframework.web.socket.handler.TextWebSocketHandler

    handleBinaryMessage

    Methods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler

    handleMessage, handlePongMessage, supportsPartialMessages

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造函数详细信息

    • LiveWebSocketHandler

      @Autowired public LiveWebSocketHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper, BaseSessionService sessionService, RunnerService runnerService)
  • 方法详细信息(Method Details)

    • afterConnectionEstablished

      public void afterConnectionEstablished(org.springframework.web.socket.WebSocketSession wsSession) throws Exception
      Specified by:
      afterConnectionEstablished in interface org.springframework.web.socket.WebSocketHandler
      Overrides:
      afterConnectionEstablished in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      Throws:
      Exception
    • handleTextMessage

      protected void handleTextMessage(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.TextMessage message) throws Exception
      Overrides:
      handleTextMessage in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      Throws:
      Exception
    • handleTransportError

      public void handleTransportError(org.springframework.web.socket.WebSocketSession wsSession, Throwable exception) throws Exception
      Specified by:
      handleTransportError in interface org.springframework.web.socket.WebSocketHandler
      Overrides:
      handleTransportError in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      Throws:
      Exception
    • afterConnectionClosed

      public void afterConnectionClosed(org.springframework.web.socket.WebSocketSession wsSession, org.springframework.web.socket.CloseStatus status) throws Exception
      Specified by:
      afterConnectionClosed in interface org.springframework.web.socket.WebSocketHandler
      Overrides:
      afterConnectionClosed in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      Throws:
      Exception