Quick integration of the Intelligent Summary Agent
Integrate the offline Intelligent Summary Agent into your multimodal application.
Prerequisites
Activate the pay-as-you-go service for Tongyi Tingwu - Intelligent Summary and publish an intelligent summary application. You can visit the Tongyi Tingwu - Intelligent Summary console to view your application.
Configure the Intelligent Summary Agent in a multimodal application
-
In the navigation pane on the left, choose Application Configuration > Agent. On the Model Studio Application tab, click Add. In the Recommended Application section, find and select Intelligent Summary. Ensure that intent recognition is enabled for the application.
-
Click the Settings button to the right of Intelligent Summary to configure the application.
-
In the Select Tongyi Tingwu Application section, select one of your published intelligent summary applications.
-
Modify the settings for offline recording summarization. The configuration items are described as follows:
- Start command: Configure a custom command to start offline transcription, such as "start offline summary". This command can be tested in the console. Note: To avoid ambiguous intent recognition between the start command for the built-in recording skill and the start command for the Intelligent Summary Agent, we recommend that you disable the recording skill and use only the agent. Alternatively, you can use distinct phrases for each command, such as "start offline summary" for the agent.
- Exit command: A custom command to exit offline transcription. This command cannot be tested in the console because it relies on the software development kit (SDK) to update the client-side recording status.
- Pause command: A custom command to pause offline transcription. This command cannot be tested in the console because it relies on the SDK to update the client-side recording status.
- Resume command: A custom command to resume offline transcription. This command cannot be tested in the console because it relies on the SDK to update the client-side recording status.
-
Click OK. Then, save and publish the application. You can also test the real-time transcription feature using voice commands in the console.
After you link the intelligent summary application and configure the commands in the Alibaba Cloud Model Studio console, you can begin the integration process.
Overall integration flow
In a multimodal application with a configured Intelligent Summary Agent, use the SDK to implement the following flow. For sample code, see Complete flow sample code.

