Describe the bug
In docs/context/compaction.md (under "Sliding window compaction", lines 73-78), the Python code snippet illustrating EventsCompactionConfig contains a syntax error: the call to EventsCompactionConfig(...) has an unclosed parenthesis, causing a SyntaxError: '(' was never closed. In addition, the snippet omits the import for EventsCompactionConfig.
To Reproduce
Steps to reproduce the behavior:
- Go to
docs/context/compaction.md#sliding-window-compaction.
- Inspect the Python code snippet under "Sliding window compaction":
# (Optional) Event-based, sliding window as supplementary setting
compaction_config = EventsCompactionConfig(
compaction_interval=10, # Number of turns between standard compactions
overlap_size=2, # Number of events to retain as overlapping context
- Attempt to run or parse the Python snippet.
- Observe
SyntaxError: '(' was never closed.
Expected behavior
The Python sample snippet should be syntactically valid, with the call properly closed with ) and the class imported from google.adk.apps.app.
Screenshots
N/A (Documentation syntax error)
Versions
- OS: macOS / Linux / Windows
- ADK version: 2.0.0
- Python version: 3.10+
Additional context
A patch is prepared and available in attachment.
fix-context-docs-code-samples.patch
Describe the bug
In
docs/context/compaction.md(under "Sliding window compaction", lines 73-78), the Python code snippet illustratingEventsCompactionConfigcontains a syntax error: the call toEventsCompactionConfig(...)has an unclosed parenthesis, causing aSyntaxError: '(' was never closed. In addition, the snippet omits the import forEventsCompactionConfig.To Reproduce
Steps to reproduce the behavior:
docs/context/compaction.md#sliding-window-compaction.SyntaxError: '(' was never closed.Expected behavior
The Python sample snippet should be syntactically valid, with the call properly closed with
)and the class imported fromgoogle.adk.apps.app.Screenshots
N/A (Documentation syntax error)
Versions
Additional context
A patch is prepared and available in attachment.
fix-context-docs-code-samples.patch