Skip to content

Commit f5903ea

Browse files
author
hexiaochun
committed
feat: add service_tier
1 parent 381ce0b commit f5903ea

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public class ChatCompletionRequest {
4848
@JsonProperty("stream_options")
4949
ChatCompletionRequestStreamOptions streamOptions;
5050

51+
/**
52+
* Specifies the latency tier to use for processing the request.
53+
* This parameter is relevant for customers subscribed to the scale tier service
54+
*/
55+
@JsonProperty("service_tier")
56+
String serviceTier;
57+
5158
/**
5259
* Up to 4 sequences where the API will stop generating further tokens.
5360
*/
@@ -181,6 +188,14 @@ public void setStreamOptions(ChatCompletionRequestStreamOptions streamOptions) {
181188
this.streamOptions = streamOptions;
182189
}
183190

191+
public String getServiceTier() {
192+
return serviceTier;
193+
}
194+
195+
public void setServiceTier(String serviceTier) {
196+
this.serviceTier = serviceTier;
197+
}
198+
184199
public List<String> getStop() {
185200
return stop;
186201
}
@@ -302,6 +317,7 @@ public String toString() {
302317
", topP=" + topP +
303318
", stream=" + stream +
304319
", streamOptions=" + streamOptions +
320+
", serviceTier=" + serviceTier +
305321
", stop=" + stop +
306322
", maxTokens=" + maxTokens +
307323
", presencePenalty=" + presencePenalty +
@@ -444,6 +460,7 @@ public static class Builder {
444460
private Double topP;
445461
private Boolean stream;
446462
private ChatCompletionRequestStreamOptions streamOptions;
463+
private String serviceTier;
447464
private List<String> stop;
448465
private Integer maxTokens;
449466
private Double presencePenalty;
@@ -489,6 +506,11 @@ public ChatCompletionRequest.Builder streamOptions(ChatCompletionRequestStreamOp
489506
return this;
490507
}
491508

509+
public ChatCompletionRequest.Builder serviceTier(String serviceTier) {
510+
this.serviceTier = serviceTier;
511+
return this;
512+
}
513+
492514
public ChatCompletionRequest.Builder stop(List<String> stop) {
493515
this.stop = stop;
494516
return this;
@@ -572,6 +594,7 @@ public ChatCompletionRequest build() {
572594
chatCompletionRequest.setTopP(topP);
573595
chatCompletionRequest.setStream(stream);
574596
chatCompletionRequest.setStreamOptions(streamOptions);
597+
chatCompletionRequest.setServiceTier(serviceTier);
575598
chatCompletionRequest.setStop(stop);
576599
chatCompletionRequest.setMaxTokens(maxTokens);
577600
chatCompletionRequest.setPresencePenalty(presencePenalty);

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.volcengine.ark.runtime.model.completion.chat;
22

3+
import com.fasterxml.jackson.annotation.JsonAlias;
34
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
45
import com.volcengine.ark.runtime.model.Usage;
56

@@ -28,6 +29,12 @@ public class ChatCompletionResult {
2829
*/
2930
String model;
3031

32+
/**
33+
* The service tier used for processing the request.
34+
*/
35+
@JsonAlias("service_tier")
36+
String serviceTier;
37+
3138
/**
3239
* A list of all generated completions.
3340
*/
@@ -70,6 +77,14 @@ public void setModel(String model) {
7077
this.model = model;
7178
}
7279

80+
public String getServiceTier() {
81+
return serviceTier;
82+
}
83+
84+
public void setServiceTier(String serviceTier) {
85+
this.serviceTier = serviceTier;
86+
}
87+
7388
public List<ChatCompletionChoice> getChoices() {
7489
return choices;
7590
}

0 commit comments

Comments
 (0)