contrib/google_adk_agents: stream LlmResponse chunks via Workflow Streams#1498
Open
contrib/google_adk_agents: stream LlmResponse chunks via Workflow Streams#1498
Conversation
Re-applies the google_adk_agents streaming integration originally split out of PR #1423 on commit 59c7582. The bridge honors `stream=True` and publishes raw `LlmResponse` chunks through a typed topic handle. Opt in via the plugin's `streaming_event_topic` parameter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
brianstrauch
reviewed
May 1, 2026
brianstrauch
approved these changes
May 1, 2026
There was a problem hiding this comment.
Pull request overview
Adds opt-in streaming support for temporalio.contrib.google_adk_agents by invoking ADK models with stream=True and publishing raw LlmResponse chunks to a Workflow Streams topic so external consumers can observe incremental output.
Changes:
- Introduces a new streaming activity (
invoke_model_streaming) and an activity input wrapper (StreamingInvokeInput) to publishLlmResponsechunks viaWorkflowStreamClient. - Extends
TemporalModelwithstreaming_topic/streaming_batch_intervaland routesgenerate_content_async(stream=True)through the streaming activity. - Adds integration tests validating chunk publishing and the “topic required for streaming” contract.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
temporalio/contrib/google_adk_agents/_model.py |
Adds streaming activity + model options; publishes LlmResponse chunks to Workflow Streams when stream=True. |
temporalio/contrib/google_adk_agents/_plugin.py |
Registers the new streaming activity with the worker plugin. |
tests/contrib/google_adk_agents/test_adk_streaming.py |
New integration tests covering streaming publish behavior and required-topic failure mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Adds a streaming integration to
temporalio.contrib.google_adk_agents. The bridge honorsstream=Trueand publishes rawLlmResponsechunks through a typed Workflow Streams topic handle, so a workflow can deliver token-level model output to clients while preserving durability.streaming_topicparameter. With no topic set, behavior is unchanged.StreamingInvokeInput(single dataclass per Temporal activity convention); the topic is required when streaming, since invoking streaming without publishing delivers no real-time value (the workflow only sees chunks batched at activity completion).This was originally split out of PR #1423 (Workflow Streams library) and is now rebuilt as a single commit on top of merged main.
Test plan
poe lintclean (ruff, pyright, mypy, basedpyright, pydocstyle)tests/contrib/google_adk_agents/test_adk_streaming.py— covers streaming chunk publishing and the typed topic contract🤖 Generated with Claude Code