Skip to content

Commit 36ac8b2

Browse files
feat(arkruntime): add bot n parameter
1 parent deac555 commit 36ac8b2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public static final class Builder extends ChatCompletionRequest.Builder {
8585
private ChatCompletionRequestFunctionCall functionCall;
8686
private Boolean logprobs;
8787
private Integer topLogprobs;
88+
private Integer n;
8889

8990
private Builder() {
9091
}
@@ -191,6 +192,11 @@ public Builder topLogprobs(Integer topLogprobs) {
191192
return this;
192193
}
193194

195+
public Builder n(Integer n) {
196+
this.n = n;
197+
return this;
198+
}
199+
194200
public BotChatCompletionRequest build() {
195201
BotChatCompletionRequest botChatCompletionRequest = new BotChatCompletionRequest();
196202
botChatCompletionRequest.setMetadata(metadata);
@@ -211,6 +217,7 @@ public BotChatCompletionRequest build() {
211217
botChatCompletionRequest.setFunctionCall(functionCall);
212218
botChatCompletionRequest.setLogprobs(logprobs);
213219
botChatCompletionRequest.setTopLogprobs(topLogprobs);
220+
botChatCompletionRequest.setN(n);
214221
return botChatCompletionRequest;
215222
}
216223
}

volcengine-java-sdk-ark-runtime/test/java/com/volcengine/ark/runtime/BotChatCompletionsExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static void main(String[] args) {
7575
BotChatCompletionRequest streamChatCompletionRequest = BotChatCompletionRequest.builder()
7676
.botId("${YOUR_BOT_ID}")
7777
.messages(streamMessages)
78+
.n(2) // n sample, default: 1
7879
.build();
7980

8081
service.streamBotChatCompletion(streamChatCompletionRequest)

0 commit comments

Comments
 (0)