Skip to content

feat: expose turnComplete for live content - #1381

Open
YuqiGuo105 wants to merge 1 commit into
google:mainfrom
YuqiGuo105:fix/issue-1200-live-turn-complete
Open

feat: expose turnComplete for live content#1381
YuqiGuo105 wants to merge 1 commit into
google:mainfrom
YuqiGuo105:fix/issue-1200-live-turn-complete

Conversation

@YuqiGuo105

Copy link
Copy Markdown
Contributor

Summary

  • expose turnComplete on queued Live content requests
  • add LiveRequestQueue.content(Content, boolean) while preserving the existing default behavior
  • propagate the flag through BaseLlmFlow and BaseLlmConnection
  • forward the value to Gemini's LiveSendClientContentParameters
  • cover the legacy default, explicit false, and JSON round-trip behavior

Motivation

Gemini Live supports sending multiple content messages as one user turn. A caller can send intermediate content with turnComplete=false, then mark the final content with turnComplete=true.

ADK Java did not expose this capability. LiveRequest had no turn-completion field, BaseLlmFlow called only sendContent(Content), and GeminiLlmConnection always set turnComplete(true). As a result, applications could not append content to an open Live turn without asking the model to process a completed turn.

Implementation

LiveRequest now carries an optional turnComplete value. LiveRequestQueue provides an additive overload:

requestQueue.content(content, false);

The existing method remains equivalent to content(content, true), so current callers keep the same behavior.

BaseLlmConnection adds a default sendContent(Content, boolean) overload that delegates to the original method. This allows existing custom connection implementations to continue compiling and running. GeminiLlmConnection overrides the overload and forwards the value to the lower-level Live API.

Pure FunctionResponse content continues to use the existing tool-response path; the new flag applies to normal client content.

User impact

Applications can now send multiple content messages within one Live user turn:

requestQueue.content(firstContent, false);
requestQueue.content(finalContent, true);

Existing requestQueue.content(content) calls remain unchanged.

Validation

  • ./mvnw -pl core -Dtest=LiveRequestQueueTest test
  • ./mvnw test

Closes #1200.

@YuqiGuo105
YuqiGuo105 marked this pull request as ready for review July 28, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose turnComplete control for ADK Java live content sends

1 participant