docs(callbacks): align Python callback contracts with runtime - #2207
Open
jaywang172 wants to merge 1 commit into
Open
docs(callbacks): align Python callback contracts with runtime#2207jaywang172 wants to merge 1 commit into
jaywang172 wants to merge 1 commit into
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
3 tasks
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
Companion API docstrings: google/adk-python#7022
The Python callback guide currently says renamed parameters always fail and
that before/after tool callbacks stop only on truthy values. Current ADK Python
supports positional fallback and stops tool callback lists on non-
Noneresponses, including
{}.Update the existing Python notes to describe keyword-first binding and
canonical positional fallback, with examples showing that renamed keyword-only
parameters still fail. Replace the stopping-rule paragraph with a table of
response types and conditions for all eight agent-defined hooks. Clarify when
an empty tool response skips execution, replaces a result, or handles an error;
model error recovery requires
LlmResponse.Also correct the before-tool note that still says an empty dictionary lets
later callbacks run, and make the corresponding after-tool behavior explicit.
The changes are scoped to Python agent-defined callbacks and link to the
separate plugin rules. Generated API reference files are untouched.
Validation
mkdocs build --strict: passed, including the Pagefind index (233 pages).0b75a66d: the threesupported signatures work and the renamed keyword-only signature raises
TypeError.documentation branch.
git diff --check: passed.mkdocs serveand in a browser, includingthe expanded signature examples, both tables, and the before/after-tool notes.
The strict build reports two existing INFO-level missing-anchor diagnostics in
the unchanged live guides; it exits successfully with no build warnings/errors.