Skip to content

Commit 0020a4a

Browse files
committed
fix: misc
1 parent 6095e33 commit 0020a4a

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/Const.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public class Const {
2222
public static final String TRUNCATION_STRATEGY_TYPE_LAST_HISTORY_TOKENS = "last_history_tokens";
2323
public static final String TRUNCATION_STRATEGY_TYPE_ROLLING_TOKENS = "rolling_tokens";
2424

25-
public static final String BATCH_CHAT_PATH = "/api/v3/batch/chat/completions";
25+
public static final String BATCH_PATH_PREFIX = "/api/v3/batch";
2626
public static final int MAX_RETRY_TIMES = 259200;
2727
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public BatchInterceptor() {
2121
public Response intercept(Chain chain) throws IOException {
2222
Request request = chain.request();
2323
HttpUrl url = request.url();
24-
if (!url.encodedPath().equals(BATCH_CHAT_PATH)) {
24+
if (!url.encodedPath().startsWith(BATCH_PATH_PREFIX)) {
2525
return chain.proceed(request);
2626
}
2727
String endpoint = request.header(REQUEST_MODEL);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import okhttp3.Request;
55
import okhttp3.Response;
66

7-
import java.io.IOException;
87
import java.io.InterruptedIOException;
98

109
import static com.volcengine.ark.runtime.Const.*;
@@ -73,7 +72,7 @@ public double retryInterval(int max, int remain) {
7372

7473
public int getRetryTimes(Request request) {
7574
String path = request.url().encodedPath();
76-
if (path.equals(BATCH_CHAT_PATH)) {
75+
if (path.startsWith(BATCH_PATH_PREFIX)) {
7776
return MAX_RETRY_TIMES;
7877
}
7978
return retryTimes;

0 commit comments

Comments
 (0)