Commit ec8541b
committed
Fix precedence bug in dict-based reasoning extraction
Address gemini-code-assist review feedback:
- Use two-argument dict.get() to check key presence instead of truthiness
- This ensures reasoning_content takes precedence even with falsy values
- Update test to expect empty string instead of None for consistency
The previous 'or' operator would incorrectly fall back to 'reasoning'
when 'reasoning_content' was present but had a falsy value like ''.
Now using dict.get(key, default) properly maintains precedence.1 parent 68ffc70 commit ec8541b
File tree
2 files changed
+3
-4
lines changed- src/google/adk/models
- tests/unittests/models
2 files changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1706 | 1706 | | |
1707 | 1707 | | |
1708 | 1708 | | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
| 1709 | + | |
| 1710 | + | |
1712 | 1711 | | |
1713 | 1712 | | |
1714 | 1713 | | |
| |||
0 commit comments