docs(context): fix broken samples and stale API claims in context pages - #2024
Open
GWeale wants to merge 3 commits into
Open
docs(context): fix broken samples and stale API claims in context pages#2024GWeale wants to merge 3 commits into
GWeale wants to merge 3 commits into
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
# Conflicts: # docs/context/index.md
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.
Audit of the three
docs/context/pages: a Python sample that doesn't parse, an attribute that no longer exists in 2.5.0, async methods documented as synchronous, and config fields/constraints that didn't match the code.Changes
docs/context/compaction.md— theEventsCompactionConfig(...)sample was missing its closing paren, so it was a syntax error; added it. Counting is per invocation, not per event, so the prose, the worked example and the field descriptions now say "invocation". Also notes that sliding-window compaction runs in theRunnerafter each invocation (only token-based compaction runs in SingleFlow), that theAppmust be passed toRunner(app=app, ...)for compaction to take effect, and thatcompaction_intervalmust be> 0and set together withoverlap_size.docs/context/index.md—event.stringify_content()is not an attribute; nowevent.content.search_memoryreturns.memories(MemoryEntryobjects), not.resultswith.text.save_artifact/load_artifact/list_artifacts/search_memoryare async, so those samples nowawaitfromasync def.types.Part.from_textneeds the keywordtext=.Event(content=...)takes atypes.Content, not astr. Imports simplified tofrom google.adk.agents import Context/InvocationContext. The model-callback sample uses the parameter names the framework passes by keyword and returnsOptional[LlmResponse].CallbackContextandToolContextare described as aliases ofContext, with the tool-only members called out.end_invocationstops the agent that sets it (and the whole cycle only when that agent is root); callbacks and tools cannot set it.docs/context/caching.md— thecreate_http_optionsfield was undocumented; added, with thettl_seconds > 0andcache_intervals1–100 constraints, the fact thatmin_tokensis compared against the previous request's prompt token count (so the first request is never cached), Gemini's own minimum cacheable size, and an experimental banner forContextCacheConfig.How this was produced
Part of a page-by-page audit of the Python docs against the
google/adk-pythonv2.5.0 source: every import resolved against a real 2.5.0 install, every constructor kwarg checked againstmodel_fields/inspect.signature, every documented default read off the field. A second independent pass re-derived each claim from source rather than trusting the finding, and a third conformed the new wording to the surrounding pages.mkdocs build --strictis clean.Only Python tabs and language-neutral prose were touched — this audit had no ground truth for the Go / Java / TypeScript SDKs.
Split out of a larger audit branch so each area can be reviewed on its own.