Skip to content

Commit 0d1e5c7

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: update stateDelta builder input to Map from ConcurrentMap
PiperOrigin-RevId: 885570460
1 parent 8bc6b12 commit 0d1e5c7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

core/src/main/java/com/google/adk/events/EventActions.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,14 @@ public Builder skipSummarization(boolean skipSummarization) {
287287

288288
@CanIgnoreReturnValue
289289
@JsonProperty("stateDelta")
290-
public Builder stateDelta(ConcurrentMap<String, Object> value) {
291-
this.stateDelta = value;
290+
public Builder stateDelta(@Nullable Map<String, Object> value) {
291+
if (value == null) {
292+
this.stateDelta = new ConcurrentHashMap<>();
293+
} else if (value instanceof ConcurrentMap) {
294+
this.stateDelta = (ConcurrentMap<String, Object>) value;
295+
} else {
296+
this.stateDelta = new ConcurrentHashMap<>(value);
297+
}
292298
return this;
293299
}
294300

0 commit comments

Comments
 (0)