Skip to content

Commit 0fe52ec

Browse files
luminghao-bytedancewgzesg-bd
authored andcommitted
feat: add doubao app call example
1 parent fdca298 commit 0fe52ec

18 files changed

+283
-31
lines changed

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/constant/ResponsesConstants.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,21 @@ public class ResponsesConstants {
140140
public static final String EVENT_TYPE_RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed";
141141

142142
// Doubao app events
143-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_IN_PROGRESS = "response.doubao_app_call.in_progress";
144-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_COMPLETED = "response.doubao_app_call.completed";
145-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_FAILED = "response.doubao_app_call.failed";
146-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_OUTPUT_TEXT_DELTA = "response.doubao_app_call.output_text.delta";
147-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_OUTPUT_TEXT_DONE = "response.doubao_app_call.output_text.done";
148-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_SEARCH_IN_PROGRESS = "response.doubao_app_call.search.in_progress";
149-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_SEARCH_SEARCHING = "response.doubao_app_call.search.searching";
150-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_SEARCH_COMPLETED = "response.doubao_app_call.search.completed";
151-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_REASONING_TEXT_DELTA = "response.doubao_app_call.reasoning_text.delta";
152-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_REASONING_TEXT_DONE = "response.doubao_app_call.reasoning_text.done";
153-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_REASONING_SEARCH_IN_PROGRESS = "response.doubao_app_call.reasoning_search.in_progress";
154-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_REASONING_SEARCH_SEARCHING = "response.doubao_app_call.reasoning_search.searching";
155-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_REASONING_SEARCH_COMPLETED = "response.doubao_app_call.reasoning_search.completed";
156-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_BLOCK_ADDED = "response.doubao_app_call.block.added";
157-
public static final String EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_BLOCK_DONE = "response.doubao_app_call.block.done";
143+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_IN_PROGRESS = "response.doubao_app_call.in_progress";
144+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_COMPLETED = "response.doubao_app_call.completed";
145+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_FAILED = "response.doubao_app_call.failed";
146+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_OUTPUT_TEXT_DELTA = "response.doubao_app_call_output_text.delta";
147+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_OUTPUT_TEXT_DONE = "response.doubao_app_call_output_text.done";
148+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_SEARCH_IN_PROGRESS = "response.doubao_app_call_search.in_progress";
149+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_SEARCH_SEARCHING = "response.doubao_app_call_search.searching";
150+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_SEARCH_COMPLETED = "response.doubao_app_call_search.completed";
151+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_TEXT_DELTA = "response.doubao_app_call_reasoning_text.delta";
152+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_TEXT_DONE = "response.doubao_app_call_reasoning_text.done";
153+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_SEARCH_IN_PROGRESS = "response.doubao_app_call_reasoning_search.in_progress";
154+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_SEARCH_SEARCHING = "response.doubao_app_call_reasoning_search.searching";
155+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_SEARCH_COMPLETED = "response.doubao_app_call_reasoning_search.completed";
156+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_ADDED = "response.doubao_app_call_block.added";
157+
public static final String EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_DONE = "response.doubao_app_call_block.done";
158158

159159
// IncludeType.Enum
160160
public static final String INCLUDE_TYPE_IMAGE_URL = "message.input_image.image_url";

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/StreamEvent.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.fasterxml.jackson.annotation.JsonSubTypes;
66
import com.fasterxml.jackson.annotation.JsonTypeInfo;
77
import com.volcengine.ark.runtime.model.responses.constant.ResponsesConstants;
8+
import com.volcengine.ark.runtime.model.responses.event.doubaoapp.*;
89
import com.volcengine.ark.runtime.model.responses.event.mcp.*;
910
import com.volcengine.ark.runtime.model.responses.event.outputtext.AnnotationAddedEvent;
1011
import com.volcengine.ark.runtime.model.responses.event.contentpart.ContentPartAddedEvent;
@@ -69,7 +70,21 @@
6970
@JsonSubTypes.Type(value = MCPCallArgumentsDoneEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_MCP_CALL_ARGUMENTS_DONE),
7071
@JsonSubTypes.Type(value = MCPCallCompletedEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_MCP_CALL_COMPLETED),
7172
@JsonSubTypes.Type(value = MCPCallFailedEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_MCP_CALL_FAILED),
72-
73+
@JsonSubTypes.Type(value = DoubaoAppCallInProgressEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_IN_PROGRESS),
74+
@JsonSubTypes.Type(value = DoubaoAppCallCompletedEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_COMPLETED),
75+
@JsonSubTypes.Type(value = DoubaoAppCallFailedEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_FAILED),
76+
@JsonSubTypes.Type(value = DoubaoAppCallBlockAddedEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_ADDED),
77+
@JsonSubTypes.Type(value = DoubaoAppCallBlockDoneEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_DONE),
78+
@JsonSubTypes.Type(value = DoubaoAppCallOutputTextDeltaEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_OUTPUT_TEXT_DELTA),
79+
@JsonSubTypes.Type(value = DoubaoAppCallOutputTextDoneEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_OUTPUT_TEXT_DONE),
80+
@JsonSubTypes.Type(value = DoubaoAppCallReasoningTextDeltaEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_TEXT_DELTA),
81+
@JsonSubTypes.Type(value = DoubaoAppCallReasoningTextDoneEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_TEXT_DONE),
82+
@JsonSubTypes.Type(value = DoubaoAppCallSearchInProgressEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_SEARCH_IN_PROGRESS),
83+
@JsonSubTypes.Type(value = DoubaoAppCallSearchSearchingEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_SEARCH_SEARCHING),
84+
@JsonSubTypes.Type(value = DoubaoAppCallSearchCompletedEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_SEARCH_COMPLETED),
85+
@JsonSubTypes.Type(value = DoubaoAppCallReasoningSearchInProgressEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_SEARCH_IN_PROGRESS),
86+
@JsonSubTypes.Type(value = DoubaoAppCallReasoningSearchSearchingEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_SEARCH_SEARCHING),
87+
@JsonSubTypes.Type(value = DoubaoAppCallReasoningSearchCompletedEvent.class, name = ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_SEARCH_COMPLETED),
7388
})
7489
public abstract class StreamEvent {
7590

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallBlockAddedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class DoubaoAppCallBlockAddedEvent extends ItemEvent {
1111
private DoubaoAppCallBlock block;
1212

1313
public DoubaoAppCallBlockAddedEvent() {
14-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_BLOCK_ADDED);
14+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_ADDED);
1515
}
1616