The flowchart shows the five commands involved in integrating the Intelligent Summary Agent into a multimodal application. The following table describes the function of each command and its supported user voice input slots.
Command Name | Command Effect | Supported Slots |
|---|---|---|
Start recording | A flag to start recording. After successful recognition, the | Supports slots for translation and the number of speakers for diarization. For example, "Start recording, translate to English, and summarize based on 3 speakers." For the meanings of the translation and speaker diarization parameters, see the following documents: |
Pause recording | A flag to pause recording. After successful recognition, the | None |
Resume recording | A flag to resume recording. After successful recognition, the | None |
End recording | A flag to end recording. After successful recognition, the | Supports slots for translation and the number of speakers for diarization. If the same slots are used as in the start recording command, the slot information from the start recording command is overwritten. |
End recording execution result | After the recording ends, the user uploads the `ossUrl` of the recording file. The multimodal application then runs the offline transcription task for the intelligent summary based on this URL. The task creation result is returned in the | None |
Note: We strongly recommend that you pass the parameters.client_info.device.uuid parameter in the Start message. This distinguishes different hardware devices under the same multimodal application. Otherwise, slots fetched from multiple hardware devices under the same application cannot be differentiated, which degrades the user experience.
Integration protocol
Client-side state design
To improve the user experience, a state machine manages the local recording status on the client. The client must maintain this state and update it when it receives different commands.
- Client states: Not Started (initial state), Recording, and Paused
- Client commands: Start recording, Pause recording, Resume recording, and End recording. These four commands control the state transitions.
Client-side State | State Code | State Transition |
|---|---|---|
Not Started | 0 | |
Recording | 1 | |
Paused | 2 |
This state is maintained in the user_defined_params.tingwu_meeting.clientRecordingStatus parameter of the multimodal interaction. You can set this state in one of the following two ways:
Name | Type | Required | Description |
|---|---|---|---|
clientRecordingStatus | string | No | The client-side recording status. For more information, see Client-side state design. If this parameter is not specified, the default value is "0". |
Start recording trigger
To trigger this command, say the custom start recording phrase in the multimodal conversation.
After the command is triggered, you will receive the start recording command in the text delivery event of the multimodal service. The command is returned as a JSON string in the output.extra_info.commands field of the event payload. An example is as follows:
{
"output": {
"extra_info": {
"commands": "[{\"intent_info\":{\"domain\":\"tingwu_meeting\",\"intent\":\"audio_recording\"},\"command_request_id\":\"multi_modal_meeting_slots#llm-***-mm_***-shanglu-123456#***#84178828aab44509\",\"name\":\"start_local_recording\"}]"
}
}
}
The commands field contains a JSON array as a string. Deserialize this string and check if the name field of any command in the array is start_local_recording. If a match is found, the start recording command was triggered successfully.
[
{
"command_request_id": "multi_modal_meeting_slots#llm-***-mm_***-shanglu-123456#***#84178828aab44509",
"name": "start_local_recording"
}
]
To reuse the WebSocket connection, call the client update event to update the client-side recording status. Set user_defined_params.tingwu_meeting.clientRecordingStatus to 1, which indicates that the client is in the Recording state.
Pause recording trigger
To trigger this command, say the custom pause recording phrase in the multimodal conversation. Note that when this command is triggered, the value of user_defined_params.tingwu_meeting.clientRecordingStatus must be 1.
- If you are in a new WebSocket connection, you can set
user_defined_params.tingwu_meeting.clientRecordingStatusto1in the Start message. - If you are in an existing WebSocket connection, ensure that
user_defined_params.tingwu_meeting.clientRecordingStatusis1. You can call the client update event to update the status.
After the command is triggered, you will receive the pause recording command in the text delivery event. The command is returned as a JSON string in the output.extra_info.commands field of the event payload. An example is as follows:
{
"output": {
"extra_info": {
"commands": "[{\"intent_info\":{\"domain\":\"tingwu_meeting\",\"intent\":\"pause_audio_recording\"},\"name\":\"pause_local_recording\"}]"
}
}
}
The commands field contains a JSON array as a string. Deserialize this string and check if the name field of any command in the array is pause_local_recording. If a match is found, the pause recording command was triggered successfully.
To reuse the WebSocket connection, call the client update event to update the client-side recording status. Set user_defined_params.tingwu_meeting.clientRecordingStatus to 2, which indicates that the client is in the Paused state.
Resume recording trigger
To trigger this command, say the custom resume recording phrase in the multimodal conversation. Note that when this command is triggered, the value of user_defined_params.tingwu_meeting.clientRecordingStatus must be 2.
When triggered, you will receive a resume recording instruction in the multi-modal text delivery event. The name field for this instruction is resume_local_recording.
To reuse the WebSocket connection, call the client update event to update the client-side recording status. Set user_defined_params.tingwu_meeting.clientRecordingStatus to 1, which indicates that the client is in the Recording state.
End recording trigger
You can trigger this instruction in a multi-modal conversation by entering your configured end-recording phrase. This requires the value of user_defined_params.tingwu_meeting.clientRecordingStatus to be 1 or 2.
After the command is triggered, you will receive the end recording command in the text delivery event. The payload.output.extra_info.commands field contains a JSON array as a string. Deserialize the string and check if the name field of any command in the array is end_local_recording. If a match is found, the end recording command was triggered successfully. The following code block shows an example of the commands response.
[
{
"intent_info": {
"domain": "tingwu_meeting",
"intent": "quit_audio_recording"
},
"command_request_id": "multi_modal_meeting_slots#llm-***-mm_***-shanglu-123456#***#84178828aab44509",
"name": "end_local_recording"
}
]
To reuse the ws link, call the client update event and set user_defined_params.tingwu_meeting.clientRecordingStatus to 0 to indicate that the client has returned to the Not Started state after recording ended.
Submit end recording execution result
In the End recording trigger section, after you deserialize the commands string, the end_local_recording command returns a command_request_id. This ID is a credential for submitting the client-side recording file. Use the RequestToRespond command of the multimodal service to submit the ossUrl of the recording file. The submission protocol is as follows:
Name | Type | Description | Example Value |
parameters.biz_params.command_results[0].command_request_id | string | The | The |
parameters.biz_params.command_results[0].invoke_result | String | The URL of the recording file submitted by the user. This is a string representation of a JSON object. The JSON object has only one key, | |
The following code block shows a JSON example:
{
"parameters": {
"biz_params": {
"command_results": [
{
"invoke_result": "{\"fileUrl\":\"https://***.oss-cn-hangzhou.aliyuncs.com/%E8%AF%95%E9%A9%BE%E6%A1%88%E4%BE%8Bsmall.wav?OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Expires=1764817795&Signature=YOUR_SIGNATURE"}",
"command_request_id": "multi_modal_meeting_slots#llm-***-mm_***-shanglu-123456#***#84178828aab44509"
}
]
}
}
}
After submission, you will receive the submission result in a text delivery event. The response contains a dataId, which is the same dataId returned by the CreateTask API of Intelligent Summary. The payload.output.extra_info.commands field of the event contains a JSON array as a string.
{
"output": {
"extra_info": {
"commands": "[{\"intent_info\":{\"domain\":\"tingwu_meeting\",\"intent\":\"quit_audio_recording\"},\"name\":\"end_local_recording_execution_res\",\"params\":[{\"name\":\"dataId\",\"value\":\"fgVnGvyXN5xA\",\"normValue\":\"fgVnGvyXN5xA\"}]}]"
}
}
}
After the commands string is deserialized into a JSON array, the result is similar to the following example. Find the command whose name is end_local_recording_execution_res. In the params array of this command, find the item whose name is dataId. The value of this item is the dataId that was returned.
[
{
"intent_info": {
"domain": "tingwu_meeting",
"intent": "quit_audio_recording"
},
"name": "end_local_recording_execution_res",
"params": [
{
"name": "dataId",
"value": "fgVnGvyXN5xA",
"normValue": "fgVnGvyXN5xA"
}
]
}
]
Get the intelligent summary result asynchronously
To retrieve the transcription result, see Get asynchronous task results through callbacks in the Intelligent Summary documentation.
For the callback protocol of Intelligent Summary in a multimodal integration, see the EventBridge callback protocol for the Intelligent Summary Agent. Find the event whose type field is tingwuagent:TaskStateUpdated:UniversalAgentResultChanged. The data field of this event contains the intelligent summary result, as described below:
| Field Name | Type | Description | Example Value |
|---|---|---|---|
agentId | string | Agent type. The value is fixed to | tingwu-meeting is the application type. |
appId | string | The multimodal application ID. | mm_*** |
taskStatus | String | The task status can be Processing, Succeeded, or Failed.
| SUCCESS |
errorCode | string | The error code. This field is present only on failure. | TSC.FileError |
errorMessage | string | The error message. This field is present only on failure. | File cannot be read. |
output | string | The intelligent summary result. This is a JSON string. Deserialize it into an object to use it. For information about the format, see the related documentation. | |
extension | string | Extra information for the intelligent summary task. | |
requestId | string | The unique ID of the request. | fa7760d*** |
Parse the output field
The deserialized output JSON string is similar to the following:
{
"autoChaptersPath": "https://***/***?***",
"customPromptPath": "https://***/***?***",
"meetingAssistancePath": "https://***/***?***",
"playbackUrl": "https://***/***?***",
"pptExtractionPath": "https://***/***?***",
"status": 0,
"summarizationPath": "https://***/***?***",
"textPolishPath": "https://***/***?***",
"transcriptionPath": "https://***/***?***",
"translationsPath": "https://***/***?***"
}
For details about the parsing protocol for each path, see Return parameters of the GetTask API for Intelligent Summary.
Parse the extension field
The deserialized extension JSON string is similar to the following:
{
"appId": "***",
"dataId": "***",
"model": "tingwu-meeting",
"userId": "***",
"userSpaceId": "***"
}
Each field is described as follows:
Field name | Meaning |
|---|---|
appId | The application ID for the Tongyi Tingwu intelligent summary. |
dataId | A unique identifier for a data object in the Tongyi Tingwu intelligent summary, such as a meeting, transcription, or record. |
model | The type of the Tongyi Tingwu agent. |
userId | The ID of the Alibaba Cloud account. |
userSpaceId | The ID of the user's workspace in Model Studio. |
Complete Flow Example Code
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.alibaba.tingwu</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.6.4</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.74</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
<!-- Java-WebSocket -->
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.3</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dashscope-sdk-java</artifactId>
<version>2.21.16</version>
</dependency>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.2.21</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>1.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.javalin</groupId>
<artifactId>javalin</artifactId>
<version>4.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.8.21</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-sse</artifactId>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator</artifactId>
<version>4.31.1</version>
</dependency>
</dependencies>
</project>
import com.alibaba.dashscope.multimodal.MultiModalDialog;
import com.alibaba.dashscope.multimodal.MultiModalDialogCallback;
import com.alibaba.dashscope.multimodal.MultiModalRequestParam;
import com.alibaba.dashscope.multimodal.State;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.JsonObject;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import javax.sound.sampled.*;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.lang.Thread.sleep;
@Slf4j
public class MultiModalMeetingOfflineSDKDemo {
@Data
public static class CommandDTO {
@JSONField(name = "intent_info")
private IntentInfo intentInfo;
@JSONField(name = "command_request_id")
private String commandRequestId;
private String name;
private JSONArray params;
@Data
public static class IntentInfo {
private String domain;
private String intent;
}
}
static int enterListeningTimes = 0;
static State.DialogState currentState;
static MultiModalDialog conversation;
static int sampleRate = 16000;
static String model = "multimodal-dialog";
static String workspaceId = "your_workspace_id"; // Replace with your workspace ID.
static String appId = "your_app_id"; // Replace with your app ID.
static String dialogId = "";
static String apiKey = "your_api_key"; // Replace with your API key.
static String localRecordedFileUrl = ""; // The fileUrl of your local audio recording file.
@Test
public void testMultimodalDuplex() throws Exception {
Constants.baseWebsocketApiUrl = "wss://dashscope.aliyuncs.com/api-ws/v1/inference";
log.info("baseWebsocketApiUrl: {}", Constants.baseWebsocketApiUrl);
/*
step1. Set the mode to duplex.
step2. Record audio from the local microphone and say the corresponding commands. At a minimum, say "Start recording" and then "Stop recording".
step3. After receiving a reply for each instruction, update the client-side state in the callback.
step4. After the recording ends, manually submit the audio for transcription. Then, get the transcription result from the callback.
*/
MultiModalRequestParam params =
MultiModalRequestParam.builder()
.customInput(MultiModalRequestParam.CustomInput.builder()
.appId(appId)
.workspaceId(workspaceId)
.dialogId("")
.build()
)
.upStream(
MultiModalRequestParam.UpStream.builder()
.mode("duplex")
.audioFormat("pcm")
.build())
.downStream(
MultiModalRequestParam.DownStream.builder()
.voice("longxiaochun_v2")
.sampleRate(sampleRate)
.build())
.clientInfo(
MultiModalRequestParam.ClientInfo.builder()
.userId("1234")
.device(MultiModalRequestParam.ClientInfo.Device.builder().uuid("1234").build())
.build())
.apiKey(apiKey)
.model(model)
.build();
log.info("params: {}", JsonUtils.toJson(params));
conversation = new MultiModalDialog(params, getCallback());
conversation.start();
while (currentState != State.DialogState.LISTENING) {
try {
sleep(100);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
// Send the audio data.
sendAudioFromLocalMicrophone(conversation);
conversation.stop();
System.out.println("############ End Test duplex ############");
}
public void sendAudioFromLocalMicrophone(MultiModalDialog conversation) throws Exception {
AudioFormat format = new AudioFormat(sampleRate, 16, 1, true, false);
DataLine.Info info = new DataLine.Info(TargetDataLine.class, format);
TargetDataLine targetLine = (TargetDataLine) AudioSystem.getLine(info);
targetLine.open(format);
targetLine.start();
byte[] buffer = new byte[3200]; // Matches the buffer of the server-side protocol.
System.out.println("Start capture audio from microphone, press Ctrl+C to stop...");
long start = System.currentTimeMillis();
int i = 0;
while (true) {
int numBytesRead = targetLine.read(buffer, 0, buffer.length);
if (numBytesRead > 0) {
conversation.sendAudioData((ByteBuffer.wrap(buffer, 0, numBytesRead)));
}
// Automatically stop sending after 1 minute.
if(System.currentTimeMillis() - start > 60000) { // Send continuously for 1 minute.
break;
}
++i;
if (i%10 == 0) {
System.out.println("Sending audio from the local microphone!");
}
Thread.sleep(100); // Control the sending rate.
}
targetLine.stop();
targetLine.close();
System.out.println("Mic audio capture ended");
}
public static MultiModalDialogCallback getCallback() {
return new MultiModalDialogCallbackImpl();
}
public static class MultiModalDialogCallbackImpl extends MultiModalDialogCallback {
@Override
public void onConnected() {}
@Override
public void onStarted(String dialogId) {
log.info("onStarted: {}, self {}", dialogId, this);
}
private void changeToNewRecordingStatus(String newStatus) {
JSONObject tingwuMeetingObj = new JSONObject();
JSONObject clientRecordingStatus = new JSONObject();
clientRecordingStatus.put("clientRecordingStatus", newStatus);
tingwuMeetingObj.put("tingwu_meeting", clientRecordingStatus);
// Call updateInfo to update the client-side recording status to "recording".
conversation.updateInfo(
MultiModalRequestParam.UpdateParams.builder()
.bizParams(MultiModalRequestParam.BizParams.builder()
.userDefinedParams(
tingwuMeetingObj
)
.build())
.build()
);
}
@Override
public void onStopped(String dialogId) {
log.info("onStopped: {}", dialogId);
}
@Override
public void onSpeechStarted(String dialogId) {
log.info("onSpeechStarted: {}", dialogId);
}
@Override
public void onSpeechEnded(String dialogId) {
log.info("onSpeechEnded: {}", dialogId);
}
@Override
public void onError(String dialogId, String errorCode, String errorMsg) {
log.error("onError: {}, {}, {}, self {}", dialogId, errorCode, errorMsg, this);
enterListeningTimes++ ; //force quit dialog test
}
@Override
public void onStateChanged(State.DialogState state) {
log.info("onStateChanged: {}", state);
currentState = state;
if (currentState == State.DialogState.LISTENING) {
enterListeningTimes++;
log.info("enterListeningTimes: {}", enterListeningTimes);
}
}
@Override
public void onSpeechAudioData(ByteBuffer audioData) {
System.out.println("Received binary message (audio data)");
}
@Override
public void onRespondingStarted(String dialogId) {
log.info("onRespondingStarted: {}", dialogId);
conversation.localRespondingStarted();
}
@Override
public void onRespondingEnded(String s, JsonObject jsonObject) {
}
@Override
public void onRespondingContent(String dialogId, JsonObject content) {
log.info("onRespondingContent: {}, {}", dialogId, content);
if (content != null && content.has("extra_info")) {
JsonObject extraInfo = content.get("extra_info").getAsJsonObject();
if (extraInfo != null && extraInfo.has("commands")) {
String commandsStr = extraInfo.get("commands").getAsString();
List<CommandDTO> commands = JSONObject.parseArray(commandsStr, CommandDTO.class);
for (CommandDTO commandDTO : commands) {
// Handle starting the recording.
if (commandDTO != null && commandDTO.getName().equals("start_local_recording")) {
changeToNewRecordingStatus("1");
}
// Handle pausing the recording.
else if (commandDTO != null && commandDTO.getName().equals("pause_local_recording")) {
changeToNewRecordingStatus("2");
}
// Handle resuming the recording.
else if (commandDTO != null && commandDTO.getName().equals("resume_local_recording")) {
changeToNewRecordingStatus("1");
}
// Handle stopping the recording.
else if (commandDTO != null && commandDTO.getName().equals("end_local_recording")) {
changeToNewRecordingStatus("0");
System.out.println("Received end_local_recording command!");
String reqId = commandDTO.getCommandRequestId();
JSONObject invokeResObj = new JSONObject();
invokeResObj.put("fileUrl", localRecordedFileUrl);
JSONObject cmdRes = new JSONObject();
cmdRes.put("command_request_id", reqId);
cmdRes.put("invoke_result", JSONObject.toJSONString(invokeResObj));
JSONArray cmdResList = new JSONArray();
cmdResList.add(cmdRes);
Map<String, Object> paasThroughParams = new HashMap<>();
paasThroughParams.put("command_results", JSONObject.toJSON(cmdResList));
// Send the execution result of the stop recording instruction.
conversation.requestToRespond(
"prompt",
"",
MultiModalRequestParam.UpdateParams.builder()
.bizParams(MultiModalRequestParam.BizParams.builder()
.passThroughParams(paasThroughParams)
.build())
.build()
);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
// Handle the transcription result after stopping the recording and submitting the file.
else if (commandDTO != null && commandDTO.getName().equals("end_local_recording_execution_res")) {
System.out.println("Received end_local_recording_execution_res command!");
System.out.println("dataId param is: " + JSONObject.toJSONString(commandDTO.getParams()));
}
}
}
}
}
@Override
public void onSpeechContent(String dialogId, JsonObject content) {
log.info("onSpeechContent: {}, {}", dialogId, content);
}
@Override
public void onRequestAccepted(String dialogId) {
log.info("onRequestAccepted: {}", dialogId);
}
@Override
public void onClosed() {
log.info("onClosed , self {}", this);
enterListeningTimes++ ;
}
}
}