Skip to content

Commit 2fe94ae

Browse files
MarkDaoustcopybara-github
authored andcommitted
feat: add LiveServerContent.waiting_for_input flag.
PiperOrigin-RevId: 803169639
1 parent 12ddfce commit 2fe94ae

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/main/java/com/google/genai/LiveConverters.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2924,6 +2924,13 @@ ObjectNode liveServerContentFromMldev(JsonNode fromObject, ObjectNode parentObje
29242924
toObject));
29252925
}
29262926

2927+
if (Common.getValueByPath(fromObject, new String[] {"waitingForInput"}) != null) {
2928+
Common.setValueByPath(
2929+
toObject,
2930+
new String[] {"waitingForInput"},
2931+
Common.getValueByPath(fromObject, new String[] {"waitingForInput"}));
2932+
}
2933+
29272934
return toObject;
29282935
}
29292936

@@ -3497,6 +3504,13 @@ ObjectNode liveServerContentFromVertex(JsonNode fromObject, ObjectNode parentObj
34973504
toObject));
34983505
}
34993506

3507+
if (Common.getValueByPath(fromObject, new String[] {"waitingForInput"}) != null) {
3508+
Common.setValueByPath(
3509+
toObject,
3510+
new String[] {"waitingForInput"},
3511+
Common.getValueByPath(fromObject, new String[] {"waitingForInput"}));
3512+
}
3513+
35003514
return toObject;
35013515
}
35023516

src/main/java/com/google/genai/types/LiveServerContent.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ public abstract class LiveServerContent extends JsonSerializable {
8787
@JsonProperty("urlContextMetadata")
8888
public abstract Optional<UrlContextMetadata> urlContextMetadata();
8989

90+
/**
91+
* If true, indicates that the model is not generating content because it is waiting for more
92+
* input from the user, e.g. because it expects the user to continue talking.
93+
*/
94+
@JsonProperty("waitingForInput")
95+
public abstract Optional<Boolean> waitingForInput();
96+
9097
/** Instantiates a builder for LiveServerContent. */
9198
@ExcludeFromGeneratedCoverageReport
9299
public static Builder builder() {
@@ -229,6 +236,15 @@ public Builder urlContextMetadata(UrlContextMetadata.Builder urlContextMetadataB
229236
return urlContextMetadata(urlContextMetadataBuilder.build());
230237
}
231238

239+
/**
240+
* Setter for waitingForInput.
241+
*
242+
* <p>waitingForInput: If true, indicates that the model is not generating content because it is
243+
* waiting for more input from the user, e.g. because it expects the user to continue talking.
244+
*/
245+
@JsonProperty("waitingForInput")
246+
public abstract Builder waitingForInput(boolean waitingForInput);
247+
232248
public abstract LiveServerContent build();
233249
}
234250

0 commit comments

Comments
 (0)