diff --git a/core/src/main/java/com/google/adk/events/EventActions.java b/core/src/main/java/com/google/adk/events/EventActions.java index 1ca856b45..3565c3e99 100644 --- a/core/src/main/java/com/google/adk/events/EventActions.java +++ b/core/src/main/java/com/google/adk/events/EventActions.java @@ -287,8 +287,14 @@ public Builder skipSummarization(boolean skipSummarization) { @CanIgnoreReturnValue @JsonProperty("stateDelta") - public Builder stateDelta(ConcurrentMap value) { - this.stateDelta = value; + public Builder stateDelta(@Nullable Map value) { + if (value == null) { + this.stateDelta = new ConcurrentHashMap<>(); + } else if (value instanceof ConcurrentMap) { + this.stateDelta = (ConcurrentMap) value; + } else { + this.stateDelta = new ConcurrentHashMap<>(value); + } return this; }