From b19b1c7d710d194c467280f73a29dc9697e62a94 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Wed, 8 Oct 2025 14:38:06 -0700 Subject: [PATCH] feat: GenAI SDK client - Support agent engine sandbox http request in genai sdk PiperOrigin-RevId: 816865842 --- google/genai/_api_client.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/google/genai/_api_client.py b/google/genai/_api_client.py index 329d5fc01..37cfd2fcb 100644 --- a/google/genai/_api_client.py +++ b/google/genai/_api_client.py @@ -1056,11 +1056,16 @@ def _build_request( _common.recursive_dict_update( request_dict, patched_http_options.extra_body ) - - url = join_url_path( - base_url, - versioned_path, - ) + url = base_url + if ( + not self.custom_base_url + or (self.project and self.location) + or self.api_key + ): + url = join_url_path( + base_url, + versioned_path, + ) if self.api_key and self.api_key.startswith('auth_tokens/'): raise EphemeralTokenAPIKeyError(