Skip to content

Commit 9d7c55e

Browse files
Merge 'feature/doubaoapp' into 'feat/support-audio-1-5-pro'
Add missing ItemType constants for knowledge_search_call and doubao_app_call See merge request: !770
2 parents 5972aea + 1db191f commit 9d7c55e

31 files changed

+2366
-2
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public class ResponsesConstants {
2323
public static final String ITEM_TYPE_MCP_APPROVAL_RESPONSE = "mcp_approval_response";
2424
public static final String ITEM_TYPE_MCP_LIST_TOOLS = "mcp_list_tools";
2525
public static final String ITEM_TYPE_MCP_CALL = "mcp_call";
26+
public static final String ITEM_TYPE_KNOWLEDGE_SEARCH_CALL = "knowledge_search_call";
27+
public static final String ITEM_TYPE_DOUBAO_APP_CALL = "doubao_app_call";
2628

2729
// MessageRole.Enum
2830
public static final String MESSAGE_ROLE_USER = "user";
@@ -75,6 +77,7 @@ public class ResponsesConstants {
7577
public static final String TOOL_TYPE_WEB_SEARCH = "web_search";
7678
public static final String TOOL_TYPE_IMAGE_PROCESS = "image_process";
7779
public static final String TOOL_TYPE_MCP = "mcp";
80+
public static final String TOOL_TYPE_DOUBAO_APP = "doubao_app";
7881

7982
// UserLocationType.Enum
8083
public static final String USER_LOCATION_TYPE_APPROXIMATE = "approximate";
@@ -136,6 +139,23 @@ public class ResponsesConstants {
136139
public static final String EVENT_TYPE_RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed";
137140
public static final String EVENT_TYPE_RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed";
138141

142+
// Doubao app events
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";
158+
139159
// IncludeType.Enum
140160
public static final String INCLUDE_TYPE_IMAGE_URL = "message.input_image.image_url";
141161

@@ -147,6 +167,17 @@ public class ResponsesConstants {
147167
public static final String MCP_APPROVAL_MODE_ALWAYS = "always";
148168
public static final String MCP_APPROVAL_MODE_NEVER = "never";
149169

170+
// DoubaoAppBlockType.Enum
171+
public static final String DOBAO_APP_BLOCK_TYPE_OUTPUT_TEXT = "output_text";
172+
public static final String DOBAO_APP_BLOCK_TYPE_REASONING_TEXT = "reasoning_text";
173+
public static final String DOBAO_APP_BLOCK_TYPE_SEARCH = "search";
174+
public static final String DOBAO_APP_BLOCK_TYPE_REASONING_SEARCH = "reasoning_search";
175+
176+
// ResponseDoubaoAppFeatureType.Enum
177+
public static final String RESPONSE_DOBAO_APP_FEATURE_TYPE_UNSPECIFIED = "unspecified";
178+
public static final String RESPONSE_DOBAO_APP_FEATURE_TYPE_ENABLED = "enabled";
179+
public static final String RESPONSE_DOBAO_APP_FEATURE_TYPE_DISABLED = "disabled";
180+
150181
private ResponsesConstants() {
151182
// Prevent instantiation
152183
}

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.volcengine.ark.runtime.model.responses.event.doubaoapp;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import com.volcengine.ark.runtime.model.responses.constant.ResponsesConstants;
5+
import com.volcengine.ark.runtime.model.responses.event.ItemEvent;
6+
import com.volcengine.ark.runtime.model.responses.item.doubaoapp.DoubaoAppCallBlock;
7+
8+
public class DoubaoAppCallBlockAddedEvent extends ItemEvent {
9+
10+
@JsonProperty("block")
11+
private DoubaoAppCallBlock block;
12+
13+
public DoubaoAppCallBlockAddedEvent() {
14+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_ADDED);
15+
}
16+
17+
public DoubaoAppCallBlock getBlock() {
18+
return block;
19+
}
20+
21+
public void setBlock(DoubaoAppCallBlock block) {
22+
this.block = block;
23+
}
24+
25+
@Override
26+
public String toString() {
27+
return "DoubaoAppCallBlockAddedEvent{" +
28+
"type='" + getType() + '\'' +
29+
", block=" + block +
30+
", itemId='" + getItemId() + '\'' +
31+
", outputIndex=" + getOutputIndex() +
32+
", sequenceNumber=" + getSequenceNumber() +
33+
'}';
34+
}
35+
36+
public static Builder builder() {
37+
return new Builder();
38+
}
39+
40+
public static class Builder {
41+
42+
private DoubaoAppCallBlockAddedEvent event = new DoubaoAppCallBlockAddedEvent();
43+
44+
public Builder block(DoubaoAppCallBlock block) {
45+
event.setBlock(block);
46+
return this;
47+
}
48+
49+
public DoubaoAppCallBlockAddedEvent build() {
50+
return event;
51+
}
52+
}
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.volcengine.ark.runtime.model.responses.event.doubaoapp;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import com.volcengine.ark.runtime.model.responses.constant.ResponsesConstants;
5+
import com.volcengine.ark.runtime.model.responses.event.ItemEvent;
6+
import com.volcengine.ark.runtime.model.responses.item.doubaoapp.DoubaoAppCallBlock;
7+
8+
public class DoubaoAppCallBlockDoneEvent extends ItemEvent {
9+
10+
@JsonProperty("block")
11+
private DoubaoAppCallBlock block;
12+
13+
public DoubaoAppCallBlockDoneEvent() {
14+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_BLOCK_DONE);
15+
}
16+
17+
public DoubaoAppCallBlock getBlock() {
18+
return block;
19+
}
20+
21+
public void setBlock(DoubaoAppCallBlock block) {
22+
this.block = block;
23+
}
24+
25+
@Override
26+
public String toString() {
27+
return "DoubaoAppCallBlockDoneEvent{" +
28+
"type='" + getType() + '\'' +
29+
", block=" + block +
30+
", itemId='" + getItemId() + '\'' +
31+
", outputIndex=" + getOutputIndex() +
32+
", sequenceNumber=" + getSequenceNumber() +
33+
'}';
34+
}
35+
36+
public static Builder builder() {
37+
return new Builder();
38+
}
39+
40+
public static class Builder {
41+
42+
private DoubaoAppCallBlockDoneEvent event = new DoubaoAppCallBlockDoneEvent();
43+
44+
public Builder block(DoubaoAppCallBlock block) {
45+
event.setBlock(block);
46+
return this;
47+
}
48+
49+
public DoubaoAppCallBlockDoneEvent build() {
50+
return event;
51+
}
52+
}
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package com.volcengine.ark.runtime.model.responses.event.doubaoapp;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import com.volcengine.ark.runtime.model.responses.constant.ResponsesConstants;
5+
import com.volcengine.ark.runtime.model.responses.event.ItemEvent;
6+
import com.volcengine.ark.runtime.model.responses.item.doubaoapp.DoubaoAppCallBlock;
7+
8+
import java.util.List;
9+
10+
public class DoubaoAppCallCompletedEvent extends ItemEvent {
11+
12+
@JsonProperty("feature")
13+
private String feature;
14+
15+
@JsonProperty("blocks")
16+
private List<DoubaoAppCallBlock> blocks;
17+
18+
public DoubaoAppCallCompletedEvent() {
19+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_COMPLETED);
20+
}
21+
22+
public String getFeature() {
23+
return feature;
24+
}
25+
26+
public void setFeature(String feature) {
27+
this.feature = feature;
28+
}
29+
30+
public List<DoubaoAppCallBlock> getBlocks() {
31+
return blocks;
32+
}
33+
34+
public void setBlocks(List<DoubaoAppCallBlock> blocks) {
35+
this.blocks = blocks;
36+
}
37+
38+
@Override
39+
public String toString() {
40+
return "DoubaoAppCallCompletedEvent{" +
41+
"type='" + getType() + '\'' +
42+
", feature='" + feature + '\'' +
43+
", blocks=" + blocks +
44+
", itemId='" + getItemId() + '\'' +
45+
", outputIndex=" + getOutputIndex() +
46+
", sequenceNumber=" + getSequenceNumber() +
47+
'}';
48+
}
49+
50+
public static Builder builder() {
51+
return new Builder();
52+
}
53+
54+
public static class Builder {
55+
56+
private DoubaoAppCallCompletedEvent event = new DoubaoAppCallCompletedEvent();
57+
58+
public Builder feature(String feature) {
59+
event.setFeature(feature);
60+
return this;
61+
}
62+
63+
public Builder blocks(List<DoubaoAppCallBlock> blocks) {
64+
event.setBlocks(blocks);
65+
return this;
66+
}
67+
68+
public DoubaoAppCallCompletedEvent build() {
69+
return event;
70+
}
71+
}
72+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.volcengine.ark.runtime.model.responses.event.doubaoapp;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import com.volcengine.ark.runtime.model.responses.constant.ResponsesConstants;
5+
import com.volcengine.ark.runtime.model.responses.event.ItemEvent;
6+
7+
public class DoubaoAppCallFailedEvent extends ItemEvent {
8+
9+
@JsonProperty("error_message")
10+
private String errorMessage;
11+
12+
public DoubaoAppCallFailedEvent() {
13+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_FAILED);
14+
}
15+
16+
public String getErrorMessage() {
17+
return errorMessage;
18+
}
19+
20+
public void setErrorMessage(String errorMessage) {
21+
this.errorMessage = errorMessage;
22+
}
23+
24+
@Override
25+
public String toString() {
26+
return "DoubaoAppCallFailedEvent{" +
27+
"type='" + getType() + '\'' +
28+
", errorMessage='" + errorMessage + '\'' +
29+
", itemId='" + getItemId() + '\'' +
30+
", outputIndex=" + getOutputIndex() +
31+
", sequenceNumber=" + getSequenceNumber() +
32+
'}';
33+
}
34+
35+
public static Builder builder() {
36+
return new Builder();
37+
}
38+
39+
public static class Builder {
40+
41+
private DoubaoAppCallFailedEvent event = new DoubaoAppCallFailedEvent();
42+
43+
public Builder errorMessage(String errorMessage) {
44+
event.setErrorMessage(errorMessage);
45+
return this;
46+
}
47+
48+
public DoubaoAppCallFailedEvent build() {
49+
return event;
50+
}
51+
}
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.volcengine.ark.runtime.model.responses.event.doubaoapp;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import com.volcengine.ark.runtime.model.responses.constant.ResponsesConstants;
5+
import com.volcengine.ark.runtime.model.responses.event.ItemEvent;
6+
7+
public class DoubaoAppCallInProgressEvent extends ItemEvent {
8+
9+
@JsonProperty("feature")
10+
private String feature;
11+
12+
public DoubaoAppCallInProgressEvent() {
13+
super(ResponsesConstants.EVENT_TYPE_RESPONSE_DOUBAO_APP_CALL_IN_PROGRESS);
14+
}
15+
16+
public String getFeature() {
17+
return feature;
18+
}
19+
20+
public void setFeature(String feature) {
21+
this.feature = feature;
22+
}
23+
24+
@Override
25+
public String toString() {
26+
return "DoubaoAppCallInProgressEvent{" +
27+
"type='" + getType() + '\'' +
28+
", feature='feature'" +
29+
", itemId='" + getItemId() + '\'' +
30+
", outputIndex=" + getOutputIndex() +
31+
", sequenceNumber=" + getSequenceNumber() +
32+
'}';
33+
}
34+
35+
public static Builder builder() {
36+
return new Builder();
37+
}
38+
39+
public static class Builder {
40+
41+
private DoubaoAppCallInProgressEvent event = new DoubaoAppCallInProgressEvent();
42+
43+
public Builder feature(String feature) {
44+
event.setFeature(feature);
45+
return this;
46+
}
47+
48+
public DoubaoAppCallInProgressEvent build() {
49+
return event;
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)