Skip to content

feat(interactions): populate output_text and output media helpers in the Java SDK - #1318

Merged
copybara-service[bot] merged 1 commit into
mainfrom
copybara_998597583
Oct 22, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
copybara_998597583

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

feat(interactions): populate output_text and output media helpers in the Java SDK

The Interaction model declared outputText, outputImage, outputAudio and outputVideo but the Java SDK never populated them. They are now derived from steps whenever an Interaction is constructed (including deserialization).

The helper walks steps backwards from the end of the current turn: user_input ends the turn, thought steps and model_output steps without content are skipped, and tool call/result steps (or a non-text content item) end text collection once text has been found. Text parts are concatenated in order. The last image/audio/video produced by the model in the turn is exposed as output_image/output_audio/output_video. This matches the Python and TypeScript SDKs.

…the Java SDK

The `Interaction` model declared `outputText`, `outputImage`, `outputAudio` and `outputVideo` but the Java SDK never populated them. They are now derived from `steps` whenever an `Interaction` is constructed (including deserialization).

The helper walks steps backwards from the end of the current turn: `user_input` ends the turn, `thought` steps and `model_output` steps without content are skipped, and tool call/result steps (or a non-text content item) end text collection once text has been found. Text parts are concatenated in order. The last image/audio/video produced by the model in the turn is exposed as `output_image`/`output_audio`/`output_video`. This matches the Python and TypeScript SDKs.

PiperOrigin-RevId: 1005013079
@copybara-service
copybara-service Bot merged commit 1ca9c62 into main Oct 22, 2026
3 checks passed
@copybara-service
copybara-service Bot deleted the copybara_998597583 branch October 22, 2026 20:29
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.

1 participant