Skip to content

Commit 3117446

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: Added tracking headers for ADK CLI command to Agent Engine
PiperOrigin-RevId: 882138997
1 parent ab4b736 commit 3117446

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/google/adk/cli/cli_deploy.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,12 +1061,20 @@ def to_agent_engine(
10611061

10621062
import vertexai
10631063

1064+
from ..utils._google_client_headers import get_tracking_headers
1065+
10641066
if project and region:
10651067
click.echo('Initializing Vertex AI...')
1066-
client = vertexai.Client(project=project, location=region)
1068+
client = vertexai.Client(
1069+
project=project,
1070+
location=region,
1071+
http_options={'headers': get_tracking_headers()},
1072+
)
10671073
elif api_key:
10681074
click.echo('Initializing Vertex AI in Express Mode with API key...')
1069-
client = vertexai.Client(api_key=api_key)
1075+
client = vertexai.Client(
1076+
api_key=api_key, http_options={'headers': get_tracking_headers()}
1077+
)
10701078
else:
10711079
click.echo(
10721080
'No project/region or api_key provided. '

0 commit comments

Comments
 (0)