Class MultiModalDialog

java.lang.Object
com.alibaba.dashscope.legacy_2x.multimodal.MultiModalDialog

@Deprecated public class MultiModalDialog extends Object
Deprecated.
Multimodal Dialog class responsible for handling various operations in multimodal conversations.

author songsong.shao date 2025/4/24

  • Constructor Details

    • MultiModalDialog

      public MultiModalDialog(MultiModalRequestParam param, MultiModalDialogCallback callback)
      Deprecated.
      Constructor initializes service options and creates a duplex communication API instance.

      param: param Request parameter param: callback Callback interface

    • MultiModalDialog

      public MultiModalDialog(MultiModalRequestParam param, MultiModalDialogCallback callback, ConnectionOptions connectionOptions)
      Deprecated.
      Constructor initializes service options and creates a duplex communication API instance.

      param: param Request parameter param: callback Callback interface param: connectionOptions Connection options

    • MultiModalDialog

      public MultiModalDialog(MultiModalRequestParam param, MultiModalDialogCallback callback, ApiServiceOption serviceOption)
      Deprecated.
      Constructor allows custom service options.

      param: param Request parameter param: callback Callback interface param: serviceOption Custom service options

  • Method Details

    • start

      public void start()
      Deprecated.
      Starts the dialog session.
    • startSpeech

      public void startSpeech()
      Deprecated.
      Starts upload speech.
    • stopSpeech

      public void stopSpeech()
      Deprecated.
      Stops upload speech.
    • interrupt

      public void interrupt()
      Deprecated.
      Interrupts current operation.
    • localRespondingStarted

      public void localRespondingStarted()
      Deprecated.
      Local player start broadcast tts
    • localRespondingEnded

      public void localRespondingEnded()
      Deprecated.
      Local player broadcast tts end
    • sendHeartBeat

      public void sendHeartBeat()
      Deprecated.
      send heart beat request ,will respond heart beat
    • requestToRespond

      public void requestToRespond(String type, String text, MultiModalRequestParam.UpdateParams updateParams)
      Deprecated.
      Requests response.

      param: type Response type param: text Response text param: updateParams Update parameters

    • updateInfo

      public void updateInfo(MultiModalRequestParam.UpdateParams updateParams)
      Deprecated.
      Updates information.

      param: updateParams Update parameters

    • stop

      public void stop()
      Deprecated.
      Stops the MultiModalDialog gracefully. Sends a finish message to the server and waits for the server to acknowledge. If the server does not respond within the timeout (30s), falls back to force close.

      This method is safe to call after onError — it will not deadlock.

    • close

      public void close()
      Deprecated.
      Force closes the dialog immediately without sending any message to the server. Safe to call from any callback thread (including onError/onStopped). Does not block.

      This method: - Nullifies emitter to prevent further data sending - Disposes upstream subscription to stop sendBinaryWithRetry - Forces WebSocket cancel (non-blocking) - Sets isClosed to short-circuit any reconnection loops in progress - Releases stopLatch to unblock any thread waiting in stop()

    • getDialogState

      public State.DialogState getDialogState()
      Deprecated.
      Gets current dialogue state.

      return: Current dialogue state

    • sendAudioData

      public void sendAudioData(ByteBuffer audioFrame)
      Deprecated.
      Sends audio frame.

      param: audioFrame Audio frame data

    • getDuplexApi

      Deprecated.