Class OmniRealtimeConversation
java.lang.Object
okhttp3.WebSocketListener
com.alibaba.dashscope.legacy_2x.audio.omni.OmniRealtimeConversation
Deprecated.
- Author:
- lengjiayi
-
Constructor Summary
ConstructorsConstructorDescriptionOmniRealtimeConversation(OmniRealtimeParam param, OmniRealtimeCallback callback) Deprecated.Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidappendAudio(String audioBase64) Deprecated.send audio in base64 formatvoidappendVideo(String videoBase64) Deprecated.send one image frame in video in base64 formatvoidDeprecated.cancel the current responsevoidDeprecated.Omni APIsvoidDeprecated.clear the audio sent to server before.voidclose()Deprecated.close the connection to servervoidDeprecated.close the connection to servervoidcommit()Deprecated.Commit the audio and video sent before.voidconnect()Deprecated.Connect to server, create session and return default session configurationvoidcreateItem(com.google.gson.JsonObject item) Deprecated.send item to server by event conversation.item.createvoidcreateResponse(String instructions, List<OmniRealtimeModality> modalities) Deprecated.create response, use audio and video commited before to request llm.voidDeprecated.voidendSession(int timeout) Deprecated.voidDeprecated.longDeprecated.longDeprecated.Deprecated.Deprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidonOpen(okhttp3.WebSocket webSocket, okhttp3.Response response) Deprecated.WebSocket callbacksvoidDeprecated.send raw data to servervoidupdateSession(OmniRealtimeConfig config) Deprecated.Update session configuration, should be used before create responseMethods inherited from class okhttp3.WebSocketListener
onMessage
-
Constructor Details
-
OmniRealtimeConversation
Deprecated.Constructor- Parameters:
param- apikey, model, url, etc.callback- callback
-
-
Method Details
-
checkStatus
public void checkStatus()Deprecated.Omni APIs -
connect
Deprecated.Connect to server, create session and return default session configuration -
endSession
Deprecated.- Throws:
InterruptedException
-
endSession
Deprecated.- Throws:
InterruptedException
-
endSessionAsync
public void endSessionAsync()Deprecated. -
updateSession
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
Deprecated.send audio in base64 format- Parameters:
audioBase64- base64 audio string
-
appendVideo
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
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 llmmodalities- 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
Deprecated.close the connection to server- Parameters:
code- websocket close codereason- websocket close reason
-
sendRaw
Deprecated.send raw data to server- Parameters:
rawData- raw data
-
getSessionId
Deprecated. -
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:
onOpenin classokhttp3.WebSocketListener
-
onMessage
Deprecated.- Overrides:
onMessagein classokhttp3.WebSocketListener
-
onClosed
Deprecated.- Overrides:
onClosedin classokhttp3.WebSocketListener
-
onFailure
Deprecated.- Overrides:
onFailurein classokhttp3.WebSocketListener
-
onClosing
Deprecated.- Overrides:
onClosingin classokhttp3.WebSocketListener
-