Fix RunConfig docs: correct import path and add missing fields#1764
Conversation
The Python import was documented as `from google.genai.adk import RunConfig, StreamingMode`, but the actual import path in adk-python is `from google.adk.agents.run_config import RunConfig, StreamingMode`. Corrected all four occurrences. Synced the page against https://github.com/google/adk-python/blob/main/src/google/adk/agents/run_config.py: - Added 11 previously undocumented fields to the class definition, the parameter table, and dedicated sections: avatar_config, input_audio_transcription, realtime_input_config, enable_affective_dialog, proactivity, session_resumption, context_window_compression, save_live_blob, tool_thread_pool_config, custom_metadata, get_session_config. - Marked save_input_blobs_as_artifacts as deprecated and pointed readers to SaveFilesAsArtifactsPlugin; removed it from the comprehensive Python example. - Corrected StreamingMode.BIDI description: it is not used by run_async(); bidirectional streaming goes through runner.run_live(). - Fixed output_audio_transcription default in the table (the field uses default_factory=AudioTranscriptionConfig, not None). - Added a ToolThreadPoolConfig example with a GIL note and a GetSessionConfig example.
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ase-oriented guide with verified multi-language code samples
There was a problem hiding this comment.
Thanks for the PR and updates. This PR was a good reminder that the RunConfig page was due for a rewrite/refactor, since in its current state it looks more like a duplicate of the API reference page which is light on concepts/use cases and is high maintenance in terms of updating individual params and manual doc strings.
Instead, I pushed changes to rework the RunConfig docs page from a per-field API reference duplication into a use-case-oriented guide organized around five common tasks: session management, streaming, audio/speech, live agents, and runtime limits. And links to the API reference docs are provided so we don't have to maintain all of that here across all language SDKs.
Also fixed several code samples from the pre-existing page including incorrect Python imports, TypeScript type errors, deprecated Java builder methods.
|
Thank you @koverholt |
* Fix RunConfig docs: correct import path and add missing fields The Python import was documented as `from google.genai.adk import RunConfig, StreamingMode`, but the actual import path in adk-python is `from google.adk.agents.run_config import RunConfig, StreamingMode`. Corrected all four occurrences. Synced the page against https://github.com/google/adk-python/blob/main/src/google/adk/agents/run_config.py: - Added 11 previously undocumented fields to the class definition, the parameter table, and dedicated sections: avatar_config, input_audio_transcription, realtime_input_config, enable_affective_dialog, proactivity, session_resumption, context_window_compression, save_live_blob, tool_thread_pool_config, custom_metadata, get_session_config. - Marked save_input_blobs_as_artifacts as deprecated and pointed readers to SaveFilesAsArtifactsPlugin; removed it from the comprehensive Python example. - Corrected StreamingMode.BIDI description: it is not used by run_async(); bidirectional streaming goes through runner.run_live(). - Fixed output_audio_transcription default in the table (the field uses default_factory=AudioTranscriptionConfig, not None). - Added a ToolThreadPoolConfig example with a GIL note and a GetSessionConfig example. * Rework RunConfig docs from per-field API ref duplication into a use-case-oriented guide with verified multi-language code samples --------- Co-authored-by: Kristopher Overholt <koverholt@google.com>
Summary
The
RunConfigdocumentation page was out of sync with the actual implementation in adk-python. This PR brings it back in line.Import path (critical)
All Python examples used:
The actual import is:
Fixed across all four occurrences.
Missing fields
Added 11 previously undocumented fields to the Python class definition, the parameter table, and dedicated subsections:
avatar_configinput_audio_transcriptionrealtime_input_configenable_affective_dialogproactivitysession_resumptioncontext_window_compressionsave_live_blobtool_thread_pool_config(with code example + GIL note)custom_metadataget_session_config(with code example)Deprecations
save_input_blobs_as_artifactsas deprecated and pointed readers toSaveFilesAsArtifactsPlugin. Removed it from the comprehensive Python example.Corrections
StreamingMode.BIDI: the docs claimed it enables bidirectional streaming. The source comment is explicit that BIDI is not used byrun_async()and that real bidirectional streaming goes throughrunner.run_live(). Updated the description accordingly.output_audio_transcription: default in the table corrected fromNonetoAudioTranscriptionConfig()(the field usesdefault_factory=types.AudioTranscriptionConfig).Test plan
mkdocs servebuilds with no errors or warnings/runtime/runconfig/page renders and includes the new sectionsgoogle.genai.adkon the page