Skip to content

Commit

Permalink
chore(vertexai/genai): update to latest proto version (#9454)
Browse files Browse the repository at this point in the history
The latest protos added some fields that we are not ready to add to the
client, so configure protoveneer to omit them.

Also, add the -license flag to the protoveneer command line.
  • Loading branch information
jba committed Feb 27, 2024
1 parent e89fd6c commit f0e0d4b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
20 changes: 12 additions & 8 deletions vertexai/genai/aiplatformpb_veneer.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,14 @@ type FunctionDeclaration struct {
// Schema defining the type used for the parameter. For function with no
// parameters, this can be left unset. Example with 1 required and 1 optional
// parameter: type: OBJECT properties:
// param1:
// type: STRING
// param2:
// type: INTEGER
//
// param1:
// type: STRING
// param2:
// type: INTEGER
//
// required:
// - param1
// - param1
Parameters *Schema
}

Expand Down Expand Up @@ -715,8 +717,9 @@ type Schema struct {
Type Type
// Optional. The format of the data.
// Supported formats:
// for NUMBER type: float, double
// for INTEGER type: int32, int64
//
// for NUMBER type: float, double
// for INTEGER type: int32, int64
Format string
// Optional. The description of the data.
Description string
Expand Down Expand Up @@ -770,7 +773,8 @@ func (Schema) fromProto(p *pb.Schema) *Schema {
//
// A `Tool` is a piece of code that enables the system to interact with
// external systems to perform an action, or set of actions, outside of
// knowledge and scope of the model.
// knowledge and scope of the model. A Tool object should contain exactly
// one type of Tool.
type Tool struct {
// Optional. One or more function declarations to be passed to the model along
// with the current user query. Model may decide to call a subset of these
Expand Down
2 changes: 1 addition & 1 deletion vertexai/genai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// To get the protoveneer tool:
// go install golang.org/x/exp/protoveneer/cmd/protoveneer@latest

//go:generate protoveneer config.yaml ../../aiplatform/apiv1beta1/aiplatformpb
//go:generate protoveneer -license license.txt config.yaml ../../aiplatform/apiv1beta1/aiplatformpb

// Package genai is a client for the generative VertexAI model.
package genai
Expand Down
8 changes: 7 additions & 1 deletion vertexai/genai/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ types:
fields:
FinishMessage:
type: string

GroundingMetadata:
omit: true

GenerateContentResponse:
doc: 'is the response from a GenerateContent or GenerateContentStream call.'
Expand All @@ -89,6 +90,11 @@ types:

Tool:
docVerb: contains
fields:
Retrieval:
omit: true
GoogleSearchRetrieval:
omit: true

Schema:
fields:
Expand Down
14 changes: 14 additions & 0 deletions vertexai/genai/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

// 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.

0 comments on commit f0e0d4b

Please sign in to comment.