docs(callbacks): align callback contracts with runtime behavior - #7022
Open
jaywang172 wants to merge 1 commit into
Open
docs(callbacks): align callback contracts with runtime behavior#7022jaywang172 wants to merge 1 commit into
jaywang172 wants to merge 1 commit into
Conversation
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.
Link to Issue or Description of Change
Companion user guide: google/adk-docs#2207
The callback API docstrings have drifted from the runtime: before/after agent
and model callbacks stop on truthy responses, and agent callbacks support
positional argument fallback even though the docs require a particular name.
Align the existing docstrings with the current contracts:
use canonical names for keyword-only parameters.
LlmResponsefor model responses and error recovery.Nonestopping explicit for tool callbacks, including{}as avalid response that skips the tool, replaces its result, or handles an error.
Only docstrings change; callback execution and public signatures are unchanged.
This is independent of #7008.
Testing Plan
fields, base agent, model callbacks, and regular/live tool callbacks.
current helper: canonical names, positional aliases, and canonical
keyword-only parameters work; a renamed keyword-only parameter raises
TypeErroras documented.pre-commit run --files src/google/adk/agents/base_agent.py src/google/adk/agents/llm_agent.py: passed.git diff --check: passed.No model requests or Google credentials were needed. No new runtime tests were
added for this documentation-only change.
Checklist