Skip to content

Commit

Permalink
feat(aiplatform): Add support for setting User agent header (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaChavoshi committed May 6, 2021
1 parent 6fda925 commit d50d26d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions google/cloud/aiplatform/constants.py
Expand Up @@ -75,3 +75,6 @@
"MOBILE_JETSON_LOW_LATENCY_1",
},
}

# Used in constructing the requests user_agent header for metrics reporting.
USER_AGENT_PRODUCT = "model-builder"
3 changes: 2 additions & 1 deletion google/cloud/aiplatform/initializer.py
Expand Up @@ -259,7 +259,8 @@ def create_client(
"google-cloud-aiplatform",
).version
client_info = gapic_v1.client_info.ClientInfo(
gapic_version=gapic_version, user_agent=f"model-builder/{gapic_version}"
gapic_version=gapic_version,
user_agent=f"{constants.USER_AGENT_PRODUCT}/{gapic_version}",
)

kwargs = {
Expand Down

0 comments on commit d50d26d

Please sign in to comment.