Add Kotlin safety settings and includeContents to the agent docs - #2158
Open
happyhuman wants to merge 2 commits into
Open
Add Kotlin safety settings and includeContents to the agent docs#2158happyhuman wants to merge 2 commits into
happyhuman wants to merge 2 commits into
Conversation
Three related parity gaps, all on the same two types. docs/safety/index.md had no Kotlin tab at all in the built-in Gemini safety section. docs/agents/llm-agents.md had a Kotlin tab for generateContentConfig that set only temperature and maxOutputTokens while its Python sibling also set safety settings, and no Kotlin tab at all for includeContents. None of these are new API: safety settings landed in adk-kotlin 0.5.0 and includeContents has been on LlmAgent since 0.1.0. The under-showing tab is the interesting case. A missing-tab scan cannot see it and neither can a symbol diff, because the tab exists and every symbol it names is present - only comparing a tab's contents against its siblings reveals it. The safety page tab is inline because its siblings are, and because the snippet elides the required name and model parameters the same way they do, so there is nothing there that could compile on its own.
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Adding the Kotlin tab accidentally reindented a line inside the Go sample, which mixes tabs and spaces. The Go tab is a sibling and should not appear in this diff at all; the page's only non-additive change is now the badge line.
Collaborator
Author
|
Update: pushed a follow-up commit restoring the Go tab's indentation on |
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.
What
Three related Kotlin parity gaps, all resting on the same three types (
SafetySetting,HarmCategory,HarmBlockThreshold), so they are fixed together:docs/safety/index.mddocs/agents/llm-agents.md(gen_config)temperatureandmaxOutputTokens; the Python sibling also sets safety settingsdocs/agents/llm-agents.md(include_contents)None of this is new API — safety settings landed in adk-kotlin 0.5.0,
includeContentshas been onLlmAgentsince 0.1.0.The gap class worth noting
The
gen_configcase is a Kotlin tab that exists but under-shows the feature. A "missing Kotlin tab" scan cannot see it, and neither can a symbol diff, since every symbol the tab names is present. Only comparing a tab's contents against its siblings surfaces it.Review notes
nameandmodelarguments, so there is nothing there that could compile standalone. It is covered by L0 (imports and named arguments checked against real v0.8.0 signatures) but not by the compiler — the same level of assurance the Python and Go tabs on that page get.gen_confignow shows more than the TypeScript and Java tabs do. Those two also omit safety settings. This PR brings Kotlin to parity with Python, the semantic source for the group, and deliberately does not touch sibling-language tabs. The TS/Java gap is left as-is.Kotlin.Both branches modify
examples/kotlin/snippets/agents/llm-agent/CapitalAgent.kt, and #2151 inserts itsschema_exampleregion at the same anchor this one insertsinclude_contents— immediately after[end:gen_config]. The import blocks also overlap. Both sides are pure additions, so the resolution is mechanical, but please land #2151 first and let me rebase, rather than merging this one on top blind.Verification
Grounded against the
v0.8.0git tag. Full ladder green (L0, L1 compile with KSP, L2 ktlint, L3, L5, L6). L4runSnippetsreports SKIP — no such Gradle task exists in this repo.Tracked as KT-25, KT-32 and KT-36.