From eb5a007d1ddaece1438fa02cc465a501bad05d4b Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:10:41 -0600 Subject: [PATCH] fix(vertexai): set internal headers (#9151) Follow up to #9150 --- vertexai/genai/client.go | 2 ++ vertexai/internal/version.go | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 vertexai/internal/version.go diff --git a/vertexai/genai/client.go b/vertexai/genai/client.go index b1023516d45..49aa8f2fd9a 100644 --- a/vertexai/genai/client.go +++ b/vertexai/genai/client.go @@ -25,6 +25,7 @@ import ( aiplatform "cloud.google.com/go/aiplatform/apiv1beta1" pb "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb" + "cloud.google.com/go/vertexai/internal" "cloud.google.com/go/vertexai/internal/support" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -50,6 +51,7 @@ func NewClient(ctx context.Context, projectID, location string, opts ...option.C if err != nil { return nil, err } + c.SetGoogleClientInfo("gccl", internal.Version) return &Client{ c: c, projectID: projectID, diff --git a/vertexai/internal/version.go b/vertexai/internal/version.go new file mode 100644 index 00000000000..9ba5f5e2428 --- /dev/null +++ b/vertexai/internal/version.go @@ -0,0 +1,18 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal + +// Version is the current tagged release of the library. +const Version = "0.4.0"