Class OmniRealtimeConversation

java.lang.Object
okhttp3.WebSocketListener
com.alibaba.dashscope.legacy_2x.audio.omni.OmniRealtimeConversation

@Deprecated public class OmniRealtimeConversation extends okhttp3.WebSocketListener
Deprecated.
Author:
lengjiayi
  • Constructor Details

    • OmniRealtimeConversation

      public OmniRealtimeConversation(OmniRealtimeParam param, OmniRealtimeCallback callback)
      Deprecated.
      Constructor
      Parameters:
      param - apikey, model, url, etc.
      callback - callback
  • Method Details

    • checkStatus

      public void checkStatus()
      Deprecated.
      Omni APIs
    • connect

      public void connect() throws NoApiKeyException, InterruptedException
      Deprecated.
      Connect to server, create session and return default session configuration
      Throws:
      NoApiKeyException
      InterruptedException
    • endSession

      public void endSession() throws InterruptedException
      Deprecated.
      Throws:
      InterruptedException
    • endSession

      public void endSession(int timeout) throws InterruptedException
      Deprecated.
      Throws:
      InterruptedException
    • endSessionAsync

      public void endSessionAsync()
      Deprecated.
    • updateSession

      public void updateSession(OmniRealtimeConfig config)
      Deprecated.
      Update session configuration, should be used before create response
      Parameters:
      config - session configuration
    • createItem

      public void createItem(com.google.gson.JsonObject item)
      Deprecated.
      send item to server by event conversation.item.create
      Parameters:
      item - item pass to server
    • appendAudio

      public void appendAudio(String audioBase64)
      Deprecated.
      send audio in base64 format
      Parameters:
      audioBase64 - base64 audio string
    • appendVideo

      public void appendVideo(String videoBase64)
      Deprecated.
      send one image frame in video in base64 format
      Parameters:
      videoBase64 - base64 image string
    • commit

      public void commit()
      Deprecated.
      Commit the audio and video sent before. When in Server VAD mode, the client does not need to use this method, the server will commit the audio automatically after detecting vad end.
    • clearAppendedAudio

      public void clearAppendedAudio()
      Deprecated.
      clear the audio sent to server before.
    • createResponse

      public void createResponse(String instructions, List<OmniRealtimeModality> modalities)
      Deprecated.
      create response, use audio and video commited before to request llm. When in Server VAD mode, the client does not need to use this method, the server will create response automatically after detecting vad and sending commit.
      Parameters:
      instructions - instructions to llm
      modalities - omni output modalities to be used in session
    • cancelResponse

      public void cancelResponse()
      Deprecated.
      cancel the current response
    • close

      public void close()
      Deprecated.
      close the connection to server
    • close

      public void close(int code, String reason)
      Deprecated.
      close the connection to server
      Parameters:
      code - websocket close code
      reason - websocket close reason
    • sendRaw

      public void sendRaw(String rawData)
      Deprecated.
      send raw data to server
      Parameters:
      rawData - raw data
    • getSessionId

      public String getSessionId()
      Deprecated.
    • getResponseId

      public String getResponseId()
      Deprecated.
    • getFirstAudioDelay

      public long getFirstAudioDelay()
      Deprecated.
    • getFirstTextDelay

      public long getFirstTextDelay()
      Deprecated.
    • onOpen

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

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

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

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

      public void onClosing(@NotNull okhttp3.WebSocket webSocket, int code, @NotNull String reason)
      Deprecated.
      Overrides:
      onClosing in class okhttp3.WebSocketListener