Skip to content

feat: expose turnComplete for live content - #1381

Merged
copybara-service[bot] merged 1 commit into
google:mainfrom
YuqiGuo105:fix/issue-1200-live-turn-complete
Oct 20, 2026
Merged

copybara-service[bot] merged 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
@hemasekhar-p hemasekhar-p self-assigned this Jul 30, 2026
@hemasekhar-p

Copy link
Copy Markdown
Contributor

Hi @YuqiGuo105, thank you for your contribution! We appreciate you taking the time to submit this pull request. Currently this PR is under review by our team, we will keep you posted if any additional information is required. thank you.

Comment on lines +55 to +56
@JsonProperty("turnComplete")
public abstract Optional<Boolean> turnComplete();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM: ADK Python and ADK Kotlin already ship this flag as partial, a boolean defaulting to false:

To keep the ports consistent, could you use the same name and polarity here (partial, JSON key partial, default false) as well as in LiveRequestQueue.content(Content, boolean) and BaseLlmConnection.sendContent(Content, boolean)? GeminiLlmConnection would then send turnComplete(!partial), matching Python and Kotlin. Renaming after a release would break callers, so it is easier to settle before merge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out! Addressed in 2e6f166.

Updated LiveRequest (including the JSON key and builder), LiveRequestQueue, and BaseLlmConnection to use partial, defaulting to false. BaseLlmFlow forwards the flag unchanged, and GeminiLlmConnection now maps it to turnComplete(!partial).

Existing single-argument calls still complete the turn, and pure function-response content retains its existing tool-response behavior.

Added regression coverage for defaults, both boolean values, JSON round-trips and missing fields, flow propagation, Gemini conversion, and legacy connection implementations.

Validation:

  • Re-ran the 54 focused tests successfully.
  • ./mvnw -o -pl core test also passed (main suite: 1,728 tests, 24 skipped, no failures or errors).

Could you please take another look when you have a chance?

@damianmomotgoogle damianmomotgoogle added waiting on reporter Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale. and removed needs review labels Oct 16, 2026

@damianmomotgoogle damianmomotgoogle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase and squash all commits into a single one with "feat:" convenationa commit message - matching PR title.

@YuqiGuo105
YuqiGuo105 force-pushed the fix/issue-1200-live-turn-complete branch from 2e6f166 to 857ee63 Compare October 19, 2026 13:37
@YuqiGuo105

Copy link
Copy Markdown
Contributor Author

Thanks @damianmomotgoogle! Updated in 857ee63.

  • Rebased onto main (dc56f11f).
  • Resolved the conflicts in BaseLlmFlowTest and GeminiLlmConnectionTest, preserving the upstream regression tests and adapting the live-content tests to the new GeminiLiveTransport seam.
  • Squashed the changes into a single commit with the message feat: expose turnComplete for live content, matching the PR title.

The full ./mvnw test run passed across all 19 reactor modules. The updated branch has been pushed with --force-with-lease.

Could you please take another look when you have a chance?

@damianmomotgoogle damianmomotgoogle added ready to pull and removed waiting on reporter Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale. labels Oct 19, 2026
@copybara-service
copybara-service Bot merged commit 833cbd5 into google:main Oct 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose turnComplete control for ADK Java live content sends

3 participants