docs(context): add Go examples to the compaction page - #2202
Open
baptmont wants to merge 1 commit into
Open
Conversation
The two tabbed sections on the context compaction page offered Python, Java, TypeScript and Kotlin but no Go, so a Go reader had nothing to copy. Both examples are translations of the existing ones rather than new material, kept to the same length. The one structural difference worth a comment in the sample: Go has no App object, so compaction is configured on the runner. Both snippets were compiled against google.golang.org/adk/v2 v2.3.0 before being pasted in. The import path is the v2 one because compaction exists only in v2; the Go examples elsewhere on the site still use the v1 path. The surrounding prose named the languages explicitly in three places, so each now mentions Go as well, including the Go spelling of the prompt-template setting and its placeholder requirement.
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
The two tabbed sections on Context compaction — Configure context compaction and Define a Summarizer — offer Python, Java, TypeScript and Kotlin but no Go, so a Go reader has nothing to copy.
Both new tabs are translations of the existing examples, kept to the same length rather than expanded.
One structural difference is worth the inline comment in the sample: Go has no
Appobject, so compaction is configured on the runner viarunner.Config.Compaction.Two things a reviewer may want to check deliberately:
google.golang.org/adk/v2v2.3.0 before being pasted in, so the field names and theNewLLMSummarizersignature are real rather than reconstructed.google.golang.org/adk/v2/...is required for the example to work. Every other Go example on the site still uses the v1 path (google.golang.org/adk/...), so this is intentionally inconsistent with its neighbours. Worth knowing in case the site's Go examples are due a v2 pass more broadly.The prose named the languages explicitly in three places, so each now mentions Go too — including the Go spelling of the prompt-template setting (
PromptTemplateonLLMSummarizerConfig) and the fact that it must contain the{conversation_history}placeholder, which is easy to miss and silently drops the whole conversation from the prompt if omitted.Rendering was checked with the site's own
pymdownx.tabbed/pymdownx.superfencesextensions: all five tabs render in both sections.