We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 772d2fc commit 91506eaCopy full SHA for 91506ea
1 file changed
google/genai/_interactions/_utils/_utils.py
@@ -102,8 +102,9 @@ def _extract_items(
102
index += 1
103
if is_dict(obj):
104
try:
105
- # We are at the last entry in the path so we must remove the field
106
- if (len(path)) == index:
+ # Remove the field if there are no more dict keys in the path,
+ # only "<array>" traversal markers or end.
107
+ if all(p == "<array>" for p in path[index:]):
108
item = obj.pop(key)
109
else:
110
item = obj[key]
0 commit comments