File tree Expand file tree Collapse file tree
google/genai/_interactions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,9 +159,7 @@ def default_headers(self) -> dict[str, str | Omit]:
159159
160160 @override
161161 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
162- if self .api_key and headers .get ("x-goog-api-key" ):
163- return
164- if isinstance (custom_headers .get ("x-goog-api-key" ), Omit ):
162+ if headers .get ("x-goog-api-key" ) or isinstance (custom_headers .get ("x-goog-api-key" ), Omit ):
165163 return
166164
167165 raise TypeError (
@@ -355,9 +353,7 @@ def default_headers(self) -> dict[str, str | Omit]:
355353
356354 @override
357355 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
358- if self .api_key and headers .get ("x-goog-api-key" ):
359- return
360- if isinstance (custom_headers .get ("x-goog-api-key" ), Omit ):
356+ if headers .get ("x-goog-api-key" ) or isinstance (custom_headers .get ("x-goog-api-key" ), Omit ):
361357 return
362358
363359 raise TypeError (
You can’t perform that action at this time.
0 commit comments