You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Extract _set_finish_reason helper to eliminate code duplication
Extract finish_reason mapping logic into a reusable helper function to address
code duplication feedback from Gemini Code Assist review on PR #3698.
Changes:
- Added _set_finish_reason(response, finish_reason) helper function
- Replaced three duplicate mapping blocks with single helper call:
* Non-streaming path (line ~880)
* Streaming tool-call path (line ~1387)
* Streaming text-only path (line ~1409)
- Preserved all existing comments and behavior
- Improved maintainability - single source of truth for mapping logic
Addresses: https://github.com/google/adk-python/pull/3698\#discussion_r18xxxxx
0 commit comments