Visitar URL original
feat(interactions): concatenate output_text across multi-step model responses in a turn by copybara-service[bot] · Pull Request #3040 · googleapis/python-genai · GitHub
Skip to content

feat(interactions): concatenate output_text across multi-step model responses in a turn - #3040

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/992142645
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara/992142645

Conversation

@copybara-service

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

Copy link
Copy Markdown

feat(interactions): concatenate output_text across multi-step model responses in a turn

In the Interactions API, the model may respond across multiple steps in a row within a single turn, including consecutive model_output steps and interleaved thought steps (e.g., [thought, model_output, thought, model_output]).

Previously, interaction.output_text stopped collecting text as soon as backward traversal encountered a thought step or a model_output step without content after collecting text from the final model_output step, returning only the last segment of the model's response.

Update the output_text helper across the Python and TypeScript SDKs to continue across thought steps and empty model_output steps when aggregating text from the final model turn, while still stopping at user_input and tool call/result boundaries.

…esponses in a turn

In the Interactions API, the model may respond across multiple steps in a row within a single turn, including consecutive `model_output` steps and interleaved `thought` steps (e.g., `[thought, model_output, thought, model_output]`).

Previously, `interaction.output_text` stopped collecting text as soon as backward traversal encountered a `thought` step or a `model_output` step without `content` after collecting text from the final `model_output` step, returning only the last segment of the model's response.

Update the `output_text` helper across the Python and TypeScript SDKs to continue across `thought` steps and empty `model_output` steps when aggregating text from the final model turn, while still stopping at `user_input` and tool call/result boundaries.

PiperOrigin-RevId: 992142645
@copybara-service copybara-service Bot changed the title fix: concatenate output_text across interleaved thought steps in multi-hop interactions feat(interactions): concatenate output_text across multi-step model responses in a turn Oct 10, 2026

This branch has not been deployed

No deployments
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