Skip to content

Commit d288121

Browse files
committed
Merge 'integration_2024-08-08_369430895874' into 'master'
merge branch integration_2024-08-08_369430895874 into master See merge request: !238
2 parents 42e3fe2 + 91b8b66 commit d288121

File tree

134 files changed

+14667
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+14667
-84
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<dependency>
5555
<groupId>com.volcengine</groupId>
5656
<artifactId>volcengine-java-sdk-bom</artifactId>
57-
<version>0.1.122</version>
57+
<version>0.1.123</version>
5858
<type>pom</type>
5959
<scope>import</scope>
6060
</dependency>
@@ -70,12 +70,12 @@
7070
<dependency>
7171
<groupId>com.volcengine</groupId>
7272
<artifactId>volcengine-java-sdk-vpc</artifactId>
73-
<version>0.1.122</version>
73+
<version>0.1.123</version>
7474
</dependency>
7575
<dependency>
7676
<groupId>com.volcengine</groupId>
7777
<artifactId>volcengine-java-sdk-ecs</artifactId>
78-
<version>0.1.122</version>
78+
<version>0.1.123</version>
7979
</dependency>
8080
</dependencies>
8181
```

meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"lasted": "0.1.122",
3-
"meta_commit": "5e49170560779a53a25a7106c6372ecbda1c61ab"
2+
"lasted": "0.1.123",
3+
"meta_commit": "345612ce74b502317b8b4017986c4f1ebee71586"
44
}

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.volcengine</groupId>
55
<artifactId>volcengine-java-sdk</artifactId>
66
<packaging>pom</packaging>
7-
<version>0.1.122</version>
7+
<version>0.1.123</version>
88
<name>volcengine-java-sdk</name>
99
<url>https://open.volcengineapi.com</url>
1010
<description>The Java SDK For Volcengine</description>
@@ -246,5 +246,6 @@
246246
<module>volcengine-java-sdk-iam20210801</module>
247247
<module>volcengine-java-sdk-transitrouter</module>
248248
<module>volcengine-java-sdk-sts</module>
249+
<module>volcengine-java-sdk-kms</module>
249250
</modules>
250251
</project>

volcengine-java-sdk-alb/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>volcengine-java-sdk</artifactId>
55
<groupId>com.volcengine</groupId>
6-
<version>0.1.122</version>
6+
<version>0.1.123</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

volcengine-java-sdk-ark-runtime/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>volcengine-java-sdk</artifactId>
55
<groupId>com.volcengine</groupId>
6-
<version>0.1.122</version>
6+
<version>0.1.123</version>
77
<relativePath>../pom.xml</relativePath>
88
</parent>
99
<build>

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/interceptor/RetryInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Response intercept(Chain chain) throws IOException {
2828
Response response = chain.proceed(request);
2929

3030
int tryCount = 0;
31-
while (response.code() >= 500 && tryCount < retryTimes) {
31+
while ((response.code() >= 500 || response.code() == 429) && tryCount < retryTimes) {
3232
tryCount++;
3333

3434
// retry the request

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/bot/completion/chat/BotChatCompletionRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public String toString() {
5252
", frequencyPenalty=" + getFrequencyPenalty() +
5353
", logitBias=" + getLogitBias() +
5454
", user='" + getUser() + '\'' +
55-
", functions=" + getFunctions() +
5655
", tools=" + getTools() +
5756
", functionCall=" + getFunctionCall() +
5857
", logprobs=" + getLogprobs() +
@@ -208,7 +207,6 @@ public BotChatCompletionRequest build() {
208207
botChatCompletionRequest.setFrequencyPenalty(frequencyPenalty);
209208
botChatCompletionRequest.setLogitBias(logitBias);
210209
botChatCompletionRequest.setUser(user);
211-
botChatCompletionRequest.setFunctions(functions);
212210
botChatCompletionRequest.setTools(tools);
213211
botChatCompletionRequest.setFunctionCall(functionCall);
214212
botChatCompletionRequest.setLogprobs(logprobs);

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/completion/chat/ChatCompletionRequest.java

Lines changed: 165 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.volcengine.ark.runtime.model.completion.chat;
22

33
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import com.fasterxml.jackson.databind.JsonNode;
45
import com.volcengine.ark.runtime.model.bot.completion.chat.BotChatCompletionRequest;
6+
import com.volcengine.ark.runtime.utils.JacksonUtil;
57

68
import java.util.List;
79
import java.util.Map;
@@ -86,11 +88,6 @@ public class ChatCompletionRequest {
8688
*/
8789
String user;
8890

89-
/**
90-
* A list of the available functions.
91-
*/
92-
List<ChatFunction> functions;
93-
9491
/**
9592
* A list of the available tools.
9693
*/
@@ -115,6 +112,27 @@ public class ChatCompletionRequest {
115112
@JsonProperty("top_logprobs")
116113
Integer topLogprobs;
117114

115+
@JsonProperty("repetition_penalty")
116+
Double repetitionPenalty;
117+
118+
/**
119+
* How many chat completion chatCompletionChoices to generate for each input message.
120+
*/
121+
Integer n;
122+
123+
@JsonProperty("tool_choice")
124+
Object toolChoice;
125+
126+
/**
127+
* `type` must be one of `text` or `json_object`.
128+
* If the request only specifies type=`json_object` and no schema is specified, refer to the openai behavior,
129+
* the model outputs an arbitrary json object (depending on the user's instruction in the user prompt/system prompt)
130+
*
131+
* Even if the schema is specified, still need to specify the expected json format in user prompt/system prompt
132+
*/
133+
@JsonProperty("response_format")
134+
ChatCompletionRequestResponseFormat responseFormat;
135+
118136
public String getModel() {
119137
return model;
120138
}
@@ -211,14 +229,6 @@ public void setUser(String user) {
211229
this.user = user;
212230
}
213231

214-
public List<ChatFunction> getFunctions() {
215-
return functions;
216-
}
217-
218-
public void setFunctions(List<ChatFunction> functions) {
219-
this.functions = functions;
220-
}
221-
222232
public List<ChatTool> getTools() {
223233
return tools;
224234
}
@@ -251,6 +261,38 @@ public void setTopLogprobs(Integer topLogprobs) {
251261
this.topLogprobs = topLogprobs;
252262
}
253263

264+
public Double getRepetitionPenalty() {
265+
return repetitionPenalty;
266+
}
267+
268+
public void setRepetitionPenalty(Double repetitionPenalty) {
269+
this.repetitionPenalty = repetitionPenalty;
270+
}
271+
272+
public Integer getN() {
273+
return n;
274+
}
275+
276+
public void setN(Integer n) {
277+
this.n = n;
278+
}
279+
280+
public Object getToolChoice() {
281+
return toolChoice;
282+
}
283+
284+
public void setToolChoice(Object toolChoice) {
285+
this.toolChoice = toolChoice;
286+
}
287+
288+
public ChatCompletionRequestResponseFormat getResponseFormat() {
289+
return responseFormat;
290+
}
291+
292+
public void setResponseFormat(ChatCompletionRequestResponseFormat responseFormat) {
293+
this.responseFormat = responseFormat;
294+
}
295+
254296
@Override
255297
public String toString() {
256298
return "ChatCompletionRequest{" +
@@ -266,11 +308,14 @@ public String toString() {
266308
", frequencyPenalty=" + frequencyPenalty +
267309
", logitBias=" + logitBias +
268310
", user='" + user + '\'' +
269-
", functions=" + functions +
270311
", tools=" + tools +
271312
", functionCall=" + functionCall +
272313
", logprobs=" + logprobs +
273314
", topLogprobs=" + topLogprobs +
315+
", repetitionPenalty=" + repetitionPenalty +
316+
", n=" + n +
317+
", toolChoice=" + toolChoice +
318+
", responseFormat=" + responseFormat +
274319
'}';
275320
}
276321

@@ -315,6 +360,79 @@ public void setIncludeUsage(Boolean includeUsage) {
315360
}
316361
}
317362

363+
public static class ChatCompletionRequestResponseFormat {
364+
String type;
365+
JsonNode schema;
366+
367+
public ChatCompletionRequestResponseFormat(String type) {
368+
this.type = type;
369+
}
370+
371+
public ChatCompletionRequestResponseFormat(String type, Object schema) {
372+
this.type = type;
373+
this.schema = JacksonUtil.clsToJsonNode(schema);
374+
}
375+
376+
public String getType() {
377+
return type;
378+
}
379+
380+
public void setType(String type) {
381+
this.type = type;
382+
}
383+
384+
public JsonNode getSchema() {
385+
return schema;
386+
}
387+
388+
public void setSchema(JsonNode schema) {
389+
this.schema = schema;
390+
}
391+
}
392+
393+
public static class ChatCompletionRequestToolChoice {
394+
String type;
395+
ChatCompletionRequestToolChoiceFunction function;
396+
397+
public String getType() {
398+
return type;
399+
}
400+
401+
public void setType(String type) {
402+
this.type = type;
403+
}
404+
405+
public ChatCompletionRequestToolChoiceFunction getFunction() {
406+
return function;
407+
}
408+
409+
public void setFunction(ChatCompletionRequestToolChoiceFunction function) {
410+
this.function = function;
411+
}
412+
413+
public ChatCompletionRequestToolChoice(String type, ChatCompletionRequestToolChoiceFunction function) {
414+
this.type = type;
415+
this.function = function;
416+
}
417+
418+
}
419+
420+
public static class ChatCompletionRequestToolChoiceFunction {
421+
String name;
422+
423+
public ChatCompletionRequestToolChoiceFunction(String name) {
424+
this.name = name;
425+
}
426+
427+
public String getName() {
428+
return name;
429+
}
430+
431+
public void setName(String name) {
432+
this.name = name;
433+
}
434+
}
435+
318436
public static ChatCompletionRequest.Builder builder() {
319437
return new ChatCompletionRequest.Builder();
320438
}
@@ -332,11 +450,14 @@ public static class Builder {
332450
private Double frequencyPenalty;
333451
private Map<String, Integer> logitBias;
334452
private String user;
335-
private List<ChatFunction> functions;
336453
private List<ChatTool> tools;
337454
private ChatCompletionRequestFunctionCall functionCall;
338455
private Boolean logprobs;
339456
private Integer topLogprobs;
457+
private Double repetitionPenalty;
458+
private Integer n;
459+
private Object toolChoice;
460+
private ChatCompletionRequestResponseFormat responseFormat;
340461

341462
public ChatCompletionRequest.Builder model(String model) {
342463
this.model = model;
@@ -398,11 +519,6 @@ public ChatCompletionRequest.Builder user(String user) {
398519
return this;
399520
}
400521

401-
public ChatCompletionRequest.Builder functions(List<ChatFunction> functions) {
402-
this.functions = functions;
403-
return this;
404-
}
405-
406522
public ChatCompletionRequest.Builder tools(List<ChatTool> tools) {
407523
this.tools = tools;
408524
return this;
@@ -423,6 +539,31 @@ public ChatCompletionRequest.Builder topLogprobs(Integer topLogprobs) {
423539
return this;
424540
}
425541

542+
public ChatCompletionRequest.Builder repetitionPenalty(Double repetitionPenalty) {
543+
this.repetitionPenalty = repetitionPenalty;
544+
return this;
545+
}
546+
547+
public ChatCompletionRequest.Builder n(Integer n) {
548+
this.n = n;
549+
return this;
550+
}
551+
552+
public ChatCompletionRequest.Builder toolChoice(String toolChoice) {
553+
this.toolChoice = toolChoice;
554+
return this;
555+
}
556+
557+
public ChatCompletionRequest.Builder toolChoice(ChatCompletionRequestToolChoice toolChoice) {
558+
this.toolChoice = toolChoice;
559+
return this;
560+
}
561+
562+
public ChatCompletionRequest.Builder responseFormat(ChatCompletionRequestResponseFormat responseFormat) {
563+
this.responseFormat = responseFormat;
564+
return this;
565+
}
566+
426567
public ChatCompletionRequest build() {
427568
ChatCompletionRequest chatCompletionRequest = new ChatCompletionRequest();
428569
chatCompletionRequest.setModel(model);
@@ -437,11 +578,14 @@ public ChatCompletionRequest build() {
437578
chatCompletionRequest.setFrequencyPenalty(frequencyPenalty);
438579
chatCompletionRequest.setLogitBias(logitBias);
439580
chatCompletionRequest.setUser(user);
440-
chatCompletionRequest.setFunctions(functions);
441581
chatCompletionRequest.setTools(tools);
442582
chatCompletionRequest.setFunctionCall(functionCall);
443583
chatCompletionRequest.setLogprobs(logprobs);
444584
chatCompletionRequest.setTopLogprobs(topLogprobs);
585+
chatCompletionRequest.setRepetitionPenalty(repetitionPenalty);
586+
chatCompletionRequest.setN(n);
587+
chatCompletionRequest.setToolChoice(toolChoice);
588+
chatCompletionRequest.setResponseFormat(responseFormat);
445589
return chatCompletionRequest;
446590
}
447591
}

0 commit comments

Comments
 (0)