Skip to content

Commit 8429744

Browse files
matthew29tangcopybara-github
authored andcommitted
chore: Support _self key in request object config
PiperOrigin-RevId: 804484893
1 parent 77d1d40 commit 8429744

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

google/genai/_common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ def set_value_by_path(data: Optional[dict[Any, Any]], keys: list[str], value: An
100100
f' Existing value: {existing_data}; New value: {value}.'
101101
)
102102
else:
103-
data[keys[-1]] = value
103+
if (keys[-1] == '_self' and isinstance(data, dict)
104+
and isinstance(value, dict)):
105+
data.update(value)
106+
else:
107+
data[keys[-1]] = value
104108

105109

106110
def get_value_by_path(data: Any, keys: list[str]) -> Any:

0 commit comments

Comments
 (0)