From e436dfb9e8c9ebc8926b4a9a6ff55f1fb137a5e9 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Thu, 4 Sep 2025 14:11:20 -0700 Subject: [PATCH] feat: add LiveServerContent.waiting_for_input flag. PiperOrigin-RevId: 803169639 --- .../java/com/google/genai/LiveConverters.java | 14 ++++++++++++++ .../google/genai/types/LiveServerContent.java | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/main/java/com/google/genai/LiveConverters.java b/src/main/java/com/google/genai/LiveConverters.java index 8868c509d7f..3ad52414675 100644 --- a/src/main/java/com/google/genai/LiveConverters.java +++ b/src/main/java/com/google/genai/LiveConverters.java @@ -2924,6 +2924,13 @@ ObjectNode liveServerContentFromMldev(JsonNode fromObject, ObjectNode parentObje toObject)); } + if (Common.getValueByPath(fromObject, new String[] {"waitingForInput"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"waitingForInput"}, + Common.getValueByPath(fromObject, new String[] {"waitingForInput"})); + } + return toObject; } @@ -3497,6 +3504,13 @@ ObjectNode liveServerContentFromVertex(JsonNode fromObject, ObjectNode parentObj toObject)); } + if (Common.getValueByPath(fromObject, new String[] {"waitingForInput"}) != null) { + Common.setValueByPath( + toObject, + new String[] {"waitingForInput"}, + Common.getValueByPath(fromObject, new String[] {"waitingForInput"})); + } + return toObject; } diff --git a/src/main/java/com/google/genai/types/LiveServerContent.java b/src/main/java/com/google/genai/types/LiveServerContent.java index b229214bf96..c3f384fb09f 100644 --- a/src/main/java/com/google/genai/types/LiveServerContent.java +++ b/src/main/java/com/google/genai/types/LiveServerContent.java @@ -87,6 +87,13 @@ public abstract class LiveServerContent extends JsonSerializable { @JsonProperty("urlContextMetadata") public abstract Optional urlContextMetadata(); + /** + * If true, indicates that the model is not generating content because it is waiting for more + * input from the user, e.g. because it expects the user to continue talking. + */ + @JsonProperty("waitingForInput") + public abstract Optional waitingForInput(); + /** Instantiates a builder for LiveServerContent. */ @ExcludeFromGeneratedCoverageReport public static Builder builder() { @@ -229,6 +236,15 @@ public Builder urlContextMetadata(UrlContextMetadata.Builder urlContextMetadataB return urlContextMetadata(urlContextMetadataBuilder.build()); } + /** + * Setter for waitingForInput. + * + *

waitingForInput: If true, indicates that the model is not generating content because it is + * waiting for more input from the user, e.g. because it expects the user to continue talking. + */ + @JsonProperty("waitingForInput") + public abstract Builder waitingForInput(boolean waitingForInput); + public abstract LiveServerContent build(); }