1717
public DoubaoAppCallBlock getBlock() {

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallBlockDoneEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class DoubaoAppCallBlockDoneEvent extends ItemEvent {
1111
private DoubaoAppCallBlock block;
1212

1313
public DoubaoAppCallBlockDoneEvent() {
14-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_BLOCK_DONE);
14+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_DONE);
1515
}
1616

1717
public DoubaoAppCallBlock getBlock() {

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallCompletedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class DoubaoAppCallCompletedEvent extends ItemEvent {
1616
private List<DoubaoAppCallBlock> blocks;
1717

1818
public DoubaoAppCallCompletedEvent() {
19-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_COMPLETED);
19+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_COMPLETED);
2020
}
2121

2222
public String getFeature() {

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallFailedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class DoubaoAppCallFailedEvent extends ItemEvent {
1010
private String errorMessage;
1111

1212
public DoubaoAppCallFailedEvent() {
13-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_FAILED);
13+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_FAILED);
1414
}
1515

1616
public String getErrorMessage() {

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallInProgressEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class DoubaoAppCallInProgressEvent extends ItemEvent {
1010
private String feature;
1111

1212
public DoubaoAppCallInProgressEvent() {
13-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_IN_PROGRESS);
13+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_IN_PROGRESS);
1414
}
1515

1616
public String getFeature() {

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallOutputTextDeltaEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class DoubaoAppCallOutputTextDeltaEvent extends ItemEvent {
1313
private String delta;
1414

1515
public DoubaoAppCallOutputTextDeltaEvent() {
16-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_OUTPUT_TEXT_DELTA);
16+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_OUTPUT_TEXT_DELTA);
1717
}
1818

1919
public Long getBlockIndex() {

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallOutputTextDoneEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class DoubaoAppCallOutputTextDoneEvent extends ItemEvent {
1313
private String text;
1414

1515
public DoubaoAppCallOutputTextDoneEvent() {
16-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_OUTPUT_TEXT_DONE);
16+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_OUTPUT_TEXT_DONE);
1717
}
1818

1919
public Long getBlockIndex() {

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/responses/event/doubaoapp/DoubaoAppCallReasoningSearchCompletedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class DoubaoAppCallReasoningSearchCompletedEvent extends ItemEvent {
2222
private List<DoubaoAppSearchResult> results;
2323

2424
public DoubaoAppCallReasoningSearchCompletedEvent() {
25-
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOBAO_APP_CALL_REASONING_SEARCH_COMPLETED);
25+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_REASONING_SEARCH_COMPLETED);
2626
}
2727

2828
public Long getBlockIndex() {

0 commit comments

Comments
 (0)