Skip to content

Commit b19b1c7

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: GenAI SDK client - Support agent engine sandbox http request in genai sdk
PiperOrigin-RevId: 816865842
1 parent 4a6c6af commit b19b1c7

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

google/genai/_api_client.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,16 @@ def _build_request(
10561056
_common.recursive_dict_update(
10571057
request_dict, patched_http_options.extra_body
10581058
)
1059-
1060-
url = join_url_path(
1061-
base_url,
1062-
versioned_path,
1063-
)
1059+
url = base_url
1060+
if (
1061+
not self.custom_base_url
1062+
or (self.project and self.location)
1063+
or self.api_key
1064+
):
1065+
url = join_url_path(
1066+
base_url,
1067+
versioned_path,
1068+
)
10641069

10651070
if self.api_key and self.api_key.startswith('auth_tokens/'):
10661071
raise EphemeralTokenAPIKeyError(

0 commit comments

Comments
 (0)