Skip to content

Commit d50d26d

Browse files
authored
feat(aiplatform): Add support for setting User agent header (#364)
1 parent 6fda925 commit d50d26d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

google/cloud/aiplatform/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,6 @@
7575
"MOBILE_JETSON_LOW_LATENCY_1",
7676
},
7777
}
78+
79+
# Used in constructing the requests user_agent header for metrics reporting.
80+
USER_AGENT_PRODUCT = "model-builder"

google/cloud/aiplatform/initializer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ def create_client(
259259
"google-cloud-aiplatform",
260260
).version
261261
client_info = gapic_v1.client_info.ClientInfo(
262-
gapic_version=gapic_version, user_agent=f"model-builder/{gapic_version}"
262+
gapic_version=gapic_version,
263+
user_agent=f"{constants.USER_AGENT_PRODUCT}/{gapic_version}",
263264
)
264265

265266
kwargs = {

0 commit comments

Comments
 (0)