Repository navigation
feat(interactions): populate output_text and output media helpers in the Java SDK - #1318
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
copybara_998597583
branch
from
October 22, 2026 19:46
6f9941c to
231db49
Compare
…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
Bot
force-pushed
the
copybara_998597583
branch
from
October 22, 2026 20:29
231db49 to
1ca9c62
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(interactions): populate output_text and output media helpers in the Java SDK
The
Interactionmodel declaredoutputText,outputImage,outputAudioandoutputVideobut the Java SDK never populated them. They are now derived fromstepswhenever anInteractionis constructed (including deserialization).The helper walks steps backwards from the end of the current turn:
user_inputends the turn,thoughtsteps andmodel_outputsteps 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 asoutput_image/output_audio/output_video. This matches the Python and TypeScript SDKs.