Skip to content

Commit 1cdf244

Browse files
author
BitsAdmin
committed
Merge branch 'feat/ark_context_rolling_cache' into 'integration_2025-04-17_864613236738'
feat: [development task] ark_runtime (1163304) See merge request iaasng/volcengine-java-sdk!445
2 parents cca9825 + 3e20996 commit 1cdf244

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/context/TruncationStrategy.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ public class TruncationStrategy {
1515
@JsonProperty("rolling_tokens")
1616
private Boolean rollingTokens;
1717

18+
@JsonProperty("max_window_tokens")
19+
private Integer maxWindowTokens;
20+
21+
@JsonProperty("rolling_window_tokens")
22+
private Integer rollingWindowTokens;
23+
1824
public TruncationStrategy() {
1925
}
2026

@@ -47,6 +53,22 @@ public void setRollingTokens(Boolean rollingTokens) {
4753
this.rollingTokens = rollingTokens;
4854
}
4955

56+
public Integer getMaxWindowTokens() {
57+
return maxWindowTokens;
58+
}
59+
60+
public void setMaxWindowTokens(Integer maxWindowTokens) {
61+
this.maxWindowTokens = maxWindowTokens;
62+
}
63+
64+
public Integer getRollingWindowTokens() {
65+
return rollingWindowTokens;
66+
}
67+
68+
public void setRollingWindowTokens(Integer rollingWindowTokens) {
69+
this.rollingWindowTokens = rollingWindowTokens;
70+
}
71+
5072
@Override
5173
public String toString() {
5274
return "TruncationStrategy{" +
@@ -64,6 +86,8 @@ public static class Builder {
6486
private Integer lastHistoryTokens;
6587
private String type;
6688
private Boolean rollingTokens;
89+
private Integer maxWindowTokens;
90+
private Integer rollingWindowTokens;
6791

6892
private Builder() {
6993
}
@@ -83,11 +107,23 @@ public Builder rollingTokens(Boolean RollingTokens) {
83107
return this;
84108
}
85109

110+
public Builder maxWindowTokens(Integer MaxWindowTokens) {
111+
this.maxWindowTokens = MaxWindowTokens;
112+
return this;
113+
}
114+
115+
public Builder rollingWindowTokens(Integer RollingWindowTokens) {
116+
this.rollingWindowTokens = RollingWindowTokens;
117+
return this;
118+
}
119+
86120
public TruncationStrategy build() {
87121
TruncationStrategy truncationStrategy = new TruncationStrategy();
88122
truncationStrategy.setLastHistoryTokens(lastHistoryTokens);
89123
truncationStrategy.setType(type);
90124
truncationStrategy.setRollingTokens(rollingTokens);
125+
truncationStrategy.setMaxWindowTokens(maxWindowTokens);
126+
truncationStrategy.setRollingWindowTokens(rollingWindowTokens);
91127
return truncationStrategy;
92128
}
93129
}

0 commit comments

Comments
 (0)