Skip to content

docs(streaming): fix inverted env var, wrong defaults, broken snippets - #2023

Open
GWeale wants to merge 2 commits into
google:mainfrom
GWeale:docs-audit-streaming
Open

GWeale wants to merge 2 commits into
google:mainfrom
GWeale:docs-audit-streaming

Conversation

@GWeale

@GWeale GWeale commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Rebased onto the Live rewrite in #2086, which deleted dev-guide/part1-5.md and split them
into the capability pages. This PR now targets those pages instead.

Most of the original audit is already fixed by that rewrite — the event-loop binding of
LiveRequestQueue, the progressive-SSE environment variable, Part.from_text(text=...),
the transcription defaults, and the five-attempt reconnect limit all landed with #2086.
Seven claims did not, and each is re-verified against google-adk 2.8.0 rather than the
2.5.0 the original audit used.

What is corrected

docs/live/sessions.md

  • A missing session raises SessionNotFoundError, which subclasses ValueError, not a bare
    ValueError. Added Runner(..., auto_create_session=True) as the way to avoid it.
  • The LiveRequest block omitted audio_stream_end, partial and state_delta. The block
    is presented as the class definition, so the omissions read as "these fields do not exist".
  • The exit table said end_invocation is "set by a tool or callback". A tool cannot set it.
    ADK sets it, for example when a before_agent_callback returns content
    (base_agent.py), and a custom agent can set it in its own _run_live_impl().

docs/live/tools.md

  • A tool receives a ToolContext and a callback a CallbackContext, not an
    InvocationContext. Swapped the two documented fields for ones that exist on
    ToolContext.
  • tool_context.get_invocation_context() returns ctx.model_copy(...), so
    ctx.end_invocation = True on the result is a silent no-op. This was documented as the
    way to terminate a session, so following the page gets you a session that never ends.

docs/live/events.md

  • Live text accumulation happens in GeminiLlmConnection.receive().
    StreamingResponseAggregator is the run_async() path; the live receive() carries a
    comment saying reusing it is still pending.
  • partial, turn_complete and interrupted are Optional[bool] defaulting to None.
    The example stream showed turn_complete=False and a final partial=False, text="",
    neither of which the runtime produces, which invites == False comparisons that never
    match.

docs/live/configuration.md

  • response_modalities is list[Modality], not list[str]. Noted that plain strings are
    accepted, since every example on the page uses them.

Checks

mkdocs build --strict passes. The two anchor notices it prints are on main already and
are untouched here.

@netlify

netlify Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adk-docs-preview ready!

Name Link
🔨 Latest commit 04c0fba
🔍 Latest deploy log https://app.netlify.com/projects/adk-docs-preview/deploys/6a764b4f1d6aac00085e7342
😎 Deploy Preview https://deploy-preview-2023--adk-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@GWeale
GWeale force-pushed the docs-audit-streaming branch 2 times, most recently from 1a1eab9 to 640dd09 Compare August 7, 2026 20:37
Re-applies the corrections from google#2023 to the capability pages that replaced
dev-guide/part1-5 in google#2086. Most of the original audit is already fixed by
that rewrite; these seven claims are not, and each is verified against
google-adk 2.8.0.

- sessions: run_live() raises SessionNotFoundError, a ValueError subclass,
  and Runner(auto_create_session=True) avoids it.
- sessions: LiveRequest is missing audio_stream_end, partial and state_delta.
- sessions: a tool cannot set end_invocation; ADK sets it, for instance when
  a before_agent_callback returns content.
- tools: a tool gets a ToolContext and a callback a CallbackContext, not an
  InvocationContext. get_invocation_context() returns a copy, so setting
  end_invocation on it does nothing.
- events: live text is accumulated in GeminiLlmConnection.receive();
  StreamingResponseAggregator is the run_async() path.
- events: the streaming flags are Optional[bool] defaulting to None, so the
  example stream showed values the runtime never produces.
- configuration: response_modalities is list[Modality], and plain strings
  are accepted.

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.

2 participants