aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/google
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-09-10 12:16:33 +0200
committerTaras Madan <tarasmadan@google.com>2024-09-10 14:05:26 +0000
commitc97c816133b42257d0bcf1ee4bd178bb2a7a2b9e (patch)
tree0bcbc2e540bbf8f62f6c17887cdd53b8c2cee637 /vendor/github.com/google
parent54e657429ab892ad06c90cd7c1a4eb33ba93a3dc (diff)
vendor: update
Diffstat (limited to 'vendor/github.com/google')
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/caching.go193
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/chat.go16
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/client.go177
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/config.yaml67
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/content.go39
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/debug.go38
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/embed.go7
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/files.go62
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/generate.sh32
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/generativelanguagepb_veneer.gen.go554
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-api.json6890
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go1225
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/version.go2
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/option.go44
-rw-r--r--vendor/github.com/google/generative-ai-go/internal/support/support.go121
-rw-r--r--vendor/github.com/google/pprof/profile/encode.go3
-rw-r--r--vendor/github.com/google/pprof/profile/legacy_java_profile.go4
-rw-r--r--vendor/github.com/google/pprof/profile/merge.go4
-rw-r--r--vendor/github.com/google/pprof/profile/profile.go16
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go99
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go6
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go28
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go13
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go296
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go73
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go772
-rw-r--r--vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go13
-rw-r--r--vendor/github.com/google/s2a-go/internal/record/record.go34
-rw-r--r--vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go15
-rw-r--r--vendor/github.com/google/s2a-go/internal/v2/s2av2.go40
-rw-r--r--vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go15
-rw-r--r--vendor/github.com/google/s2a-go/s2a.go103
-rw-r--r--vendor/github.com/google/s2a-go/s2a_options.go28
33 files changed, 6567 insertions, 4462 deletions
diff --git a/vendor/github.com/google/generative-ai-go/genai/caching.go b/vendor/github.com/google/generative-ai-go/genai/caching.go
new file mode 100644
index 000000000..11d778647
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/caching.go
@@ -0,0 +1,193 @@
+// Copyright 2024 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 genai
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "time"
+
+ gl "cloud.google.com/go/ai/generativelanguage/apiv1beta"
+ pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ "google.golang.org/api/iterator"
+ durationpb "google.golang.org/protobuf/types/known/durationpb"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+)
+
+type cacheClient = gl.CacheClient
+
+var (
+ newCacheClient = gl.NewCacheClient
+ newCacheRESTClient = gl.NewCacheRESTClient
+)
+
+// GenerativeModelFromCachedContent returns a [GenerativeModel] that uses the given [CachedContent].
+// The argument should come from a call to [Client.CreateCachedContent] or [Client.GetCachedContent].
+func (c *Client) GenerativeModelFromCachedContent(cc *CachedContent) *GenerativeModel {
+ return &GenerativeModel{
+ c: c,
+ fullName: cc.Model,
+ CachedContentName: cc.Name,
+ }
+}
+
+// CreateCachedContent creates a new CachedContent.
+// The argument should contain a model name and some data to be cached, which can include
+// contents, a system instruction, tools and/or tool configuration. It can also
+// include an expiration time or TTL. But it should not include a name; the system
+// will generate one.
+//
+// The return value will contain the name, which should be used to refer to the CachedContent
+// in other API calls. It will also hold various metadata like expiration and creation time.
+// It will not contain any of the actual content provided as input.
+//
+// You can use the return value to create a model with [Client.GenerativeModelFromCachedContent].
+// Or you can set [GenerativeModel.CachedContentName] to the name of the CachedContent, in which
+// case you must ensure that the model provided in this call matches the name in the [GenerativeModel].
+func (c *Client) CreateCachedContent(ctx context.Context, cc *CachedContent) (*CachedContent, error) {
+ if cc.Name != "" {
+ return nil, errors.New("genai.CreateCachedContent: do not provide a name; one will be generated")
+ }
+ pcc := cc.toProto()
+ pcc.Model = Ptr(fullModelName(cc.Model))
+ req := &pb.CreateCachedContentRequest{
+ CachedContent: pcc,
+ }
+ debugPrint(req)
+ return c.cachedContentFromProto(c.cc.CreateCachedContent(ctx, req))
+}
+
+// GetCachedContent retrieves the CachedContent with the given name.
+func (c *Client) GetCachedContent(ctx context.Context, name string) (*CachedContent, error) {
+ return c.cachedContentFromProto(c.cc.GetCachedContent(ctx, &pb.GetCachedContentRequest{Name: name}))
+}
+
+// DeleteCachedContent deletes the CachedContent with the given name.
+func (c *Client) DeleteCachedContent(ctx context.Context, name string) error {
+ return c.cc.DeleteCachedContent(ctx, &pb.DeleteCachedContentRequest{Name: name})
+}
+
+// CachedContentToUpdate specifies which fields of a CachedContent to modify in a call to
+// [Client.UpdateCachedContent].
+type CachedContentToUpdate struct {
+ // If non-nil, update the expire time or TTL.
+ Expiration *ExpireTimeOrTTL
+}
+
+// UpdateCachedContent modifies the [CachedContent] according to the values
+// of the [CachedContentToUpdate] struct.
+// It returns the modified CachedContent.
+//
+// The argument CachedContent must have its Name field populated.
+// If its UpdateTime field is non-zero, it will be compared with the update time
+// of the stored CachedContent and the call will fail if they differ.
+// This avoids a race condition when two updates are attempted concurrently.
+// All other fields of the argument CachedContent are ignored.
+func (c *Client) UpdateCachedContent(ctx context.Context, cc *CachedContent, ccu *CachedContentToUpdate) (*CachedContent, error) {
+ if ccu == nil || ccu.Expiration == nil {
+ return nil, errors.New("cloud.google.com/go/vertexai/genai.UpdateCachedContent: no update specified")
+ }
+ cc2 := &CachedContent{
+ Name: cc.Name,
+ UpdateTime: cc.UpdateTime,
+ Expiration: *ccu.Expiration,
+ }
+ mask := "expire_time"
+ if ccu.Expiration.ExpireTime.IsZero() {
+ mask = "ttl"
+ }
+ req := &pb.UpdateCachedContentRequest{
+ CachedContent: cc2.toProto(),
+ UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{mask}},
+ }
+ debugPrint(req)
+ return c.cachedContentFromProto(c.cc.UpdateCachedContent(ctx, req))
+}
+
+// ListCachedContents lists all the CachedContents associated with the project and location.
+func (c *Client) ListCachedContents(ctx context.Context) *CachedContentIterator {
+ return &CachedContentIterator{
+ it: c.cc.ListCachedContents(ctx, &pb.ListCachedContentsRequest{}),
+ }
+}
+
+// A CachedContentIterator iterates over CachedContents.
+type CachedContentIterator struct {
+ it *gl.CachedContentIterator
+}
+
+// Next returns the next result. Its second return value is iterator.Done if there are no more
+// results. Once Next returns Done, all subsequent calls will return Done.
+func (it *CachedContentIterator) Next() (*CachedContent, error) {
+ m, err := it.it.Next()
+ if err != nil {
+ return nil, err
+ }
+ return (CachedContent{}).fromProto(m), nil
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *CachedContentIterator) PageInfo() *iterator.PageInfo {
+ return it.it.PageInfo()
+}
+
+func (c *Client) cachedContentFromProto(pcc *pb.CachedContent, err error) (*CachedContent, error) {
+ if err != nil {
+ return nil, err
+ }
+ cc := (CachedContent{}).fromProto(pcc)
+ return cc, nil
+}
+
+// ExpireTimeOrTTL describes the time when a resource expires.
+// If ExpireTime is non-zero, it is the expiration time.
+// Otherwise, the expiration time is the value of TTL ("time to live") added
+// to the current time.
+type ExpireTimeOrTTL struct {
+ ExpireTime time.Time
+ TTL time.Duration
+}
+
+// populateCachedContentTo populates some fields of p from v.
+func populateCachedContentTo(p *pb.CachedContent, v *CachedContent) {
+ exp := v.Expiration
+ if !exp.ExpireTime.IsZero() {
+ p.Expiration = &pb.CachedContent_ExpireTime{
+ ExpireTime: timestamppb.New(exp.ExpireTime),
+ }
+ } else if exp.TTL != 0 {
+ p.Expiration = &pb.CachedContent_Ttl{
+ Ttl: durationpb.New(exp.TTL),
+ }
+ }
+ // If both fields of v.Expiration are zero, leave p.Expiration unset.
+}
+
+// populateCachedContentFrom populates some fields of v from p.
+func populateCachedContentFrom(v *CachedContent, p *pb.CachedContent) {
+ if p.Expiration == nil {
+ return
+ }
+ switch e := p.Expiration.(type) {
+ case *pb.CachedContent_ExpireTime:
+ v.Expiration.ExpireTime = pvTimeFromProto(e.ExpireTime)
+ case *pb.CachedContent_Ttl:
+ v.Expiration.TTL = e.Ttl.AsDuration()
+ default:
+ panic(fmt.Sprintf("unknown type of CachedContent.Expiration: %T", p.Expiration))
+ }
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/chat.go b/vendor/github.com/google/generative-ai-go/genai/chat.go
index 169b24b5d..334df1d9d 100644
--- a/vendor/github.com/google/generative-ai-go/genai/chat.go
+++ b/vendor/github.com/google/generative-ai-go/genai/chat.go
@@ -32,8 +32,11 @@ func (m *GenerativeModel) StartChat() *ChatSession {
// SendMessage sends a request to the model as part of a chat session.
func (cs *ChatSession) SendMessage(ctx context.Context, parts ...Part) (*GenerateContentResponse, error) {
// Call the underlying client with the entire history plus the argument Content.
- cs.History = append(cs.History, newUserContent(parts))
- req := cs.m.newGenerateContentRequest(cs.History...)
+ cs.History = append(cs.History, NewUserContent(parts...))
+ req, err := cs.m.newGenerateContentRequest(cs.History...)
+ if err != nil {
+ return nil, err
+ }
req.GenerationConfig.CandidateCount = Ptr[int32](1)
resp, err := cs.m.generateContent(ctx, req)
if err != nil {
@@ -45,10 +48,13 @@ func (cs *ChatSession) SendMessage(ctx context.Context, parts ...Part) (*Generat
// SendMessageStream is like SendMessage, but with a streaming request.
func (cs *ChatSession) SendMessageStream(ctx context.Context, parts ...Part) *GenerateContentResponseIterator {
- cs.History = append(cs.History, newUserContent(parts))
- req := cs.m.newGenerateContentRequest(cs.History...)
+ cs.History = append(cs.History, NewUserContent(parts...))
+ req, err := cs.m.newGenerateContentRequest(cs.History...)
+ if err != nil {
+ return &GenerateContentResponseIterator{err: err}
+ }
req.GenerationConfig.CandidateCount = Ptr[int32](1)
- streamClient, err := cs.m.c.c.StreamGenerateContent(ctx, req)
+ streamClient, err := cs.m.c.gc.StreamGenerateContent(ctx, req)
return &GenerateContentResponseIterator{
sc: streamClient,
err: err,
diff --git a/vendor/github.com/google/generative-ai-go/genai/client.go b/vendor/github.com/google/generative-ai-go/genai/client.go
index 652312978..7e8177755 100644
--- a/vendor/github.com/google/generative-ai-go/genai/client.go
+++ b/vendor/github.com/google/generative-ai-go/genai/client.go
@@ -12,17 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// For the following go:generate line to work, do the following:
-// Install the protoveener tool:
+// For the following go:generate line to work, install the protoveener tool:
// git clone https://github.com/googleapis/google-cloud-go
// cd google-cloud-go
// go install ./internal/protoveneer/cmd/protoveneer
//
-// Set the environment variable GOOGLE_CLOUD_GO to the path to the above repo on your machine.
-// For example:
-// export GOOGLE_CLOUD_GO=$HOME/repos/google-cloud-go
-
-//go:generate protoveneer -license license.txt config.yaml $GOOGLE_CLOUD_GO/ai/generativelanguage/apiv1beta/generativelanguagepb
+//go:generate ./generate.sh
package genai
@@ -39,16 +34,16 @@ import (
"github.com/google/generative-ai-go/genai/internal"
gld "github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta" // discovery client
- "github.com/google/generative-ai-go/internal/support"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
)
// A Client is a Google generative AI client.
type Client struct {
- c *gl.GenerativeClient
+ gc *gl.GenerativeClient
mc *gl.ModelClient
fc *gl.FileClient
+ cc *gl.CacheClient
ds *gld.Service
}
@@ -68,24 +63,40 @@ then pass it as an option:
(If you're doing that already, then maybe the environment variable is empty or unset.)
Import the option package as "google.golang.org/api/option".`)
}
- c, err := gl.NewGenerativeRESTClient(ctx, opts...)
+ gc, err := gl.NewGenerativeRESTClient(ctx, opts...)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("creating generative client: %w", err)
}
mc, err := gl.NewModelRESTClient(ctx, opts...)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("creating model client: %w", err)
}
fc, err := gl.NewFileRESTClient(ctx, opts...)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("creating file client: %w", err)
+ }
+
+ // Workaround for https://github.com/google/generative-ai-go/issues/151
+ optsForCache := removeHTTPClientOption(opts)
+ cc, err := gl.NewCacheClient(ctx, optsForCache...)
+ if err != nil {
+ return nil, fmt.Errorf("creating cache client: %w", err)
}
+
ds, err := gld.NewService(ctx, opts...)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("creating discovery client: %w", err)
}
- c.SetGoogleClientInfo("gccl", "v"+internal.Version, "genai-go", internal.Version)
- return &Client{c, mc, fc, ds}, nil
+
+ kvs := []string{"gccl", "v" + internal.Version, "genai-go", internal.Version}
+ if a, ok := optionOfType[*clientInfo](opts); ok {
+ kvs = append(kvs, a.key, a.value)
+ }
+ gc.SetGoogleClientInfo(kvs...)
+ mc.SetGoogleClientInfo(kvs...)
+ fc.SetGoogleClientInfo(kvs...)
+
+ return &Client{gc, mc, fc, cc, ds}, nil
}
// hasAuthOption reports whether an authentication-related option was provided.
@@ -101,7 +112,7 @@ func hasAuthOption(opts []option.ClientOption) bool {
case "option.withAPIKey":
return v.String() != ""
- case "option.withHttpClient",
+ case "option.withHTTPClient",
"option.withTokenSource",
"option.withCredentialsFile",
"option.withCredentialsJSON":
@@ -111,9 +122,22 @@ func hasAuthOption(opts []option.ClientOption) bool {
return false
}
+// removeHTTPClientOption removes option.withHTTPClient from the given list
+// of options, if it exists; it returns the new (filtered) list.
+func removeHTTPClientOption(opts []option.ClientOption) []option.ClientOption {
+ var newOpts []option.ClientOption
+ for _, opt := range opts {
+ ts := reflect.ValueOf(opt).Type().String()
+ if ts != "option.withHTTPClient" {
+ newOpts = append(newOpts, opt)
+ }
+ }
+ return newOpts
+}
+
// Close closes the client.
func (c *Client) Close() error {
- return errors.Join(c.c.Close(), c.mc.Close(), c.fc.Close())
+ return errors.Join(c.gc.Close(), c.mc.Close(), c.fc.Close())
}
// GenerativeModel is a model that can generate text.
@@ -130,6 +154,9 @@ type GenerativeModel struct {
// SystemInstruction (also known as "system prompt") is a more forceful prompt to the model.
// The model will adhere the instructions more strongly than if they appeared in a normal prompt.
SystemInstruction *Content
+ // The name of the CachedContent to use.
+ // Must have already been created with [Client.CreateCachedContent].
+ CachedContentName string
}
// GenerativeModel creates a new instance of the named generative model.
@@ -152,9 +179,12 @@ func fullModelName(name string) string {
// GenerateContent produces a single request and response.
func (m *GenerativeModel) GenerateContent(ctx context.Context, parts ...Part) (*GenerateContentResponse, error) {
- content := newUserContent(parts)
- req := m.newGenerateContentRequest(content)
- res, err := m.c.c.GenerateContent(ctx, req)
+ content := NewUserContent(parts...)
+ req, err := m.newGenerateContentRequest(content)
+ if err != nil {
+ return nil, err
+ }
+ res, err := m.c.gc.GenerateContent(ctx, req)
if err != nil {
return nil, err
}
@@ -163,15 +193,18 @@ func (m *GenerativeModel) GenerateContent(ctx context.Context, parts ...Part) (*
// GenerateContentStream returns an iterator that enumerates responses.
func (m *GenerativeModel) GenerateContentStream(ctx context.Context, parts ...Part) *GenerateContentResponseIterator {
- streamClient, err := m.c.c.StreamGenerateContent(ctx, m.newGenerateContentRequest(newUserContent(parts)))
- return &GenerateContentResponseIterator{
- sc: streamClient,
- err: err,
+ iter := &GenerateContentResponseIterator{}
+ req, err := m.newGenerateContentRequest(NewUserContent(parts...))
+ if err != nil {
+ iter.err = err
+ } else {
+ iter.sc, iter.err = m.c.gc.StreamGenerateContent(ctx, req)
}
+ return iter
}
func (m *GenerativeModel) generateContent(ctx context.Context, req *pb.GenerateContentRequest) (*GenerateContentResponse, error) {
- streamClient, err := m.c.c.StreamGenerateContent(ctx, req)
+ streamClient, err := m.c.gc.StreamGenerateContent(ctx, req)
iter := &GenerateContentResponseIterator{
sc: streamClient,
err: err,
@@ -179,7 +212,7 @@ func (m *GenerativeModel) generateContent(ctx context.Context, req *pb.GenerateC
for {
_, err := iter.Next()
if err == iterator.Done {
- return iter.merged, nil
+ return iter.MergedResponse(), nil
}
if err != nil {
return nil, err
@@ -187,20 +220,25 @@ func (m *GenerativeModel) generateContent(ctx context.Context, req *pb.GenerateC
}
}
-func (m *GenerativeModel) newGenerateContentRequest(contents ...*Content) *pb.GenerateContentRequest {
- return &pb.GenerateContentRequest{
- Model: m.fullName,
- Contents: support.TransformSlice(contents, (*Content).toProto),
- SafetySettings: support.TransformSlice(m.SafetySettings, (*SafetySetting).toProto),
- Tools: support.TransformSlice(m.Tools, (*Tool).toProto),
- ToolConfig: m.ToolConfig.toProto(),
- GenerationConfig: m.GenerationConfig.toProto(),
- SystemInstruction: m.SystemInstruction.toProto(),
- }
-}
-
-func newUserContent(parts []Part) *Content {
- return &Content{Role: roleUser, Parts: parts}
+func (m *GenerativeModel) newGenerateContentRequest(contents ...*Content) (*pb.GenerateContentRequest, error) {
+ return pvCatchPanic(func() *pb.GenerateContentRequest {
+ var cc *string
+ if m.CachedContentName != "" {
+ cc = &m.CachedContentName
+ }
+ req := &pb.GenerateContentRequest{
+ Model: m.fullName,
+ Contents: transformSlice(contents, (*Content).toProto),
+ SafetySettings: transformSlice(m.SafetySettings, (*SafetySetting).toProto),
+ Tools: transformSlice(m.Tools, (*Tool).toProto),
+ ToolConfig: m.ToolConfig.toProto(),
+ GenerationConfig: m.GenerationConfig.toProto(),
+ SystemInstruction: m.SystemInstruction.toProto(),
+ CachedContent: cc,
+ }
+ debugPrint(req)
+ return req
+ })
}
// GenerateContentResponseIterator is an iterator over GnerateContentResponse.
@@ -239,7 +277,10 @@ func (iter *GenerateContentResponseIterator) Next() (*GenerateContentResponse, e
}
func protoToResponse(resp *pb.GenerateContentResponse) (*GenerateContentResponse, error) {
- gcp := (GenerateContentResponse{}).fromProto(resp)
+ gcp, err := fromProto[GenerateContentResponse](resp)
+ if err != nil {
+ return nil, err
+ }
if gcp == nil {
return nil, errors.New("empty response from model")
}
@@ -259,22 +300,37 @@ func protoToResponse(resp *pb.GenerateContentResponse) (*GenerateContentResponse
return gcp, nil
}
+// MergedResponse returns the result of combining all the streamed responses seen so far.
+// After iteration completes, the merged response should match the response obtained without streaming
+// (that is, if [GenerativeModel.GenerateContent] were called).
+func (iter *GenerateContentResponseIterator) MergedResponse() *GenerateContentResponse {
+ return iter.merged
+}
+
// CountTokens counts the number of tokens in the content.
func (m *GenerativeModel) CountTokens(ctx context.Context, parts ...Part) (*CountTokensResponse, error) {
- req := m.newCountTokensRequest(newUserContent(parts))
- res, err := m.c.c.CountTokens(ctx, req)
+ req, err := m.newCountTokensRequest(NewUserContent(parts...))
if err != nil {
return nil, err
}
-
- return (CountTokensResponse{}).fromProto(res), nil
+ res, err := m.c.gc.CountTokens(ctx, req)
+ if err != nil {
+ return nil, err
+ }
+ return fromProto[CountTokensResponse](res)
}
-func (m *GenerativeModel) newCountTokensRequest(contents ...*Content) *pb.CountTokensRequest {
- return &pb.CountTokensRequest{
- Model: m.fullName,
- Contents: support.TransformSlice(contents, (*Content).toProto),
+func (m *GenerativeModel) newCountTokensRequest(contents ...*Content) (*pb.CountTokensRequest, error) {
+ gcr, err := m.newGenerateContentRequest(contents...)
+ if err != nil {
+ return nil, err
+ }
+ req := &pb.CountTokensRequest{
+ Model: m.fullName,
+ GenerateContentRequest: gcr,
}
+ debugPrint(req)
+ return req, nil
}
// Info returns information about the model.
@@ -284,11 +340,12 @@ func (m *GenerativeModel) Info(ctx context.Context) (*ModelInfo, error) {
func (c *Client) modelInfo(ctx context.Context, fullName string) (*ModelInfo, error) {
req := &pb.GetModelRequest{Name: fullName}
+ debugPrint(req)
res, err := c.mc.GetModel(ctx, req)
if err != nil {
return nil, err
}
- return (ModelInfo{}).fromProto(res), nil
+ return fromProto[ModelInfo](res)
}
// A BlockedError indicates that the model's response was blocked.
@@ -399,3 +456,21 @@ func mergeTexts(in []Part) []Part {
}
return out
}
+
+// transformSlice applies f to each element of from and returns
+// a new slice with the results.
+func transformSlice[From, To any](from []From, f func(From) To) []To {
+ if from == nil {
+ return nil
+ }
+ to := make([]To, len(from))
+ for i, e := range from {
+ to[i] = f(e)
+ }
+ return to
+}
+
+func fromProto[V interface{ fromProto(P) *V }, P any](p P) (*V, error) {
+ var v V
+ return pvCatchPanic(func() *V { return v.fromProto(p) })
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/config.yaml b/vendor/github.com/google/generative-ai-go/genai/config.yaml
index acaa46962..8b025b870 100644
--- a/vendor/github.com/google/generative-ai-go/genai/config.yaml
+++ b/vendor/github.com/google/generative-ai-go/genai/config.yaml
@@ -17,7 +17,6 @@
package: genai
protoImportPath: cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb
-supportImportPath: github.com/google/generative-ai-go/internal/support
types:
HarmCategory:
@@ -65,10 +64,16 @@ types:
fields:
MimeType:
name: MIMEType
+ doc: |
+ The IANA standard MIME type of the source data.
+ If present, this overrides the MIME type specified or inferred
+ when the file was uploaded.
+ The supported MIME types are documented on [this page].
+
+ [this page]: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=go#supported_file_formats
FileUri:
name: URI
- # TODO(jba): support field doc in protoveneer
- # doc: 'The URI returned from UploadFile or GetFile.'
+ doc: 'The URI returned from UploadFile or GetFile.'
GenerationConfig:
fields:
@@ -128,6 +133,15 @@ types:
# Types for function calling
Tool:
+ fields:
+ FunctionDeclarations:
+ doc: |
+ Optional. A list of FunctionDeclarations available to the model that
+ can be used for function calling. The model or system does not execute
+ the function. Instead the defined function may be returned as a [FunctionCall]
+ part with arguments to the client side for execution. The next conversation
+ turn may contain a [FunctionResponse] with the role "function" generation
+ context for the next model turn.
ToolConfig:
FunctionDeclaration:
FunctionCall:
@@ -149,17 +163,22 @@ types:
FunctionCallingConfig_MODE_UNSPECIFIED: FunctionCallingUnspecified
File:
+ populateToFrom: populateFileTo, populateFileFrom
fields:
Uri:
name: URI
MimeType:
name: MIMEType
- Error:
- # TODO(jba): support or convert status.Status
- omit: true
Metadata:
- # TODO(jba): support
- omit: true
+ type: '*FileMetadata'
+ noConvert: true
+ doc: 'Metadata for the File.'
+
+ VideoMetadata:
+ fields:
+ VideoDuration:
+ name: Duration
+
File_State:
name: FileState
docVerb: represents
@@ -178,6 +197,38 @@ types:
TotalTokenCount:
type: int32
+ CachedContent:
+ populateToFrom: populateCachedContentTo, populateCachedContentFrom
+ fields:
+ Expiration:
+ type: ExpireTimeOrTTL
+ noConvert: true
+ Name:
+ type: string
+ Model:
+ type: string
+ DisplayName:
+ type: string
+
+ CachedContent_UsageMetadata:
+ name: CachedContentUsageMetadata
+
+ CodeExecution:
+ ExecutableCode:
+ CodeExecutionResult:
+
+ ExecutableCode_Language:
+ name: ExecutableCodeLanguage
+ protoPrefix: ExecutableCode
+ veneerPrefix: ExecutableCode
+
+ CodeExecutionResult_Outcome:
+ name: CodeExecutionResultOutcome
+ protoPrefix: CodeExecutionResult
+ veneerPrefix: CodeExecutionResult
+ valueNames:
+ CodeExecutionResult_OUTCOME_OK: CodeExecutionResultOutcomeOK
+
# Omit everything not explicitly configured.
omitTypes:
- '*'
diff --git a/vendor/github.com/google/generative-ai-go/genai/content.go b/vendor/github.com/google/generative-ai-go/genai/content.go
index 2c34d0e3b..030d1ceee 100644
--- a/vendor/github.com/google/generative-ai-go/genai/content.go
+++ b/vendor/github.com/google/generative-ai-go/genai/content.go
@@ -25,7 +25,14 @@ const (
roleModel = "model"
)
-// A Part is either a Text, a Blob or a FunctionResponse.
+// A Part is a piece of model content.
+// A Part can be one of the following types:
+// - Text
+// - Blob
+// - FunctionCall
+// - FunctionResponse
+// - ExecutableCode
+// - CodeExecutionResult
type Part interface {
toPart() *pb.Part
}
@@ -52,6 +59,10 @@ func partFromProto(p *pb.Part) Part {
case *pb.Part_FunctionResponse:
panic("FunctionResponse unimplemented")
+ case *pb.Part_ExecutableCode:
+ return (ExecutableCode{}).fromProto(d.ExecutableCode)
+ case *pb.Part_CodeExecutionResult:
+ return (CodeExecutionResult{}).fromProto(d.CodeExecutionResult)
default:
panic(fmt.Errorf("unknown Part.Data type %T", p.Data))
}
@@ -109,6 +120,22 @@ func (fd FileData) toPart() *pb.Part {
}
}
+func (ec ExecutableCode) toPart() *pb.Part {
+ return &pb.Part{
+ Data: &pb.Part_ExecutableCode{
+ ExecutableCode: ec.toProto(),
+ },
+ }
+}
+
+func (c CodeExecutionResult) toPart() *pb.Part {
+ return &pb.Part{
+ Data: &pb.Part_CodeExecutionResult{
+ CodeExecutionResult: c.toProto(),
+ },
+ }
+}
+
// Ptr returns a pointer to its argument.
// It can be used to initialize pointer fields:
//
@@ -143,3 +170,13 @@ func (c *Candidate) FunctionCalls() []FunctionCall {
}
return fcs
}
+
+// NewUserContent returns a *Content with a "user" role set and one or more
+// parts.
+func NewUserContent(parts ...Part) *Content {
+ content := &Content{Role: roleUser, Parts: []Part{}}
+ for _, part := range parts {
+ content.Parts = append(content.Parts, part)
+ }
+ return content
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/debug.go b/vendor/github.com/google/generative-ai-go/genai/debug.go
new file mode 100644
index 000000000..c0d04dd5b
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/debug.go
@@ -0,0 +1,38 @@
+// 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.
+
+// This file contains debugging support functions.
+
+package genai
+
+import (
+ "fmt"
+ "os"
+
+ "google.golang.org/protobuf/encoding/prototext"
+ "google.golang.org/protobuf/proto"
+)
+
+// printRequests controls whether request protobufs are written to stderr.
+var printRequests = false
+
+func debugPrint(m proto.Message) {
+ if !printRequests {
+ return
+ }
+ fmt.Fprintln(os.Stderr, "--------")
+ fmt.Fprintf(os.Stderr, "%T\n", m)
+ fmt.Fprint(os.Stderr, prototext.Format(m))
+ fmt.Fprintln(os.Stderr, "^^^^^^^^")
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/embed.go b/vendor/github.com/google/generative-ai-go/genai/embed.go
index 8af76240f..cea90ecc5 100644
--- a/vendor/github.com/google/generative-ai-go/genai/embed.go
+++ b/vendor/github.com/google/generative-ai-go/genai/embed.go
@@ -55,7 +55,7 @@ func (m *EmbeddingModel) EmbedContent(ctx context.Context, parts ...Part) (*Embe
// the task type is set to TaskTypeRetrievalDocument.
func (m *EmbeddingModel) EmbedContentWithTitle(ctx context.Context, title string, parts ...Part) (*EmbedContentResponse, error) {
req := newEmbedContentRequest(m.fullName, m.TaskType, title, parts)
- res, err := m.c.c.EmbedContent(ctx, req)
+ res, err := m.c.gc.EmbedContent(ctx, req)
if err != nil {
return nil, err
}
@@ -65,7 +65,7 @@ func (m *EmbeddingModel) EmbedContentWithTitle(ctx context.Context, title string
func newEmbedContentRequest(model string, tt TaskType, title string, parts []Part) *pb.EmbedContentRequest {
req := &pb.EmbedContentRequest{
Model: model,
- Content: newUserContent(parts).toProto(),
+ Content: NewUserContent(parts...).toProto(),
}
// A non-empty title overrides the task type.
if title != "" {
@@ -76,6 +76,7 @@ func newEmbedContentRequest(model string, tt TaskType, title string, parts []Par
taskType := pb.TaskType(tt)
req.TaskType = &taskType
}
+ debugPrint(req)
return req
}
@@ -112,7 +113,7 @@ func (b *EmbeddingBatch) AddContentWithTitle(title string, parts ...Part) *Embed
// BatchEmbedContents returns the embeddings for all the contents in the batch.
func (m *EmbeddingModel) BatchEmbedContents(ctx context.Context, b *EmbeddingBatch) (*BatchEmbedContentsResponse, error) {
- res, err := m.c.c.BatchEmbedContents(ctx, b.req)
+ res, err := m.c.gc.BatchEmbedContents(ctx, b.req)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/google/generative-ai-go/genai/files.go b/vendor/github.com/google/generative-ai-go/genai/files.go
index 07e69cc25..12de62457 100644
--- a/vendor/github.com/google/generative-ai-go/genai/files.go
+++ b/vendor/github.com/google/generative-ai-go/genai/files.go
@@ -30,16 +30,27 @@ import (
// UploadFileOptions are options for [Client.UploadFile].
type UploadFileOptions struct {
- DisplayName string // a more readable name for the file
- MIMEType string // the MIME type of the file; if omitted, it will be inferred
+ // A more readable name for the file.
+ DisplayName string
+
+ // The IANA standard MIME type of the file. It will be stored with the file as metadata.
+ // If omitted, the service will try to infer it. You may instead wish to use
+ // [http.DetectContentType].
+ // The supported MIME types are documented on [this page].
+ //
+ // [this page]: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=go#supported_file_formats
+ MIMEType string
}
// UploadFile copies the contents of the given io.Reader to file storage associated
// with the service, and returns information about the resulting file.
//
-// The name may be empty, in which case a unique name will be generated.
+// The name is a relatively short, unique identifier for the file (rather than a typical
+// filename).
+// Typically it should be left empty, in which case a unique name will be generated.
// Otherwise, it can contain up to 40 characters that are lowercase
// alphanumeric or dashes (-), not starting or ending with a dash.
+// To generate your own unique names, consider a cryptographic hash algorithm like SHA-1.
// The string "files/" is prepended to the name if it does not contain a '/'.
//
// Use the returned file's URI field with a [FileData] Part to use it for generation.
@@ -74,7 +85,9 @@ func (c *Client) UploadFile(ctx context.Context, name string, r io.Reader, opts
// GetFile returns the named file.
func (c *Client) GetFile(ctx context.Context, name string) (*File, error) {
- pf, err := c.fc.GetFile(ctx, &pb.GetFileRequest{Name: userNameToServiceName(name)})
+ req := &pb.GetFileRequest{Name: userNameToServiceName(name)}
+ debugPrint(req)
+ pf, err := c.fc.GetFile(ctx, req)
if err != nil {
return nil, err
}
@@ -84,7 +97,9 @@ func (c *Client) GetFile(ctx context.Context, name string) (*File, error) {
// DeleteFile deletes the file with the given name.
// It is an error to delete a file that does not exist.
func (c *Client) DeleteFile(ctx context.Context, name string) error {
- return c.fc.DeleteFile(ctx, &pb.DeleteFileRequest{Name: userNameToServiceName(name)})
+ req := &pb.DeleteFileRequest{Name: userNameToServiceName(name)}
+ debugPrint(req)
+ return c.fc.DeleteFile(ctx, req)
}
// userNameToServiceName converts a name supplied by the user to a name required by the service.
@@ -121,3 +136,40 @@ func (it *FileIterator) Next() (*File, error) {
func (it *FileIterator) PageInfo() *iterator.PageInfo {
return it.it.PageInfo()
}
+
+// FileMetadata holds metadata about a file.
+type FileMetadata struct {
+ // Set if the file contains video.
+ Video *VideoMetadata
+}
+
+func populateFileTo(p *pb.File, f *File) {
+ p.Metadata = nil
+ if f == nil || f.Metadata == nil {
+ return
+ }
+ if f.Metadata.Video != nil {
+ p.Metadata = &pb.File_VideoMetadata{
+ VideoMetadata: f.Metadata.Video.toProto(),
+ }
+ }
+}
+
+func populateFileFrom(f *File, p *pb.File) {
+ f.Metadata = nil
+ if p == nil || p.Metadata == nil {
+ return
+ }
+
+ if p.Metadata != nil {
+ switch m := p.Metadata.(type) {
+ case *pb.File_VideoMetadata:
+ f.Metadata = &FileMetadata{
+ Video: (VideoMetadata{}).fromProto(m.VideoMetadata),
+ }
+ default:
+ // ignore other types
+ // TODO: signal a problem
+ }
+ }
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/generate.sh b/vendor/github.com/google/generative-ai-go/genai/generate.sh
new file mode 100644
index 000000000..7be31e06e
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/generate.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+# 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.
+
+version=$(awk '$1 == "cloud.google.com/go/ai" {print $2}' ../go.mod)
+
+if [[ $version = '' ]]; then
+ echo >&2 "could not get version of cloud.google.com/go/ai from ../go.mod"
+ exit 1
+fi
+
+dir=~/go/pkg/mod/cloud.google.com/go/ai@$version/generativelanguage/apiv1beta/generativelanguagepb
+
+if [[ ! -d $dir ]]; then
+ echo >&2 "$dir does not exist or is not a directory"
+ exit 1
+fi
+
+echo "generating from $dir"
+protoveneer -license license.txt config.yaml $dir
+
diff --git a/vendor/github.com/google/generative-ai-go/genai/generativelanguagepb_veneer.gen.go b/vendor/github.com/google/generative-ai-go/genai/generativelanguagepb_veneer.gen.go
index 11ca1d2c0..54b324af7 100644
--- a/vendor/github.com/google/generative-ai-go/genai/generativelanguagepb_veneer.gen.go
+++ b/vendor/github.com/google/generative-ai-go/genai/generativelanguagepb_veneer.gen.go
@@ -18,11 +18,15 @@ package genai
import (
"fmt"
+ "time"
pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
- "github.com/google/generative-ai-go/internal/support"
+ "github.com/googleapis/gax-go/v2/apierror"
+ spb "google.golang.org/genproto/googleapis/rpc/status"
+ gstatus "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/types/known/durationpb"
+ "google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
- "time"
)
// BatchEmbedContentsResponse is the response to a `BatchEmbedContentsRequest`.
@@ -37,7 +41,7 @@ func (v *BatchEmbedContentsResponse) toProto() *pb.BatchEmbedContentsResponse {
return nil
}
return &pb.BatchEmbedContentsResponse{
- Embeddings: support.TransformSlice(v.Embeddings, (*ContentEmbedding).toProto),
+ Embeddings: pvTransformSlice(v.Embeddings, (*ContentEmbedding).toProto),
}
}
@@ -46,7 +50,7 @@ func (BatchEmbedContentsResponse) fromProto(p *pb.BatchEmbedContentsResponse) *B
return nil
}
return &BatchEmbedContentsResponse{
- Embeddings: support.TransformSlice(p.Embeddings, (ContentEmbedding{}).fromProto),
+ Embeddings: pvTransformSlice(p.Embeddings, (ContentEmbedding{}).fromProto),
}
}
@@ -96,7 +100,7 @@ const (
// BlockReasonSafety means prompt was blocked due to safety reasons. You can inspect
// `safety_ratings` to understand which safety category blocked it.
BlockReasonSafety BlockReason = 1
- // BlockReasonOther means prompt was blocked due to unknown reaasons.
+ // BlockReasonOther means prompt was blocked due to unknown reasons.
BlockReasonOther BlockReason = 2
)
@@ -113,6 +117,110 @@ func (v BlockReason) String() string {
return fmt.Sprintf("BlockReason(%d)", v)
}
+// CachedContent is content that has been preprocessed and can be used in subsequent request
+// to GenerativeService.
+//
+// Cached content can be only used with model it was created for.
+type CachedContent struct {
+ // Specifies when this resource will expire.
+ //
+ // Types that are assignable to Expiration:
+ //
+ // *CachedContent_ExpireTime
+ // *CachedContent_Ttl
+ Expiration ExpireTimeOrTTL
+ // Optional. Identifier. The resource name referring to the cached content.
+ // Format: `cachedContents/{id}`
+ Name string
+ // Optional. Immutable. The user-generated meaningful display name of the
+ // cached content. Maximum 128 Unicode characters.
+ DisplayName string
+ // Required. Immutable. The name of the `Model` to use for cached content
+ // Format: `models/{model}`
+ Model string
+ // Optional. Input only. Immutable. Developer set system instruction.
+ // Currently text only.
+ SystemInstruction *Content
+ // Optional. Input only. Immutable. The content to cache.
+ Contents []*Content
+ // Optional. Input only. Immutable. A list of `Tools` the model may use to
+ // generate the next response
+ Tools []*Tool
+ // Optional. Input only. Immutable. Tool config. This config is shared for all
+ // tools.
+ ToolConfig *ToolConfig
+ // Output only. Creation time of the cache entry.
+ CreateTime time.Time
+ // Output only. When the cache entry was last updated in UTC time.
+ UpdateTime time.Time
+ // Output only. Metadata on the usage of the cached content.
+ UsageMetadata *CachedContentUsageMetadata
+}
+
+func (v *CachedContent) toProto() *pb.CachedContent {
+ if v == nil {
+ return nil
+ }
+ p := &pb.CachedContent{
+ Name: pvAddrOrNil(v.Name),
+ DisplayName: pvAddrOrNil(v.DisplayName),
+ Model: pvAddrOrNil(v.Model),
+ SystemInstruction: v.SystemInstruction.toProto(),
+ Contents: pvTransformSlice(v.Contents, (*Content).toProto),
+ Tools: pvTransformSlice(v.Tools, (*Tool).toProto),
+ ToolConfig: v.ToolConfig.toProto(),
+ CreateTime: pvTimeToProto(v.CreateTime),
+ UpdateTime: pvTimeToProto(v.UpdateTime),
+ UsageMetadata: v.UsageMetadata.toProto(),
+ }
+ populateCachedContentTo(p, v)
+ return p
+}
+
+func (CachedContent) fromProto(p *pb.CachedContent) *CachedContent {
+ if p == nil {
+ return nil
+ }
+ v := &CachedContent{
+ Name: pvDerefOrZero(p.Name),
+ DisplayName: pvDerefOrZero(p.DisplayName),
+ Model: pvDerefOrZero(p.Model),
+ SystemInstruction: (Content{}).fromProto(p.SystemInstruction),
+ Contents: pvTransformSlice(p.Contents, (Content{}).fromProto),
+ Tools: pvTransformSlice(p.Tools, (Tool{}).fromProto),
+ ToolConfig: (ToolConfig{}).fromProto(p.ToolConfig),
+ CreateTime: pvTimeFromProto(p.CreateTime),
+ UpdateTime: pvTimeFromProto(p.UpdateTime),
+ UsageMetadata: (CachedContentUsageMetadata{}).fromProto(p.UsageMetadata),
+ }
+ populateCachedContentFrom(v, p)
+ return v
+}
+
+// CachedContentUsageMetadata is metadata on the usage of the cached content.
+type CachedContentUsageMetadata struct {
+ // Total number of tokens that the cached content consumes.
+ TotalTokenCount int32
+}
+
+func (v *CachedContentUsageMetadata) toProto() *pb.CachedContent_UsageMetadata {
+ if v == nil {
+ return nil
+ }
+ return &pb.CachedContent_UsageMetadata{
+ TotalTokenCount: v.TotalTokenCount,
+ }
+}
+
+func (CachedContentUsageMetadata) fromProto(p *pb.CachedContent_UsageMetadata) *CachedContentUsageMetadata {
+ if p == nil {
+ return nil
+ }
+ return &CachedContentUsageMetadata{
+ TotalTokenCount: p.TotalTokenCount,
+ }
+}
+
// Candidate is a response candidate generated from the model.
type Candidate struct {
// Output only. Index of the candidate in the list of candidates.
@@ -142,10 +250,10 @@ func (v *Candidate) toProto() *pb.Candidate {
return nil
}
return &pb.Candidate{
- Index: support.AddrOrNil(v.Index),
+ Index: pvAddrOrNil(v.Index),
Content: v.Content.toProto(),
FinishReason: pb.Candidate_FinishReason(v.FinishReason),
- SafetyRatings: support.TransformSlice(v.SafetyRatings, (*SafetyRating).toProto),
+ SafetyRatings: pvTransformSlice(v.SafetyRatings, (*SafetyRating).toProto),
CitationMetadata: v.CitationMetadata.toProto(),
TokenCount: v.TokenCount,
}
@@ -156,10 +264,10 @@ func (Candidate) fromProto(p *pb.Candidate) *Candidate {
return nil
}
return &Candidate{
- Index: support.DerefOrZero(p.Index),
+ Index: pvDerefOrZero(p.Index),
Content: (Content{}).fromProto(p.Content),
FinishReason: FinishReason(p.FinishReason),
- SafetyRatings: support.TransformSlice(p.SafetyRatings, (SafetyRating{}).fromProto),
+ SafetyRatings: pvTransformSlice(p.SafetyRatings, (SafetyRating{}).fromProto),
CitationMetadata: (CitationMetadata{}).fromProto(p.CitationMetadata),
TokenCount: p.TokenCount,
}
@@ -176,7 +284,7 @@ func (v *CitationMetadata) toProto() *pb.CitationMetadata {
return nil
}
return &pb.CitationMetadata{
- CitationSources: support.TransformSlice(v.CitationSources, (*CitationSource).toProto),
+ CitationSources: pvTransformSlice(v.CitationSources, (*CitationSource).toProto),
}
}
@@ -185,7 +293,7 @@ func (CitationMetadata) fromProto(p *pb.CitationMetadata) *CitationMetadata {
return nil
}
return &CitationMetadata{
- CitationSources: support.TransformSlice(p.CitationSources, (CitationSource{}).fromProto),
+ CitationSources: pvTransformSlice(p.CitationSources, (CitationSource{}).fromProto),
}
}
@@ -215,7 +323,7 @@ func (v *CitationSource) toProto() *pb.CitationSource {
StartIndex: v.StartIndex,
EndIndex: v.EndIndex,
Uri: v.URI,
- License: support.AddrOrNil(v.License),
+ License: pvAddrOrNil(v.License),
}
}
@@ -227,8 +335,92 @@ func (CitationSource) fromProto(p *pb.CitationSource) *CitationSource {
StartIndex: p.StartIndex,
EndIndex: p.EndIndex,
URI: p.Uri,
- License: support.DerefOrZero(p.License),
+ License: pvDerefOrZero(p.License),
+ }
+}
+
+// CodeExecution is tool that executes code generated by the model, and automatically returns
+// the result to the model.
+//
+// See also `ExecutableCode` and `CodeExecutionResult` which are only generated
+// when using this tool.
+type CodeExecution struct {
+}
+
+func (v *CodeExecution) toProto() *pb.CodeExecution {
+ if v == nil {
+ return nil
}
+ return &pb.CodeExecution{}
+}
+
+func (CodeExecution) fromProto(p *pb.CodeExecution) *CodeExecution {
+ if p == nil {
+ return nil
+ }
+ return &CodeExecution{}
+}
+
+// CodeExecutionResult is result of executing the `ExecutableCode`.
+//
+// Only generated when using the `CodeExecution`, and always follows a `part`
+// containing the `ExecutableCode`.
+type CodeExecutionResult struct {
+ // Required. Outcome of the code execution.
+ Outcome CodeExecutionResultOutcome
+ // Optional. Contains stdout when code execution is successful, stderr or
+ // other description otherwise.
+ Output string
+}
+
+func (v *CodeExecutionResult) toProto() *pb.CodeExecutionResult {
+ if v == nil {
+ return nil
+ }
+ return &pb.CodeExecutionResult{
+ Outcome: pb.CodeExecutionResult_Outcome(v.Outcome),
+ Output: v.Output,
+ }
+}
+
+func (CodeExecutionResult) fromProto(p *pb.CodeExecutionResult) *CodeExecutionResult {
+ if p == nil {
+ return nil
+ }
+ return &CodeExecutionResult{
+ Outcome: CodeExecutionResultOutcome(p.Outcome),
+ Output: p.Output,
+ }
+}
+
+// CodeExecutionResultOutcome is enumeration of possible outcomes of the code execution.
+type CodeExecutionResultOutcome int32
+
+const (
+ // CodeExecutionResultOutcomeUnspecified means unspecified status. This value should not be used.
+ CodeExecutionResultOutcomeUnspecified CodeExecutionResultOutcome = 0
+ // CodeExecutionResultOutcomeOK means code execution completed successfully.
+ CodeExecutionResultOutcomeOK CodeExecutionResultOutcome = 1
+ // CodeExecutionResultOutcomeFailed means code execution finished but with a failure. `stderr` should contain the
+ // reason.
+ CodeExecutionResultOutcomeFailed CodeExecutionResultOutcome = 2
+ // CodeExecutionResultOutcomeDeadlineExceeded means code execution ran for too long, and was cancelled. There may or may not
+ // be a partial output present.
+ CodeExecutionResultOutcomeDeadlineExceeded CodeExecutionResultOutcome = 3
+)
+
+var namesForCodeExecutionResultOutcome = map[CodeExecutionResultOutcome]string{
+ CodeExecutionResultOutcomeUnspecified: "CodeExecutionResultOutcomeUnspecified",
+ CodeExecutionResultOutcomeOK: "CodeExecutionResultOutcomeOK",
+ CodeExecutionResultOutcomeFailed: "CodeExecutionResultOutcomeFailed",
+ CodeExecutionResultOutcomeDeadlineExceeded: "CodeExecutionResultOutcomeDeadlineExceeded",
+}
+
+func (v CodeExecutionResultOutcome) String() string {
+ if n, ok := namesForCodeExecutionResultOutcome[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("CodeExecutionResultOutcome(%d)", v)
}
// Content is the base structured datatype containing multi-part content of a message.
@@ -252,7 +444,7 @@ func (v *Content) toProto() *pb.Content {
return nil
}
return &pb.Content{
- Parts: support.TransformSlice(v.Parts, partToProto),
+ Parts: pvTransformSlice(v.Parts, partToProto),
Role: v.Role,
}
}
@@ -262,7 +454,7 @@ func (Content) fromProto(p *pb.Content) *Content {
return nil
}
return &Content{
- Parts: support.TransformSlice(p.Parts, partFromProto),
+ Parts: pvTransformSlice(p.Parts, partFromProto),
Role: p.Role,
}
}
@@ -297,8 +489,13 @@ func (ContentEmbedding) fromProto(p *pb.ContentEmbedding) *ContentEmbedding {
type CountTokensResponse struct {
// The number of tokens that the `model` tokenizes the `prompt` into.
//
- // Always non-negative.
+ // Always non-negative. When cached_content is set, this is still the total
+ // effective prompt size. I.e. this includes the number of tokens in the
+ // cached content.
TotalTokens int32
+ // Number of tokens in the cached part of the prompt, i.e. in the cached
+ // content.
+ CachedContentTokenCount int32
}
func (v *CountTokensResponse) toProto() *pb.CountTokensResponse {
@@ -306,7 +503,8 @@ func (v *CountTokensResponse) toProto() *pb.CountTokensResponse {
return nil
}
return &pb.CountTokensResponse{
- TotalTokens: v.TotalTokens,
+ TotalTokens: v.TotalTokens,
+ CachedContentTokenCount: v.CachedContentTokenCount,
}
}
@@ -315,7 +513,8 @@ func (CountTokensResponse) fromProto(p *pb.CountTokensResponse) *CountTokensResp
return nil
}
return &CountTokensResponse{
- TotalTokens: p.TotalTokens,
+ TotalTokens: p.TotalTokens,
+ CachedContentTokenCount: p.CachedContentTokenCount,
}
}
@@ -343,8 +542,65 @@ func (EmbedContentResponse) fromProto(p *pb.EmbedContentResponse) *EmbedContentR
}
}
+// ExecutableCode is code generated by the model that is meant to be executed, and the result
+// returned to the model.
+//
+// Only generated when using the `CodeExecution` tool, in which the code will
+// be automatically executed, and a corresponding `CodeExecutionResult` will
+// also be generated.
+type ExecutableCode struct {
+ // Required. Programming language of the `code`.
+ Language ExecutableCodeLanguage
+ // Required. The code to be executed.
+ Code string
+}
+
+func (v *ExecutableCode) toProto() *pb.ExecutableCode {
+ if v == nil {
+ return nil
+ }
+ return &pb.ExecutableCode{
+ Language: pb.ExecutableCode_Language(v.Language),
+ Code: v.Code,
+ }
+}
+
+func (ExecutableCode) fromProto(p *pb.ExecutableCode) *ExecutableCode {
+ if p == nil {
+ return nil
+ }
+ return &ExecutableCode{
+ Language: ExecutableCodeLanguage(p.Language),
+ Code: p.Code,
+ }
+}
+
+// ExecutableCodeLanguage is supported programming languages for the generated code.
+type ExecutableCodeLanguage int32
+
+const (
+ // ExecutableCodeLanguageUnspecified means unspecified language. This value should not be used.
+ ExecutableCodeLanguageUnspecified ExecutableCodeLanguage = 0
+ // ExecutableCodePython means python >= 3.10, with numpy and simpy available.
+ ExecutableCodePython ExecutableCodeLanguage = 1
+)
+
+var namesForExecutableCodeLanguage = map[ExecutableCodeLanguage]string{
+ ExecutableCodeLanguageUnspecified: "ExecutableCodeLanguageUnspecified",
+ ExecutableCodePython: "ExecutableCodePython",
+}
+
+func (v ExecutableCodeLanguage) String() string {
+ if n, ok := namesForExecutableCodeLanguage[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("ExecutableCodeLanguage(%d)", v)
+}
+
// File is a file uploaded to the API.
type File struct {
+ // Metadata for the File.
+ Metadata *FileMetadata
// Immutable. Identifier. The `File` resource name. The ID (name excluding the
// "files/" prefix) can contain up to 40 characters that are lowercase
// alphanumeric or dashes (-). The ID cannot start or end with a dash. If the
@@ -372,49 +628,62 @@ type File struct {
URI string
// Output only. Processing state of the File.
State FileState
+ // Output only. Error status if File processing failed.
+ Error *apierror.APIError
}
func (v *File) toProto() *pb.File {
if v == nil {
return nil
}
- return &pb.File{
+ p := &pb.File{
Name: v.Name,
DisplayName: v.DisplayName,
MimeType: v.MIMEType,
SizeBytes: v.SizeBytes,
- CreateTime: timestamppb.New(v.CreateTime),
- UpdateTime: timestamppb.New(v.UpdateTime),
- ExpirationTime: timestamppb.New(v.ExpirationTime),
+ CreateTime: pvTimeToProto(v.CreateTime),
+ UpdateTime: pvTimeToProto(v.UpdateTime),
+ ExpirationTime: pvTimeToProto(v.ExpirationTime),
Sha256Hash: v.Sha256Hash,
Uri: v.URI,
State: pb.File_State(v.State),
+ Error: pvAPIErrorToProto(v.Error),
}
+ populateFileTo(p, v)
+ return p
}
func (File) fromProto(p *pb.File) *File {
if p == nil {
return nil
}
- return &File{
+ v := &File{
Name: p.Name,
DisplayName: p.DisplayName,
MIMEType: p.MimeType,
SizeBytes: p.SizeBytes,
- CreateTime: support.TimeFromProto(p.CreateTime),
- UpdateTime: support.TimeFromProto(p.UpdateTime),
- ExpirationTime: support.TimeFromProto(p.ExpirationTime),
+ CreateTime: pvTimeFromProto(p.CreateTime),
+ UpdateTime: pvTimeFromProto(p.UpdateTime),
+ ExpirationTime: pvTimeFromProto(p.ExpirationTime),
Sha256Hash: p.Sha256Hash,
URI: p.Uri,
State: FileState(p.State),
+ Error: pvAPIErrorFromProto(p.Error),
}
+ populateFileFrom(v, p)
+ return v
}
// FileData is URI based data.
type FileData struct {
- // Optional. The IANA standard MIME type of the source data.
+ // The IANA standard MIME type of the source data.
+ // If present, this overrides the MIME type specified or inferred
+ // when the file was uploaded.
+ // The supported MIME types are documented on [this page].
+ //
+ // [this page]: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=go#supported_file_formats
MIMEType string
- // Required. URI.
+ // The URI returned from UploadFile or GetFile.
URI string
}
@@ -518,7 +787,7 @@ func (v *FunctionCall) toProto() *pb.FunctionCall {
}
return &pb.FunctionCall{
Name: v.Name,
- Args: support.MapToStructPB(v.Args),
+ Args: pvMapToStructPB(v.Args),
}
}
@@ -528,7 +797,7 @@ func (FunctionCall) fromProto(p *pb.FunctionCall) *FunctionCall {
}
return &FunctionCall{
Name: p.Name,
- Args: support.MapFromStructPB(p.Args),
+ Args: pvMapFromStructPB(p.Args),
}
}
@@ -574,7 +843,7 @@ const (
// FunctionCallingUnspecified means unspecified function calling mode. This value should not be used.
FunctionCallingUnspecified FunctionCallingMode = 0
// FunctionCallingAuto means default model behavior, model decides to predict either a function call
- // or a natural language repspose.
+ // or a natural language response.
FunctionCallingAuto FunctionCallingMode = 1
// FunctionCallingAny means model is constrained to always predicting a function call only.
// If "allowed_function_names" are set, the predicted function call will be
@@ -661,7 +930,7 @@ func (v *FunctionResponse) toProto() *pb.FunctionResponse {
}
return &pb.FunctionResponse{
Name: v.Name,
- Response: support.MapToStructPB(v.Response),
+ Response: pvMapToStructPB(v.Response),
}
}
@@ -671,7 +940,7 @@ func (FunctionResponse) fromProto(p *pb.FunctionResponse) *FunctionResponse {
}
return &FunctionResponse{
Name: p.Name,
- Response: support.MapFromStructPB(p.Response),
+ Response: pvMapFromStructPB(p.Response),
}
}
@@ -699,7 +968,7 @@ func (v *GenerateContentResponse) toProto() *pb.GenerateContentResponse {
return nil
}
return &pb.GenerateContentResponse{
- Candidates: support.TransformSlice(v.Candidates, (*Candidate).toProto),
+ Candidates: pvTransformSlice(v.Candidates, (*Candidate).toProto),
PromptFeedback: v.PromptFeedback.toProto(),
UsageMetadata: v.UsageMetadata.toProto(),
}
@@ -710,7 +979,7 @@ func (GenerateContentResponse) fromProto(p *pb.GenerateContentResponse) *Generat
return nil
}
return &GenerateContentResponse{
- Candidates: support.TransformSlice(p.Candidates, (Candidate{}).fromProto),
+ Candidates: pvTransformSlice(p.Candidates, (Candidate{}).fromProto),
PromptFeedback: (PromptFeedback{}).fromProto(p.PromptFeedback),
UsageMetadata: (UsageMetadata{}).fromProto(p.UsageMetadata),
}
@@ -971,12 +1240,14 @@ type ModelInfo struct {
SupportedGenerationMethods []string
// Controls the randomness of the output.
//
- // Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will
- // produce responses that are more varied, while a value closer to `0.0` will
- // typically result in less surprising responses from the model.
+ // Values can range over `[0.0,max_temperature]`, inclusive. A higher value
+ // will produce responses that are more varied, while a value closer to `0.0`
+ // will typically result in less surprising responses from the model.
// This value specifies default to be used by the backend while making the
// call to the model.
Temperature float32
+ // The maximum temperature this model can use.
+ MaxTemperature *float32
// For Nucleus sampling.
//
// Nucleus sampling considers the smallest set of tokens whose probability
@@ -1007,9 +1278,10 @@ func (v *ModelInfo) toProto() *pb.Model {
InputTokenLimit: v.InputTokenLimit,
OutputTokenLimit: v.OutputTokenLimit,
SupportedGenerationMethods: v.SupportedGenerationMethods,
- Temperature: support.AddrOrNil(v.Temperature),
- TopP: support.AddrOrNil(v.TopP),
- TopK: support.AddrOrNil(v.TopK),
+ Temperature: pvAddrOrNil(v.Temperature),
+ MaxTemperature: v.MaxTemperature,
+ TopP: pvAddrOrNil(v.TopP),
+ TopK: pvAddrOrNil(v.TopK),
}
}
@@ -1026,9 +1298,10 @@ func (ModelInfo) fromProto(p *pb.Model) *ModelInfo {
InputTokenLimit: p.InputTokenLimit,
OutputTokenLimit: p.OutputTokenLimit,
SupportedGenerationMethods: p.SupportedGenerationMethods,
- Temperature: support.DerefOrZero(p.Temperature),
- TopP: support.DerefOrZero(p.TopP),
- TopK: support.DerefOrZero(p.TopK),
+ Temperature: pvDerefOrZero(p.Temperature),
+ MaxTemperature: p.MaxTemperature,
+ TopP: pvDerefOrZero(p.TopP),
+ TopK: pvDerefOrZero(p.TopK),
}
}
@@ -1049,7 +1322,7 @@ func (v *PromptFeedback) toProto() *pb.GenerateContentResponse_PromptFeedback {
}
return &pb.GenerateContentResponse_PromptFeedback{
BlockReason: pb.GenerateContentResponse_PromptFeedback_BlockReason(v.BlockReason),
- SafetyRatings: support.TransformSlice(v.SafetyRatings, (*SafetyRating).toProto),
+ SafetyRatings: pvTransformSlice(v.SafetyRatings, (*SafetyRating).toProto),
}
}
@@ -1059,7 +1332,7 @@ func (PromptFeedback) fromProto(p *pb.GenerateContentResponse_PromptFeedback) *P
}
return &PromptFeedback{
BlockReason: BlockReason(p.BlockReason),
- SafetyRatings: support.TransformSlice(p.SafetyRatings, (SafetyRating{}).fromProto),
+ SafetyRatings: pvTransformSlice(p.SafetyRatings, (SafetyRating{}).fromProto),
}
}
@@ -1173,7 +1446,7 @@ func (v *Schema) toProto() *pb.Schema {
Nullable: v.Nullable,
Enum: v.Enum,
Items: v.Items.toProto(),
- Properties: support.TransformMapValues(v.Properties, (*Schema).toProto),
+ Properties: pvTransformMapValues(v.Properties, (*Schema).toProto),
Required: v.Required,
}
}
@@ -1189,7 +1462,7 @@ func (Schema) fromProto(p *pb.Schema) *Schema {
Nullable: p.Nullable,
Enum: p.Enum,
Items: (Schema{}).fromProto(p.Items),
- Properties: support.TransformMapValues(p.Properties, (Schema{}).fromProto),
+ Properties: pvTransformMapValues(p.Properties, (Schema{}).fromProto),
Required: p.Required,
}
}
@@ -1240,19 +1513,15 @@ func (v TaskType) String() string {
// external systems to perform an action, or set of actions, outside of
// knowledge and scope of the model.
type Tool struct {
- // Optional. A list of `FunctionDeclarations` available to the model that can
- // be used for function calling.
- //
- // The model or system does not execute the function. Instead the defined
- // function may be returned as a [FunctionCall][content.part.function_call]
- // with arguments to the client side for execution. The model may decide to
- // call a subset of these functions by populating
- // [FunctionCall][content.part.function_call] in the response. The next
- // conversation turn may contain a
- // [FunctionResponse][content.part.function_response]
- // with the [content.role] "function" generation context for the next model
- // turn.
+ // Optional. A list of FunctionDeclarations available to the model that
+ // can be used for function calling. The model or system does not execute
+ // the function. Instead the defined function may be returned as a [FunctionCall]
+ // part with arguments to the client side for execution. The next conversation
+ // turn may contain a [FunctionResponse] with the role "function" generation
+ // context for the next model turn.
FunctionDeclarations []*FunctionDeclaration
+ // Optional. Enables the model to execute code as part of generation.
+ CodeExecution *CodeExecution
}
func (v *Tool) toProto() *pb.Tool {
@@ -1260,7 +1529,8 @@ func (v *Tool) toProto() *pb.Tool {
return nil
}
return &pb.Tool{
- FunctionDeclarations: support.TransformSlice(v.FunctionDeclarations, (*FunctionDeclaration).toProto),
+ FunctionDeclarations: pvTransformSlice(v.FunctionDeclarations, (*FunctionDeclaration).toProto),
+ CodeExecution: v.CodeExecution.toProto(),
}
}
@@ -1269,7 +1539,8 @@ func (Tool) fromProto(p *pb.Tool) *Tool {
return nil
}
return &Tool{
- FunctionDeclarations: support.TransformSlice(p.FunctionDeclarations, (FunctionDeclaration{}).fromProto),
+ FunctionDeclarations: pvTransformSlice(p.FunctionDeclarations, (FunctionDeclaration{}).fromProto),
+ CodeExecution: (CodeExecution{}).fromProto(p.CodeExecution),
}
}
@@ -1338,8 +1609,13 @@ func (v Type) String() string {
// UsageMetadata is metadata on the generation request's token usage.
type UsageMetadata struct {
- // Number of tokens in the prompt.
+ // Number of tokens in the prompt. When cached_content is set, this is still
+ // the total effective prompt size. I.e. this includes the number of tokens
+ // in the cached content.
PromptTokenCount int32
+ // Number of tokens in the cached part of the prompt, i.e. in the cached
+ // content.
+ CachedContentTokenCount int32
// Total number of tokens across the generated candidates.
CandidatesTokenCount int32
// Total token count for the generation request (prompt + candidates).
@@ -1351,9 +1627,10 @@ func (v *UsageMetadata) toProto() *pb.GenerateContentResponse_UsageMetadata {
return nil
}
return &pb.GenerateContentResponse_UsageMetadata{
- PromptTokenCount: v.PromptTokenCount,
- CandidatesTokenCount: v.CandidatesTokenCount,
- TotalTokenCount: v.TotalTokenCount,
+ PromptTokenCount: v.PromptTokenCount,
+ CachedContentTokenCount: v.CachedContentTokenCount,
+ CandidatesTokenCount: v.CandidatesTokenCount,
+ TotalTokenCount: v.TotalTokenCount,
}
}
@@ -1362,8 +1639,147 @@ func (UsageMetadata) fromProto(p *pb.GenerateContentResponse_UsageMetadata) *Usa
return nil
}
return &UsageMetadata{
- PromptTokenCount: p.PromptTokenCount,
- CandidatesTokenCount: p.CandidatesTokenCount,
- TotalTokenCount: p.TotalTokenCount,
+ PromptTokenCount: p.PromptTokenCount,
+ CachedContentTokenCount: p.CachedContentTokenCount,
+ CandidatesTokenCount: p.CandidatesTokenCount,
+ TotalTokenCount: p.TotalTokenCount,
}
}
+
+// VideoMetadata is metadata for a video `File`.
+type VideoMetadata struct {
+ // Duration of the video.
+ Duration time.Duration
+}
+
+func (v *VideoMetadata) toProto() *pb.VideoMetadata {
+ if v == nil {
+ return nil
+ }
+ return &pb.VideoMetadata{
+ VideoDuration: durationpb.New(v.Duration),
+ }
+}
+
+func (VideoMetadata) fromProto(p *pb.VideoMetadata) *VideoMetadata {
+ if p == nil {
+ return nil
+ }
+ return &VideoMetadata{
+ Duration: pvDurationFromProto(p.VideoDuration),
+ }
+}
+
+func pvTransformSlice[From, To any](from []From, f func(From) To) []To {
+ if from == nil {
+ return nil
+ }
+ to := make([]To, len(from))
+ for i, e := range from {
+ to[i] = f(e)
+ }
+ return to
+}
+
+func pvTransformMapValues[K comparable, VFrom, VTo any](from map[K]VFrom, f func(VFrom) VTo) map[K]VTo {
+ if from == nil {
+ return nil
+ }
+ to := map[K]VTo{}
+ for k, v := range from {
+ to[k] = f(v)
+ }
+ return to
+}
+
+func pvAddrOrNil[T comparable](x T) *T {
+ var z T
+ if x == z {
+ return nil
+ }
+ return &x
+}
+
+func pvDerefOrZero[T any](x *T) T {
+ if x == nil {
+ var z T
+ return z
+ }
+ return *x
+}
+
+func pvMapToStructPB(m map[string]any) *structpb.Struct {
+ if m == nil {
+ return nil
+ }
+ s, err := structpb.NewStruct(m)
+ if err != nil {
+ panic(pvPanic(fmt.Errorf("pvMapToStructPB: %w", err)))
+ }
+ return s
+}
+
+func pvMapFromStructPB(p *structpb.Struct) map[string]any {
+ if p == nil {
+ return nil
+ }
+ return p.AsMap()
+}
+
+func pvTimeToProto(t time.Time) *timestamppb.Timestamp {
+ if t.IsZero() {
+ return nil
+ }
+ return timestamppb.New(t)
+}
+
+func pvTimeFromProto(ts *timestamppb.Timestamp) time.Time {
+ if ts == nil {
+ return time.Time{}
+ }
+ return ts.AsTime()
+}
+
+func pvAPIErrorToProto(ae *apierror.APIError) *spb.Status {
+ if ae == nil {
+ return nil
+ }
+ return ae.GRPCStatus().Proto()
+}
+
+func pvAPIErrorFromProto(s *spb.Status) *apierror.APIError {
+ err := gstatus.ErrorProto(s)
+ aerr, ok := apierror.ParseError(err, true)
+ if !ok {
+ // Should be impossible.
+ return nil
+ }
+ return aerr
+}
+
+func pvDurationFromProto(d *durationpb.Duration) time.Duration {
+ if d == nil {
+ return 0
+ }
+ return d.AsDuration()
+}
+
+// pvPanic wraps panics from support functions.
+// User-provided functions in the same package can also use it.
+// It allows callers to distinguish conversion function panics from other panics.
+type pvPanic error
+
+// pvCatchPanic recovers from panics of type pvPanic and
+// returns an error instead.
+func pvCatchPanic[T any](f func() T) (_ T, err error) {
+ defer func() {
+ if r := recover(); r != nil {
+ if _, ok := r.(pvPanic); ok {
+ err = r.(error)
+ } else {
+ panic(r)
+ }
+ }
+ }()
+ return f(), nil
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-api.json b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-api.json
index 0ec3a9bb7..e87167895 100644
--- a/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-api.json
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-api.json
@@ -1,914 +1,1844 @@
{
- "description": "The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.",
- "version": "v1beta",
- "version_module": true,
- "ownerName": "Google",
"discoveryVersion": "v1",
- "protocol": "rest",
- "icons": {
- "x16": "http://www.google.com/images/icons/product/search-16.gif",
- "x32": "http://www.google.com/images/icons/product/search-32.gif"
- },
- "kind": "discovery#restDescription",
"name": "generativelanguage",
- "title": "Generative Language API",
- "schemas": {
- "ListTunedModelsResponse": {
- "id": "ListTunedModelsResponse",
- "properties": {
- "nextPageToken": {
- "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.",
- "type": "string"
- },
- "tunedModels": {
- "type": "array",
- "description": "The returned Models.",
- "items": {
- "$ref": "TunedModel"
- }
- }
- },
- "type": "object",
- "description": "Response from `ListTunedModels` containing a paginated list of Models."
+ "fullyEncodeReservedExpansion": true,
+ "parameters": {
+ "callback": {
+ "location": "query",
+ "type": "string",
+ "description": "JSONP"
},
- "GenerateMessageResponse": {
- "type": "object",
- "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.",
- "id": "GenerateMessageResponse",
- "properties": {
- "filters": {
- "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category.",
- "type": "array",
- "items": {
- "$ref": "ContentFilter"
- }
- },
- "messages": {
- "description": "The conversation history used by the model.",
- "items": {
- "$ref": "Message"
- },
- "type": "array"
- },
- "candidates": {
- "description": "Candidate response messages from the model.",
- "type": "array",
- "items": {
- "$ref": "Message"
- }
- }
- }
+ "access_token": {
+ "type": "string",
+ "location": "query",
+ "description": "OAuth access token."
},
- "QueryCorpusResponse": {
- "properties": {
- "relevantChunks": {
- "type": "array",
- "description": "The relevant chunks.",
- "items": {
- "$ref": "RelevantChunk"
- }
- }
- },
- "description": "Response from `QueryCorpus` containing a list of relevant chunks.",
- "id": "QueryCorpusResponse",
- "type": "object"
+ "alt": {
+ "description": "Data format for response.",
+ "enumDescriptions": [
+ "Responses with Content-Type of application/json",
+ "Media download with context-dependent Content-Type",
+ "Responses with Content-Type of application/x-protobuf"
+ ],
+ "default": "json",
+ "type": "string",
+ "enum": [
+ "json",
+ "media",
+ "proto"
+ ],
+ "location": "query"
},
- "CreateChunkRequest": {
- "id": "CreateChunkRequest",
- "description": "Request to create a `Chunk`.",
- "properties": {
- "parent": {
- "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
- "type": "string"
- },
- "chunk": {
- "description": "Required. The `Chunk` to create.",
- "$ref": "Chunk"
- }
- },
- "type": "object"
+ "fields": {
+ "location": "query",
+ "description": "Selector specifying which fields to include in a partial response.",
+ "type": "string"
},
- "CountTokensRequest": {
- "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
- "type": "object",
- "id": "CountTokensRequest",
- "properties": {
- "generateContentRequest": {
- "$ref": "GenerateContentRequest",
- "description": "Optional. The overall input given to the model. CountTokens will count prompt, function calling, etc."
- },
- "contents": {
- "description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set.",
- "items": {
- "$ref": "Content"
- },
- "type": "array"
- }
- }
+ "$.xgafv": {
+ "enumDescriptions": [
+ "v1 error format",
+ "v2 error format"
+ ],
+ "location": "query",
+ "type": "string",
+ "description": "V1 error format.",
+ "enum": [
+ "1",
+ "2"
+ ]
},
- "EmbedContentResponse": {
- "id": "EmbedContentResponse",
- "type": "object",
- "description": "The response to an `EmbedContentRequest`.",
- "properties": {
- "embedding": {
- "$ref": "ContentEmbedding",
- "description": "Output only. The embedding generated from the input content.",
- "readOnly": true
- }
- }
+ "upload_protocol": {
+ "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
+ "location": "query",
+ "type": "string"
},
- "ContentFilter": {
- "id": "ContentFilter",
- "type": "object",
- "description": "Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.",
- "properties": {
- "message": {
- "type": "string",
- "description": "A string that describes the filtering behavior in more detail."
- },
- "reason": {
- "description": "The reason content was blocked during request processing.",
- "type": "string",
- "enum": [
- "BLOCKED_REASON_UNSPECIFIED",
- "SAFETY",
- "OTHER"
- ],
- "enumDescriptions": [
- "A blocked reason was not specified.",
- "Content was blocked by safety settings.",
- "Content was blocked, but the reason is uncategorized."
- ]
- }
- }
+ "oauth_token": {
+ "type": "string",
+ "description": "OAuth 2.0 token for the current user.",
+ "location": "query"
},
- "GroundingPassages": {
- "description": "A repeated list of passages.",
- "properties": {
- "passages": {
- "description": "List of passages.",
- "items": {
- "$ref": "GroundingPassage"
- },
- "type": "array"
- }
- },
- "type": "object",
- "id": "GroundingPassages"
+ "quotaUser": {
+ "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
+ "type": "string",
+ "location": "query"
},
- "TransferOwnershipRequest": {
- "properties": {
- "emailAddress": {
- "type": "string",
- "description": "Required. The email address of the user to whom the tuned model is being transferred to."
- }
- },
- "type": "object",
- "id": "TransferOwnershipRequest",
- "description": "Request to transfer the ownership of the tuned model."
+ "key": {
+ "type": "string",
+ "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
+ "location": "query"
},
- "CitationMetadata": {
- "type": "object",
- "id": "CitationMetadata",
- "properties": {
- "citationSources": {
- "items": {
- "$ref": "CitationSource"
- },
- "type": "array",
- "description": "Citations to sources for a specific response."
- }
- },
- "description": "A collection of source attributions for a piece of content."
+ "prettyPrint": {
+ "location": "query",
+ "type": "boolean",
+ "default": "true",
+ "description": "Returns response with indentations and line breaks."
},
- "Permission": {
- "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete",
- "type": "object",
- "id": "Permission",
- "properties": {
- "granteeType": {
- "enumDescriptions": [
- "The default value. This value is unused.",
- "Represents a user. When set, you must provide email_address for the user.",
- "Represents a group. When set, you must provide email_address for the group.",
- "Represents access to everyone. No extra information is required."
- ],
- "enum": [
- "GRANTEE_TYPE_UNSPECIFIED",
- "USER",
- "GROUP",
- "EVERYONE"
+ "uploadType": {
+ "location": "query",
+ "type": "string",
+ "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
+ }
+ },
+ "resources": {
+ "cachedContents": {
+ "methods": {
+ "get": {
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.cachedContents.get",
+ "parameterOrder": [
+ "name"
],
- "type": "string",
- "description": "Optional. Immutable. The type of the grantee."
+ "description": "Reads CachedContent resource.",
+ "flatPath": "v1beta/cachedContents/{cachedContentsId}",
+ "parameters": {
+ "name": {
+ "location": "path",
+ "type": "string",
+ "required": true,
+ "pattern": "^cachedContents/[^/]+$",
+ "description": "Required. The resource name referring to the content cache entry. Format: `cachedContents/{id}`"
+ }
+ },
+ "httpMethod": "GET",
+ "response": {
+ "$ref": "CachedContent"
+ }
},
- "name": {
- "type": "string",
- "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.",
- "readOnly": true
+ "create": {
+ "parameters": {},
+ "request": {
+ "$ref": "CachedContent"
+ },
+ "id": "generativelanguage.cachedContents.create",
+ "response": {
+ "$ref": "CachedContent"
+ },
+ "flatPath": "v1beta/cachedContents",
+ "parameterOrder": [],
+ "path": "v1beta/cachedContents",
+ "description": "Creates CachedContent resource.",
+ "httpMethod": "POST"
},
- "role": {
- "enum": [
- "ROLE_UNSPECIFIED",
- "OWNER",
- "WRITER",
- "READER"
- ],
- "enumDescriptions": [
- "The default value. This value is unused.",
- "Owner can use, update, share and delete the resource.",
- "Writer can use, update and share the resource.",
- "Reader can use the resource."
+ "patch": {
+ "flatPath": "v1beta/cachedContents/{cachedContentsId}",
+ "request": {
+ "$ref": "CachedContent"
+ },
+ "httpMethod": "PATCH",
+ "parameterOrder": [
+ "name"
],
- "description": "Required. The role granted by this permission.",
- "type": "string"
+ "response": {
+ "$ref": "CachedContent"
+ },
+ "parameters": {
+ "name": {
+ "location": "path",
+ "description": "Optional. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`",
+ "pattern": "^cachedContents/[^/]+$",
+ "type": "string",
+ "required": true
+ },
+ "updateMask": {
+ "description": "The list of fields to update.",
+ "format": "google-fieldmask",
+ "type": "string",
+ "location": "query"
+ }
+ },
+ "path": "v1beta/{+name}",
+ "description": "Updates CachedContent resource (only expiration is updatable).",
+ "id": "generativelanguage.cachedContents.patch"
},
- "emailAddress": {
- "description": "Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.",
- "type": "string"
- }
- }
- },
- "EmbedTextRequest": {
- "id": "EmbedTextRequest",
- "description": "Request to get a text embedding from the model.",
- "type": "object",
- "properties": {
- "text": {
- "description": "Optional. The free-form input text that the model will turn into an embedding.",
- "type": "string"
+ "list": {
+ "description": "Lists CachedContents.",
+ "response": {
+ "$ref": "ListCachedContentsResponse"
+ },
+ "parameterOrder": [],
+ "httpMethod": "GET",
+ "path": "v1beta/cachedContents",
+ "parameters": {
+ "pageSize": {
+ "description": "Optional. The maximum number of cached contents to return. The service may return fewer than this value. If unspecified, some default (under maximum) number of items will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.",
+ "type": "integer",
+ "format": "int32",
+ "location": "query"
+ },
+ "pageToken": {
+ "location": "query",
+ "description": "Optional. A page token, received from a previous `ListCachedContents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListCachedContents` must match the call that provided the page token.",
+ "type": "string"
+ }
+ },
+ "flatPath": "v1beta/cachedContents",
+ "id": "generativelanguage.cachedContents.list"
},
- "model": {
- "description": "Required. The model name to use with the format model=models/{model}.",
- "type": "string"
+ "delete": {
+ "httpMethod": "DELETE",
+ "parameterOrder": [
+ "name"
+ ],
+ "flatPath": "v1beta/cachedContents/{cachedContentsId}",
+ "description": "Deletes CachedContent resource.",
+ "parameters": {
+ "name": {
+ "type": "string",
+ "description": "Required. The resource name referring to the content cache entry Format: `cachedContents/{id}`",
+ "pattern": "^cachedContents/[^/]+$",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.cachedContents.delete",
+ "response": {
+ "$ref": "Empty"
+ }
}
}
},
- "Content": {
- "description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.",
- "properties": {
- "parts": {
- "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.",
- "type": "array",
- "items": {
- "$ref": "Part"
+ "corpora": {
+ "resources": {
+ "documents": {
+ "resources": {
+ "chunks": {
+ "methods": {
+ "patch": {
+ "response": {
+ "$ref": "Chunk"
+ },
+ "id": "generativelanguage.corpora.documents.chunks.patch",
+ "parameters": {
+ "name": {
+ "type": "string",
+ "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$",
+ "location": "path",
+ "required": true,
+ "description": "Immutable. Identifier. The `Chunk` resource name. The ID (name excluding the \"corpora/*/documents/*/chunks/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`"
+ },
+ "updateMask": {
+ "type": "string",
+ "location": "query",
+ "format": "google-fieldmask",
+ "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`."
+ }
+ },
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}",
+ "path": "v1beta/{+name}",
+ "parameterOrder": [
+ "name"
+ ],
+ "description": "Updates a `Chunk`.",
+ "request": {
+ "$ref": "Chunk"
+ },
+ "httpMethod": "PATCH"
+ },
+ "get": {
+ "id": "generativelanguage.corpora.documents.chunks.get",
+ "parameterOrder": [
+ "name"
+ ],
+ "response": {
+ "$ref": "Chunk"
+ },
+ "httpMethod": "GET",
+ "path": "v1beta/{+name}",
+ "description": "Gets information about a specific `Chunk`.",
+ "parameters": {
+ "name": {
+ "description": "Required. The name of the `Chunk` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`",
+ "required": true,
+ "location": "path",
+ "type": "string",
+ "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$"
+ }
+ },
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}"
+ },
+ "create": {
+ "parameterOrder": [
+ "parent"
+ ],
+ "response": {
+ "$ref": "Chunk"
+ },
+ "description": "Creates a `Chunk`.",
+ "request": {
+ "$ref": "Chunk"
+ },
+ "id": "generativelanguage.corpora.documents.chunks.create",
+ "httpMethod": "POST",
+ "parameters": {
+ "parent": {
+ "required": true,
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
+ "type": "string",
+ "location": "path"
+ }
+ },
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks",
+ "path": "v1beta/{+parent}/chunks"
+ },
+ "delete": {
+ "parameterOrder": [
+ "name"
+ ],
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}",
+ "response": {
+ "$ref": "Empty"
+ },
+ "id": "generativelanguage.corpora.documents.chunks.delete",
+ "path": "v1beta/{+name}",
+ "parameters": {
+ "name": {
+ "type": "string",
+ "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`",
+ "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "httpMethod": "DELETE",
+ "description": "Deletes a `Chunk`."
+ },
+ "batchDelete": {
+ "path": "v1beta/{+parent}/chunks:batchDelete",
+ "parameters": {
+ "parent": {
+ "location": "path",
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "description": "Optional. The name of the `Document` containing the `Chunk`s to delete. The parent field in every `DeleteChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
+ "required": true,
+ "type": "string"
+ }
+ },
+ "response": {
+ "$ref": "Empty"
+ },
+ "parameterOrder": [
+ "parent"
+ ],
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchDelete",
+ "id": "generativelanguage.corpora.documents.chunks.batchDelete",
+ "description": "Batch delete `Chunk`s.",
+ "httpMethod": "POST",
+ "request": {
+ "$ref": "BatchDeleteChunksRequest"
+ }
+ },
+ "list": {
+ "description": "Lists all `Chunk`s in a `Document`.",
+ "parameterOrder": [
+ "parent"
+ ],
+ "parameters": {
+ "pageSize": {
+ "type": "integer",
+ "location": "query",
+ "description": "Optional. The maximum number of `Chunk`s to return (per page). The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum size limit is 100 `Chunk`s per page.",
+ "format": "int32"
+ },
+ "pageToken": {
+ "type": "string",
+ "location": "query",
+ "description": "Optional. A page token, received from a previous `ListChunks` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListChunks` must match the call that provided the page token."
+ },
+ "parent": {
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "required": true,
+ "type": "string",
+ "description": "Required. The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
+ "location": "path"
+ }
+ },
+ "httpMethod": "GET",
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks",
+ "response": {
+ "$ref": "ListChunksResponse"
+ },
+ "path": "v1beta/{+parent}/chunks",
+ "id": "generativelanguage.corpora.documents.chunks.list"
+ },
+ "batchCreate": {
+ "id": "generativelanguage.corpora.documents.chunks.batchCreate",
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchCreate",
+ "path": "v1beta/{+parent}/chunks:batchCreate",
+ "parameters": {
+ "parent": {
+ "required": true,
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "location": "path",
+ "type": "string",
+ "description": "Optional. The name of the `Document` where this batch of `Chunk`s will be created. The parent field in every `CreateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`"
+ }
+ },
+ "description": "Batch create `Chunk`s.",
+ "httpMethod": "POST",
+ "parameterOrder": [
+ "parent"
+ ],
+ "response": {
+ "$ref": "BatchCreateChunksResponse"
+ },
+ "request": {
+ "$ref": "BatchCreateChunksRequest"
+ }
+ },
+ "batchUpdate": {
+ "description": "Batch update `Chunk`s.",
+ "request": {
+ "$ref": "BatchUpdateChunksRequest"
+ },
+ "path": "v1beta/{+parent}/chunks:batchUpdate",
+ "parameterOrder": [
+ "parent"
+ ],
+ "httpMethod": "POST",
+ "id": "generativelanguage.corpora.documents.chunks.batchUpdate",
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchUpdate",
+ "response": {
+ "$ref": "BatchUpdateChunksResponse"
+ },
+ "parameters": {
+ "parent": {
+ "required": true,
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "description": "Optional. The name of the `Document` containing the `Chunk`s to update. The parent field in every `UpdateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
+ "type": "string",
+ "location": "path"
+ }
+ }
+ }
+ }
+ }
+ },
+ "methods": {
+ "get": {
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}",
+ "id": "generativelanguage.corpora.documents.get",
+ "parameters": {
+ "name": {
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "required": true,
+ "location": "path",
+ "description": "Required. The name of the `Document` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
+ "type": "string"
+ }
+ },
+ "httpMethod": "GET",
+ "parameterOrder": [
+ "name"
+ ],
+ "response": {
+ "$ref": "Document"
+ },
+ "path": "v1beta/{+name}",
+ "description": "Gets information about a specific `Document`."
+ },
+ "delete": {
+ "description": "Deletes a `Document`.",
+ "id": "generativelanguage.corpora.documents.delete",
+ "response": {
+ "$ref": "Empty"
+ },
+ "parameterOrder": [
+ "name"
+ ],
+ "path": "v1beta/{+name}",
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}",
+ "parameters": {
+ "force": {
+ "type": "boolean",
+ "description": "Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.",
+ "location": "query"
+ },
+ "name": {
+ "required": true,
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "type": "string",
+ "location": "path",
+ "description": "Required. The resource name of the `Document` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc`"
+ }
+ },
+ "httpMethod": "DELETE"
+ },
+ "patch": {
+ "parameters": {
+ "updateMask": {
+ "format": "google-fieldmask",
+ "type": "string",
+ "location": "query",
+ "description": "Required. The list of fields to update. Currently, this only supports updating `display_name` and `custom_metadata`."
+ },
+ "name": {
+ "type": "string",
+ "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"corpora/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`",
+ "required": true,
+ "location": "path",
+ "pattern": "^corpora/[^/]+/documents/[^/]+$"
+ }
+ },
+ "parameterOrder": [
+ "name"
+ ],
+ "description": "Updates a `Document`.",
+ "request": {
+ "$ref": "Document"
+ },
+ "response": {
+ "$ref": "Document"
+ },
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.corpora.documents.patch",
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}",
+ "httpMethod": "PATCH"
+ },
+ "query": {
+ "path": "v1beta/{+name}:query",
+ "id": "generativelanguage.corpora.documents.query",
+ "description": "Performs semantic search over a `Document`.",
+ "parameters": {
+ "name": {
+ "description": "Required. The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
+ "location": "path",
+ "type": "string",
+ "pattern": "^corpora/[^/]+/documents/[^/]+$",
+ "required": true
+ }
+ },
+ "request": {
+ "$ref": "QueryDocumentRequest"
+ },
+ "httpMethod": "POST",
+ "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}:query",
+ "parameterOrder": [
+ "name"
+ ],
+ "response": {
+ "$ref": "QueryDocumentResponse"
+ }
+ },
+ "list": {
+ "parameters": {
+ "pageToken": {
+ "type": "string",
+ "location": "query",
+ "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token."
+ },
+ "pageSize": {
+ "type": "integer",
+ "description": "Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.",
+ "location": "query",
+ "format": "int32"
+ },
+ "parent": {
+ "required": true,
+ "pattern": "^corpora/[^/]+$",
+ "description": "Required. The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`",
+ "location": "path",
+ "type": "string"
+ }
+ },
+ "description": "Lists all `Document`s in a `Corpus`.",
+ "response": {
+ "$ref": "ListDocumentsResponse"
+ },
+ "parameterOrder": [
+ "parent"
+ ],
+ "flatPath": "v1beta/corpora/{corporaId}/documents",
+ "httpMethod": "GET",
+ "id": "generativelanguage.corpora.documents.list",
+ "path": "v1beta/{+parent}/documents"
+ },
+ "create": {
+ "httpMethod": "POST",
+ "flatPath": "v1beta/corpora/{corporaId}/documents",
+ "request": {
+ "$ref": "Document"
+ },
+ "path": "v1beta/{+parent}/documents",
+ "parameters": {
+ "parent": {
+ "pattern": "^corpora/[^/]+$",
+ "required": true,
+ "type": "string",
+ "location": "path",
+ "description": "Required. The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`"
+ }
+ },
+ "description": "Creates an empty `Document`.",
+ "id": "generativelanguage.corpora.documents.create",
+ "response": {
+ "$ref": "Document"
+ },
+ "parameterOrder": [
+ "parent"
+ ]
+ }
}
},
- "role": {
- "type": "string",
- "description": "Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset."
- }
- },
- "id": "Content",
- "type": "object"
- },
- "VideoMetadata": {
- "id": "VideoMetadata",
- "type": "object",
- "properties": {
- "videoDuration": {
- "description": "Duration of the video.",
- "format": "google-duration",
- "type": "string"
- }
- },
- "description": "Metadata for a video `File`."
- },
- "FunctionDeclaration": {
- "id": "FunctionDeclaration",
- "properties": {
- "name": {
- "type": "string",
- "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63."
- },
- "parameters": {
- "$ref": "Schema",
- "description": "Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter."
- },
- "description": {
- "description": "Required. A brief description of the function.",
- "type": "string"
+ "permissions": {
+ "methods": {
+ "create": {
+ "parameterOrder": [
+ "parent"
+ ],
+ "path": "v1beta/{+parent}/permissions",
+ "flatPath": "v1beta/corpora/{corporaId}/permissions",
+ "response": {
+ "$ref": "Permission"
+ },
+ "description": "Create a permission to a specific resource.",
+ "parameters": {
+ "parent": {
+ "required": true,
+ "pattern": "^corpora/[^/]+$",
+ "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
+ "location": "path",
+ "type": "string"
+ }
+ },
+ "httpMethod": "POST",
+ "id": "generativelanguage.corpora.permissions.create",
+ "request": {
+ "$ref": "Permission"
+ }
+ },
+ "get": {
+ "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}",
+ "parameters": {
+ "name": {
+ "location": "path",
+ "required": true,
+ "pattern": "^corpora/[^/]+/permissions/[^/]+$",
+ "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
+ "type": "string"
+ }
+ },
+ "response": {
+ "$ref": "Permission"
+ },
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.corpora.permissions.get",
+ "httpMethod": "GET",
+ "description": "Gets information about a specific Permission.",
+ "parameterOrder": [
+ "name"
+ ]
+ },
+ "patch": {
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.corpora.permissions.patch",
+ "httpMethod": "PATCH",
+ "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}",
+ "parameters": {
+ "name": {
+ "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.",
+ "type": "string",
+ "required": true,
+ "location": "path",
+ "pattern": "^corpora/[^/]+/permissions/[^/]+$"
+ },
+ "updateMask": {
+ "format": "google-fieldmask",
+ "type": "string",
+ "location": "query",
+ "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)"
+ }
+ },
+ "request": {
+ "$ref": "Permission"
+ },
+ "response": {
+ "$ref": "Permission"
+ },
+ "parameterOrder": [
+ "name"
+ ],
+ "description": "Updates the permission."
+ },
+ "list": {
+ "parameters": {
+ "parent": {
+ "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
+ "required": true,
+ "location": "path",
+ "type": "string",
+ "pattern": "^corpora/[^/]+$"
+ },
+ "pageToken": {
+ "type": "string",
+ "location": "query",
+ "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token."
+ },
+ "pageSize": {
+ "location": "query",
+ "type": "integer",
+ "format": "int32",
+ "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size."
+ }
+ },
+ "httpMethod": "GET",
+ "parameterOrder": [
+ "parent"
+ ],
+ "response": {
+ "$ref": "ListPermissionsResponse"
+ },
+ "path": "v1beta/{+parent}/permissions",
+ "description": "Lists permissions for the specific resource.",
+ "flatPath": "v1beta/corpora/{corporaId}/permissions",
+ "id": "generativelanguage.corpora.permissions.list"
+ },
+ "delete": {
+ "response": {
+ "$ref": "Empty"
+ },
+ "httpMethod": "DELETE",
+ "path": "v1beta/{+name}",
+ "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}",
+ "description": "Deletes the permission.",
+ "id": "generativelanguage.corpora.permissions.delete",
+ "parameterOrder": [
+ "name"
+ ],
+ "parameters": {
+ "name": {
+ "required": true,
+ "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
+ "pattern": "^corpora/[^/]+/permissions/[^/]+$",
+ "type": "string",
+ "location": "path"
+ }
+ }
+ }
+ }
}
},
- "description": "Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.",
- "type": "object"
- },
- "QueryCorpusRequest": {
- "id": "QueryCorpusRequest",
- "properties": {
- "query": {
- "description": "Required. Query string to perform semantic search.",
- "type": "string"
+ "methods": {
+ "create": {
+ "response": {
+ "$ref": "Corpus"
+ },
+ "httpMethod": "POST",
+ "parameters": {},
+ "path": "v1beta/corpora",
+ "description": "Creates an empty `Corpus`.",
+ "request": {
+ "$ref": "Corpus"
+ },
+ "flatPath": "v1beta/corpora",
+ "id": "generativelanguage.corpora.create",
+ "parameterOrder": []
},
- "metadataFilters": {
- "description": "Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical \"AND\"s. Example query at document level: (year \u003e= 2020 OR year \u003c 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]}] Example query at chunk level for a numeric range of values: (year \u003e 2015 AND year \u003c= 2020) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2015, operation = GREATER}]}, {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: \"AND\"s for the same key are only supported for numeric values. String values only support \"OR\"s for the same key.",
- "type": "array",
- "items": {
- "$ref": "MetadataFilter"
+ "list": {
+ "flatPath": "v1beta/corpora",
+ "id": "generativelanguage.corpora.list",
+ "httpMethod": "GET",
+ "parameterOrder": [],
+ "response": {
+ "$ref": "ListCorporaResponse"
+ },
+ "description": "Lists all `Corpora` owned by the user.",
+ "path": "v1beta/corpora",
+ "parameters": {
+ "pageToken": {
+ "description": "Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.",
+ "location": "query",
+ "type": "string"
+ },
+ "pageSize": {
+ "format": "int32",
+ "type": "integer",
+ "location": "query",
+ "description": "Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page."
+ }
}
},
- "resultsCount": {
- "format": "int32",
- "description": "Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.",
- "type": "integer"
- }
- },
- "description": "Request for querying a `Corpus`.",
- "type": "object"
- },
- "GenerateContentResponse": {
- "description": "Response from the model supporting multiple candidates. Note on safety ratings and content filtering. They are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API contract is that: - either all requested candidates are returned or no candidates at all - no candidates are returned only if there was something wrong with the prompt (see `prompt_feedback`) - feedback on each candidate is reported on `finish_reason` and `safety_ratings`.",
- "properties": {
- "candidates": {
- "items": {
- "$ref": "Candidate"
+ "get": {
+ "parameters": {
+ "name": {
+ "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`",
+ "required": true,
+ "type": "string",
+ "pattern": "^corpora/[^/]+$",
+ "location": "path"
+ }
},
- "type": "array",
- "description": "Candidate responses from the model."
+ "response": {
+ "$ref": "Corpus"
+ },
+ "httpMethod": "GET",
+ "id": "generativelanguage.corpora.get",
+ "path": "v1beta/{+name}",
+ "parameterOrder": [
+ "name"
+ ],
+ "flatPath": "v1beta/corpora/{corporaId}",
+ "description": "Gets information about a specific `Corpus`."
},
- "usageMetadata": {
- "description": "Output only. Metadata on the generation requests' token usage.",
- "readOnly": true,
- "$ref": "UsageMetadata"
+ "query": {
+ "parameters": {
+ "name": {
+ "required": true,
+ "pattern": "^corpora/[^/]+$",
+ "type": "string",
+ "description": "Required. The name of the `Corpus` to query. Example: `corpora/my-corpus-123`",
+ "location": "path"
+ }
+ },
+ "description": "Performs semantic search over a `Corpus`.",
+ "httpMethod": "POST",
+ "path": "v1beta/{+name}:query",
+ "flatPath": "v1beta/corpora/{corporaId}:query",
+ "id": "generativelanguage.corpora.query",
+ "parameterOrder": [
+ "name"
+ ],
+ "request": {
+ "$ref": "QueryCorpusRequest"
+ },
+ "response": {
+ "$ref": "QueryCorpusResponse"
+ }
},
- "promptFeedback": {
- "$ref": "PromptFeedback",
- "description": "Returns the prompt's feedback related to the content filters."
- }
- },
- "id": "GenerateContentResponse",
- "type": "object"
- },
- "TuningExample": {
- "properties": {
- "output": {
- "description": "Required. The expected model output.",
- "type": "string"
+ "delete": {
+ "parameters": {
+ "force": {
+ "location": "query",
+ "type": "boolean",
+ "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s."
+ },
+ "name": {
+ "pattern": "^corpora/[^/]+$",
+ "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`",
+ "type": "string",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "id": "generativelanguage.corpora.delete",
+ "flatPath": "v1beta/corpora/{corporaId}",
+ "response": {
+ "$ref": "Empty"
+ },
+ "parameterOrder": [
+ "name"
+ ],
+ "description": "Deletes a `Corpus`.",
+ "path": "v1beta/{+name}",
+ "httpMethod": "DELETE"
},
- "textInput": {
- "description": "Optional. Text model input.",
- "type": "string"
- }
- },
- "id": "TuningExample",
- "description": "A single example for tuning.",
- "type": "object"
- },
- "Embedding": {
- "properties": {
- "value": {
- "items": {
- "format": "float",
- "type": "number"
+ "patch": {
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.corpora.patch",
+ "parameters": {
+ "name": {
+ "description": "Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`",
+ "location": "path",
+ "pattern": "^corpora/[^/]+$",
+ "required": true,
+ "type": "string"
+ },
+ "updateMask": {
+ "description": "Required. The list of fields to update. Currently, this only supports updating `display_name`.",
+ "format": "google-fieldmask",
+ "location": "query",
+ "type": "string"
+ }
},
- "description": "The embedding values.",
- "type": "array"
+ "parameterOrder": [
+ "name"
+ ],
+ "httpMethod": "PATCH",
+ "flatPath": "v1beta/corpora/{corporaId}",
+ "request": {
+ "$ref": "Corpus"
+ },
+ "response": {
+ "$ref": "Corpus"
+ },
+ "description": "Updates a `Corpus`."
}
- },
- "id": "Embedding",
- "description": "A list of floats representing the embedding.",
- "type": "object"
+ }
},
- "BatchEmbedTextResponse": {
- "description": "The response to a EmbedTextRequest.",
- "type": "object",
- "id": "BatchEmbedTextResponse",
- "properties": {
- "embeddings": {
- "description": "Output only. The embeddings generated from the input text.",
- "items": {
- "$ref": "Embedding"
+ "media": {
+ "methods": {
+ "upload": {
+ "path": "v1beta/files",
+ "supportsMediaUpload": true,
+ "description": "Creates a `File`.",
+ "httpMethod": "POST",
+ "id": "generativelanguage.media.upload",
+ "mediaUpload": {
+ "protocols": {
+ "resumable": {
+ "multipart": true,
+ "path": "/resumable/upload/v1beta/files"
+ },
+ "simple": {
+ "path": "/upload/v1beta/files",
+ "multipart": true
+ }
+ },
+ "maxSize": "2147483648",
+ "accept": [
+ "*/*"
+ ]
},
- "readOnly": true,
- "type": "array"
+ "parameterOrder": [],
+ "response": {
+ "$ref": "CreateFileResponse"
+ },
+ "parameters": {},
+ "request": {
+ "$ref": "CreateFileRequest"
+ },
+ "flatPath": "v1beta/files"
}
}
},
- "BatchEmbedContentsRequest": {
- "id": "BatchEmbedContentsRequest",
- "properties": {
- "requests": {
- "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.",
- "type": "array",
- "items": {
+ "models": {
+ "methods": {
+ "embedContent": {
+ "request": {
"$ref": "EmbedContentRequest"
- }
- }
- },
- "type": "object",
- "description": "Batch request to get embeddings from the model for a list of prompts."
- },
- "Part": {
- "properties": {
- "inlineData": {
- "$ref": "Blob",
- "description": "Inline media bytes."
+ },
+ "description": "Generates an embedding from the model given an input `Content`.",
+ "parameterOrder": [
+ "model"
+ ],
+ "flatPath": "v1beta/models/{modelsId}:embedContent",
+ "id": "generativelanguage.models.embedContent",
+ "path": "v1beta/{+model}:embedContent",
+ "parameters": {
+ "model": {
+ "required": true,
+ "location": "path",
+ "type": "string",
+ "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
+ "pattern": "^models/[^/]+$"
+ }
+ },
+ "response": {
+ "$ref": "EmbedContentResponse"
+ },
+ "httpMethod": "POST"
},
- "functionCall": {
- "$ref": "FunctionCall",
- "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values."
+ "countMessageTokens": {
+ "parameterOrder": [
+ "model"
+ ],
+ "description": "Runs a model's tokenizer on a string and returns the token count.",
+ "request": {
+ "$ref": "CountMessageTokensRequest"
+ },
+ "response": {
+ "$ref": "CountMessageTokensResponse"
+ },
+ "flatPath": "v1beta/models/{modelsId}:countMessageTokens",
+ "httpMethod": "POST",
+ "id": "generativelanguage.models.countMessageTokens",
+ "parameters": {
+ "model": {
+ "location": "path",
+ "type": "string",
+ "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
+ "pattern": "^models/[^/]+$",
+ "required": true
+ }
+ },
+ "path": "v1beta/{+model}:countMessageTokens"
},
- "fileData": {
- "description": "URI based data.",
- "$ref": "FileData"
+ "batchEmbedContents": {
+ "path": "v1beta/{+model}:batchEmbedContents",
+ "httpMethod": "POST",
+ "response": {
+ "$ref": "BatchEmbedContentsResponse"
+ },
+ "parameters": {
+ "model": {
+ "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
+ "pattern": "^models/[^/]+$",
+ "required": true,
+ "type": "string",
+ "location": "path"
+ }
+ },
+ "request": {
+ "$ref": "BatchEmbedContentsRequest"
+ },
+ "flatPath": "v1beta/models/{modelsId}:batchEmbedContents",
+ "id": "generativelanguage.models.batchEmbedContents",
+ "description": "Generates multiple embeddings from the model given input text in a synchronous call.",
+ "parameterOrder": [
+ "model"
+ ]
},
- "functionResponse": {
- "$ref": "FunctionResponse",
- "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model."
+ "streamGenerateContent": {
+ "parameters": {
+ "model": {
+ "pattern": "^models/[^/]+$",
+ "required": true,
+ "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.",
+ "location": "path",
+ "type": "string"
+ }
+ },
+ "path": "v1beta/{+model}:streamGenerateContent",
+ "httpMethod": "POST",
+ "parameterOrder": [
+ "model"
+ ],
+ "description": "Generates a streamed response from the model given an input `GenerateContentRequest`.",
+ "request": {
+ "$ref": "GenerateContentRequest"
+ },
+ "flatPath": "v1beta/models/{modelsId}:streamGenerateContent",
+ "id": "generativelanguage.models.streamGenerateContent",
+ "response": {
+ "$ref": "GenerateContentResponse"
+ }
},
- "text": {
- "description": "Inline text.",
- "type": "string"
- }
- },
- "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.",
- "id": "Part",
- "type": "object"
- },
- "Blob": {
- "type": "object",
- "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.",
- "properties": {
- "data": {
- "format": "byte",
- "description": "Raw bytes for media formats.",
- "type": "string"
+ "generateMessage": {
+ "description": "Generates a response from the model given an input `MessagePrompt`.",
+ "response": {
+ "$ref": "GenerateMessageResponse"
+ },
+ "parameterOrder": [
+ "model"
+ ],
+ "id": "generativelanguage.models.generateMessage",
+ "path": "v1beta/{+model}:generateMessage",
+ "flatPath": "v1beta/models/{modelsId}:generateMessage",
+ "parameters": {
+ "model": {
+ "description": "Required. The name of the model to use. Format: `name=models/{model}`.",
+ "type": "string",
+ "required": true,
+ "pattern": "^models/[^/]+$",
+ "location": "path"
+ }
+ },
+ "httpMethod": "POST",
+ "request": {
+ "$ref": "GenerateMessageRequest"
+ }
},
- "mimeType": {
- "description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).",
- "type": "string"
- }
- },
- "id": "Blob"
- },
- "Candidate": {
- "type": "object",
- "properties": {
- "tokenCount": {
- "description": "Output only. Token count for this candidate.",
- "format": "int32",
- "type": "integer",
- "readOnly": true
+ "generateContent": {
+ "httpMethod": "POST",
+ "path": "v1beta/{+model}:generateContent",
+ "flatPath": "v1beta/models/{modelsId}:generateContent",
+ "id": "generativelanguage.models.generateContent",
+ "parameters": {
+ "model": {
+ "type": "string",
+ "pattern": "^models/[^/]+$",
+ "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "description": "Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.",
+ "parameterOrder": [
+ "model"
+ ],
+ "response": {
+ "$ref": "GenerateContentResponse"
+ },
+ "request": {
+ "$ref": "GenerateContentRequest"
+ }
},
- "groundingAttributions": {
- "items": {
- "$ref": "GroundingAttribution"
+ "batchEmbedText": {
+ "request": {
+ "$ref": "BatchEmbedTextRequest"
},
- "type": "array",
- "readOnly": true,
- "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls."
+ "id": "generativelanguage.models.batchEmbedText",
+ "parameters": {
+ "model": {
+ "location": "path",
+ "required": true,
+ "type": "string",
+ "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001",
+ "pattern": "^models/[^/]+$"
+ }
+ },
+ "parameterOrder": [
+ "model"
+ ],
+ "path": "v1beta/{+model}:batchEmbedText",
+ "description": "Generates multiple embeddings from the model given input text in a synchronous call.",
+ "httpMethod": "POST",
+ "flatPath": "v1beta/models/{modelsId}:batchEmbedText",
+ "response": {
+ "$ref": "BatchEmbedTextResponse"
+ }
},
- "content": {
- "description": "Output only. Generated content returned from the model.",
- "$ref": "Content",
- "readOnly": true
+ "countTextTokens": {
+ "parameters": {
+ "model": {
+ "location": "path",
+ "required": true,
+ "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
+ "type": "string",
+ "pattern": "^models/[^/]+$"
+ }
+ },
+ "description": "Runs a model's tokenizer on a text and returns the token count.",
+ "path": "v1beta/{+model}:countTextTokens",
+ "httpMethod": "POST",
+ "id": "generativelanguage.models.countTextTokens",
+ "response": {
+ "$ref": "CountTextTokensResponse"
+ },
+ "parameterOrder": [
+ "model"
+ ],
+ "flatPath": "v1beta/models/{modelsId}:countTextTokens",
+ "request": {
+ "$ref": "CountTextTokensRequest"
+ }
},
- "index": {
- "type": "integer",
- "format": "int32",
- "readOnly": true,
- "description": "Output only. Index of the candidate in the list of candidates."
+ "get": {
+ "description": "Gets information about a specific Model.",
+ "parameters": {
+ "name": {
+ "pattern": "^models/[^/]+$",
+ "required": true,
+ "location": "path",
+ "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
+ "type": "string"
+ }
+ },
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.models.get",
+ "parameterOrder": [
+ "name"
+ ],
+ "httpMethod": "GET",
+ "flatPath": "v1beta/models/{modelsId}",
+ "response": {
+ "$ref": "Model"
+ }
},
- "safetyRatings": {
- "items": {
- "$ref": "SafetyRating"
+ "embedText": {
+ "parameterOrder": [
+ "model"
+ ],
+ "id": "generativelanguage.models.embedText",
+ "description": "Generates an embedding from the model given an input message.",
+ "flatPath": "v1beta/models/{modelsId}:embedText",
+ "parameters": {
+ "model": {
+ "pattern": "^models/[^/]+$",
+ "required": true,
+ "location": "path",
+ "description": "Required. The model name to use with the format model=models/{model}.",
+ "type": "string"
+ }
},
- "type": "array",
- "description": "List of ratings for the safety of a response candidate. There is at most one rating per category."
+ "request": {
+ "$ref": "EmbedTextRequest"
+ },
+ "path": "v1beta/{+model}:embedText",
+ "httpMethod": "POST",
+ "response": {
+ "$ref": "EmbedTextResponse"
+ }
},
- "citationMetadata": {
- "description": "Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are \"recited\" from copyrighted material in the foundational LLM's training data.",
- "readOnly": true,
- "$ref": "CitationMetadata"
+ "generateAnswer": {
+ "id": "generativelanguage.models.generateAnswer",
+ "request": {
+ "$ref": "GenerateAnswerRequest"
+ },
+ "flatPath": "v1beta/models/{modelsId}:generateAnswer",
+ "response": {
+ "$ref": "GenerateAnswerResponse"
+ },
+ "httpMethod": "POST",
+ "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.",
+ "path": "v1beta/{+model}:generateAnswer",
+ "parameters": {
+ "model": {
+ "location": "path",
+ "type": "string",
+ "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.",
+ "required": true,
+ "pattern": "^models/[^/]+$"
+ }
+ },
+ "parameterOrder": [
+ "model"
+ ]
},
- "finishReason": {
- "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.",
- "readOnly": true,
- "enumDescriptions": [
- "Default value. This value is unused.",
- "Natural stop point of the model or provided stop sequence.",
- "The maximum number of tokens as specified in the request was reached.",
- "The candidate content was flagged for safety reasons.",
- "The candidate content was flagged for recitation reasons.",
- "Unknown reason."
- ],
- "enum": [
- "FINISH_REASON_UNSPECIFIED",
- "STOP",
- "MAX_TOKENS",
- "SAFETY",
- "RECITATION",
- "OTHER"
+ "list": {
+ "description": "Lists models available through the API.",
+ "flatPath": "v1beta/models",
+ "parameterOrder": [],
+ "httpMethod": "GET",
+ "path": "v1beta/models",
+ "response": {
+ "$ref": "ListModelsResponse"
+ },
+ "parameters": {
+ "pageToken": {
+ "type": "string",
+ "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.",
+ "location": "query"
+ },
+ "pageSize": {
+ "description": "The maximum number of `Models` to return (per page). The service may return fewer models. If unspecified, at most 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.",
+ "location": "query",
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "id": "generativelanguage.models.list"
+ },
+ "generateText": {
+ "parameterOrder": [
+ "model"
],
- "type": "string"
- }
- },
- "id": "Candidate",
- "description": "A response candidate generated from the model."
- },
- "QueryDocumentResponse": {
- "type": "object",
- "description": "Response from `QueryDocument` containing a list of relevant chunks.",
- "id": "QueryDocumentResponse",
- "properties": {
- "relevantChunks": {
- "description": "The returned relevant chunks.",
- "type": "array",
- "items": {
- "$ref": "RelevantChunk"
+ "response": {
+ "$ref": "GenerateTextResponse"
+ },
+ "httpMethod": "POST",
+ "request": {
+ "$ref": "GenerateTextRequest"
+ },
+ "flatPath": "v1beta/models/{modelsId}:generateText",
+ "path": "v1beta/{+model}:generateText",
+ "description": "Generates a response from the model given an input message.",
+ "id": "generativelanguage.models.generateText",
+ "parameters": {
+ "model": {
+ "type": "string",
+ "location": "path",
+ "pattern": "^models/[^/]+$",
+ "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m",
+ "required": true
+ }
}
+ },
+ "countTokens": {
+ "path": "v1beta/{+model}:countTokens",
+ "httpMethod": "POST",
+ "flatPath": "v1beta/models/{modelsId}:countTokens",
+ "parameterOrder": [
+ "model"
+ ],
+ "request": {
+ "$ref": "CountTokensRequest"
+ },
+ "response": {
+ "$ref": "CountTokensResponse"
+ },
+ "id": "generativelanguage.models.countTokens",
+ "parameters": {
+ "model": {
+ "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
+ "required": true,
+ "location": "path",
+ "pattern": "^models/[^/]+$",
+ "type": "string"
+ }
+ },
+ "description": "Runs a model's tokenizer on input content and returns the token count."
}
}
},
- "Operation": {
- "type": "object",
- "properties": {
- "done": {
- "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.",
- "type": "boolean"
+ "tunedModels": {
+ "methods": {
+ "list": {
+ "id": "generativelanguage.tunedModels.list",
+ "httpMethod": "GET",
+ "response": {
+ "$ref": "ListTunedModelsResponse"
+ },
+ "parameters": {
+ "pageSize": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.",
+ "location": "query"
+ },
+ "pageToken": {
+ "location": "query",
+ "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.",
+ "type": "string"
+ },
+ "filter": {
+ "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone",
+ "type": "string",
+ "location": "query"
+ }
+ },
+ "parameterOrder": [],
+ "description": "Lists tuned models owned by the user.",
+ "flatPath": "v1beta/tunedModels",
+ "path": "v1beta/tunedModels"
},
- "error": {
- "description": "The error result of the operation in case of failure or cancellation.",
- "$ref": "Status"
+ "transferOwnership": {
+ "httpMethod": "POST",
+ "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.",
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership",
+ "path": "v1beta/{+name}:transferOwnership",
+ "parameters": {
+ "name": {
+ "required": true,
+ "type": "string",
+ "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`",
+ "location": "path",
+ "pattern": "^tunedModels/[^/]+$"
+ }
+ },
+ "request": {
+ "$ref": "TransferOwnershipRequest"
+ },
+ "parameterOrder": [
+ "name"
+ ],
+ "id": "generativelanguage.tunedModels.transferOwnership",
+ "response": {
+ "$ref": "TransferOwnershipResponse"
+ }
},
- "name": {
- "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
- "type": "string"
+ "delete": {
+ "httpMethod": "DELETE",
+ "parameterOrder": [
+ "name"
+ ],
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.tunedModels.delete",
+ "parameters": {
+ "name": {
+ "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`",
+ "required": true,
+ "location": "path",
+ "pattern": "^tunedModels/[^/]+$",
+ "type": "string"
+ }
+ },
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}",
+ "response": {
+ "$ref": "Empty"
+ },
+ "description": "Deletes a tuned model."
},
- "response": {
- "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.",
- "type": "object",
- "additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
+ "patch": {
+ "description": "Updates a tuned model.",
+ "parameters": {
+ "updateMask": {
+ "type": "string",
+ "description": "Required. The list of fields to update.",
+ "format": "google-fieldmask",
+ "location": "query"
+ },
+ "name": {
+ "pattern": "^tunedModels/[^/]+$",
+ "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: display_name = \"Sentence Translator\" name = \"tunedModels/sentence-translator-u3b7m\"",
+ "location": "path",
+ "type": "string",
+ "required": true
+ }
+ },
+ "httpMethod": "PATCH",
+ "path": "v1beta/{+name}",
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}",
+ "request": {
+ "$ref": "TunedModel"
+ },
+ "response": {
+ "$ref": "TunedModel"
+ },
+ "id": "generativelanguage.tunedModels.patch",
+ "parameterOrder": [
+ "name"
+ ]
+ },
+ "generateContent": {
+ "response": {
+ "$ref": "GenerateContentResponse"
+ },
+ "description": "Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.",
+ "parameterOrder": [
+ "model"
+ ],
+ "path": "v1beta/{+model}:generateContent",
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent",
+ "id": "generativelanguage.tunedModels.generateContent",
+ "httpMethod": "POST",
+ "request": {
+ "$ref": "GenerateContentRequest"
+ },
+ "parameters": {
+ "model": {
+ "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.",
+ "location": "path",
+ "type": "string",
+ "required": true,
+ "pattern": "^tunedModels/[^/]+$"
+ }
}
},
- "metadata": {
- "additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
+ "get": {
+ "response": {
+ "$ref": "TunedModel"
},
- "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
- "type": "object"
- }
- },
- "id": "Operation",
- "description": "This resource represents a long-running operation that is the result of a network API call."
- },
- "GenerateAnswerResponse": {
- "type": "object",
- "properties": {
- "answerableProbability": {
- "type": "number",
- "readOnly": true,
- "format": "float",
- "description": "Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low answerable_probability indicates that the answer might not be grounded in the sources. When `answerable_probability` is low, some clients may wish to: * Display a message to the effect of \"We couldn’t answer that question\" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual clients’ use cases. 0.5 is a good starting threshold."
+ "httpMethod": "GET",
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}",
+ "path": "v1beta/{+name}",
+ "parameters": {
+ "name": {
+ "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`",
+ "type": "string",
+ "required": true,
+ "location": "path",
+ "pattern": "^tunedModels/[^/]+$"
+ }
+ },
+ "id": "generativelanguage.tunedModels.get",
+ "parameterOrder": [
+ "name"
+ ],
+ "description": "Gets information about a specific TunedModel."
},
- "answer": {
- "description": "Candidate answer from the model. Note: The model *always* attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low `answerable_probability`.",
- "$ref": "Candidate"
+ "generateText": {
+ "id": "generativelanguage.tunedModels.generateText",
+ "parameterOrder": [
+ "model"
+ ],
+ "httpMethod": "POST",
+ "description": "Generates a response from the model given an input message.",
+ "path": "v1beta/{+model}:generateText",
+ "response": {
+ "$ref": "GenerateTextResponse"
+ },
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText",
+ "parameters": {
+ "model": {
+ "type": "string",
+ "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m",
+ "location": "path",
+ "pattern": "^tunedModels/[^/]+$",
+ "required": true
+ }
+ },
+ "request": {
+ "$ref": "GenerateTextRequest"
+ }
},
- "inputFeedback": {
- "$ref": "InputFeedback",
- "readOnly": true,
- "description": "Output only. Feedback related to the input data used to answer the question, as opposed to model-generated response to the question. \"Input data\" can be one or more of the following: - Question specified by the last entry in `GenerateAnswerRequest.content` - Conversation history specified by the other entries in `GenerateAnswerRequest.content` - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or `GenerateAnswerRequest.inline_passages`)"
+ "create": {
+ "httpMethod": "POST",
+ "path": "v1beta/tunedModels",
+ "description": "Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222",
+ "parameterOrder": [],
+ "id": "generativelanguage.tunedModels.create",
+ "parameters": {
+ "tunedModelId": {
+ "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?.",
+ "location": "query",
+ "type": "string"
+ }
+ },
+ "request": {
+ "$ref": "TunedModel"
+ },
+ "flatPath": "v1beta/tunedModels",
+ "response": {
+ "$ref": "Operation"
+ }
}
},
- "id": "GenerateAnswerResponse",
- "description": "Response from the model for a grounded answer."
+ "resources": {
+ "permissions": {
+ "methods": {
+ "delete": {
+ "parameters": {
+ "name": {
+ "required": true,
+ "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
+ "type": "string",
+ "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
+ "location": "path"
+ }
+ },
+ "description": "Deletes the permission.",
+ "response": {
+ "$ref": "Empty"
+ },
+ "path": "v1beta/{+name}",
+ "parameterOrder": [
+ "name"
+ ],
+ "id": "generativelanguage.tunedModels.permissions.delete",
+ "httpMethod": "DELETE",
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}"
+ },
+ "create": {
+ "parameterOrder": [
+ "parent"
+ ],
+ "description": "Create a permission to a specific resource.",
+ "response": {
+ "$ref": "Permission"
+ },
+ "request": {
+ "$ref": "Permission"
+ },
+ "path": "v1beta/{+parent}/permissions",
+ "parameters": {
+ "parent": {
+ "type": "string",
+ "pattern": "^tunedModels/[^/]+$",
+ "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
+ "required": true,
+ "location": "path"
+ }
+ },
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions",
+ "httpMethod": "POST",
+ "id": "generativelanguage.tunedModels.permissions.create"
+ },
+ "patch": {
+ "parameterOrder": [
+ "name"
+ ],
+ "request": {
+ "$ref": "Permission"
+ },
+ "path": "v1beta/{+name}",
+ "description": "Updates the permission.",
+ "response": {
+ "$ref": "Permission"
+ },
+ "id": "generativelanguage.tunedModels.permissions.patch",
+ "parameters": {
+ "name": {
+ "type": "string",
+ "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.",
+ "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
+ "required": true,
+ "location": "path"
+ },
+ "updateMask": {
+ "type": "string",
+ "format": "google-fieldmask",
+ "location": "query",
+ "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)"
+ }
+ },
+ "httpMethod": "PATCH",
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}"
+ },
+ "list": {
+ "path": "v1beta/{+parent}/permissions",
+ "parameterOrder": [
+ "parent"
+ ],
+ "response": {
+ "$ref": "ListPermissionsResponse"
+ },
+ "id": "generativelanguage.tunedModels.permissions.list",
+ "description": "Lists permissions for the specific resource.",
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions",
+ "parameters": {
+ "pageSize": {
+ "type": "integer",
+ "location": "query",
+ "format": "int32",
+ "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size."
+ },
+ "parent": {
+ "pattern": "^tunedModels/[^/]+$",
+ "location": "path",
+ "type": "string",
+ "required": true,
+ "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`"
+ },
+ "pageToken": {
+ "location": "query",
+ "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.",
+ "type": "string"
+ }
+ },
+ "httpMethod": "GET"
+ },
+ "get": {
+ "response": {
+ "$ref": "Permission"
+ },
+ "description": "Gets information about a specific Permission.",
+ "httpMethod": "GET",
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.tunedModels.permissions.get",
+ "parameters": {
+ "name": {
+ "location": "path",
+ "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
+ "required": true,
+ "type": "string",
+ "pattern": "^tunedModels/[^/]+/permissions/[^/]+$"
+ }
+ },
+ "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}",
+ "parameterOrder": [
+ "name"
+ ]
+ }
+ }
+ }
+ }
},
- "GenerateContentRequest": {
- "properties": {
- "contents": {
- "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.",
- "type": "array",
- "items": {
- "$ref": "Content"
+ "files": {
+ "methods": {
+ "get": {
+ "httpMethod": "GET",
+ "path": "v1beta/{+name}",
+ "id": "generativelanguage.files.get",
+ "flatPath": "v1beta/files/{filesId}",
+ "description": "Gets the metadata for the given `File`.",
+ "parameters": {
+ "name": {
+ "pattern": "^files/[^/]+$",
+ "required": true,
+ "type": "string",
+ "description": "Required. The name of the `File` to get. Example: `files/abc-123`",
+ "location": "path"
+ }
+ },
+ "parameterOrder": [
+ "name"
+ ],
+ "response": {
+ "$ref": "File"
}
},
- "model": {
- "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.",
- "type": "string"
- },
- "safetySettings": {
- "type": "array",
- "items": {
- "$ref": "SafetySetting"
+ "delete": {
+ "description": "Deletes the `File`.",
+ "id": "generativelanguage.files.delete",
+ "flatPath": "v1beta/files/{filesId}",
+ "response": {
+ "$ref": "Empty"
},
- "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported."
- },
- "toolConfig": {
- "description": "Optional. Tool configuration for any `Tool` specified in the request.",
- "$ref": "ToolConfig"
- },
- "tools": {
- "items": {
- "$ref": "Tool"
+ "parameterOrder": [
+ "name"
+ ],
+ "path": "v1beta/{+name}",
+ "parameters": {
+ "name": {
+ "type": "string",
+ "description": "Required. The name of the `File` to delete. Example: `files/abc-123`",
+ "pattern": "^files/[^/]+$",
+ "required": true,
+ "location": "path"
+ }
},
- "type": "array",
- "description": "Optional. A list of `Tools` the model may use to generate the next response. 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. The only supported tool is currently `Function`."
- },
- "systemInstruction": {
- "$ref": "Content",
- "description": "Optional. Developer set system instruction. Currently, text only."
+ "httpMethod": "DELETE"
},
- "generationConfig": {
- "$ref": "GenerationConfig",
- "description": "Optional. Configuration options for model generation and outputs."
+ "list": {
+ "path": "v1beta/files",
+ "description": "Lists the metadata for `File`s owned by the requesting project.",
+ "httpMethod": "GET",
+ "response": {
+ "$ref": "ListFilesResponse"
+ },
+ "flatPath": "v1beta/files",
+ "parameterOrder": [],
+ "id": "generativelanguage.files.list",
+ "parameters": {
+ "pageSize": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100.",
+ "location": "query"
+ },
+ "pageToken": {
+ "type": "string",
+ "description": "Optional. A page token from a previous `ListFiles` call.",
+ "location": "query"
+ }
+ }
}
- },
- "description": "Request to generate a completion from the model.",
+ }
+ }
+ },
+ "revision": "20240713",
+ "ownerDomain": "google.com",
+ "title": "Generative Language API",
+ "documentationLink": "https://developers.generativeai.google/api",
+ "rootUrl": "https://generativelanguage.googleapis.com/",
+ "kind": "discovery#restDescription",
+ "servicePath": "",
+ "schemas": {
+ "FunctionCall": {
"type": "object",
- "id": "GenerateContentRequest"
+ "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.",
+ "id": "FunctionCall",
+ "properties": {
+ "name": {
+ "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.",
+ "type": "string"
+ },
+ "args": {
+ "type": "object",
+ "description": "Optional. The function parameters and values in JSON object format.",
+ "additionalProperties": {
+ "type": "any",
+ "description": "Properties of the object."
+ }
+ }
+ }
},
- "InputFeedback": {
+ "Condition": {
"type": "object",
+ "id": "Condition",
"properties": {
- "safetyRatings": {
- "type": "array",
- "description": "Ratings for safety of the input. There is at most one rating per category.",
- "items": {
- "$ref": "SafetyRating"
- }
- },
- "blockReason": {
+ "operation": {
"type": "string",
- "enumDescriptions": [
- "Default value. This value is unused.",
- "Input was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.",
- "Input was blocked due to other reasons."
- ],
+ "description": "Required. Operator applied to the given key-value pair to trigger the condition.",
"enum": [
- "BLOCK_REASON_UNSPECIFIED",
- "SAFETY",
- "OTHER"
+ "OPERATOR_UNSPECIFIED",
+ "LESS",
+ "LESS_EQUAL",
+ "EQUAL",
+ "GREATER_EQUAL",
+ "GREATER",
+ "NOT_EQUAL",
+ "INCLUDES",
+ "EXCLUDES"
],
- "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase your input."
- }
- },
- "id": "InputFeedback",
- "description": "Feedback related to the input data used to answer the question, as opposed to model-generated response to the question."
- },
- "GenerateTextRequest": {
- "properties": {
- "candidateCount": {
- "type": "integer",
- "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.",
- "format": "int32"
- },
- "prompt": {
- "$ref": "TextPrompt",
- "description": "Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text."
+ "enumDescriptions": [
+ "The default value. This value is unused.",
+ "Supported by numeric.",
+ "Supported by numeric.",
+ "Supported by numeric & string.",
+ "Supported by numeric.",
+ "Supported by numeric.",
+ "Supported by numeric & string.",
+ "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.",
+ "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`."
+ ]
},
- "safetySettings": {
- "type": "array",
- "items": {
- "$ref": "SafetySetting"
- },
- "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service."
+ "stringValue": {
+ "type": "string",
+ "description": "The string value to filter the metadata on."
},
- "topP": {
+ "numericValue": {
"type": "number",
- "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function.",
- "format": "float"
- },
- "maxOutputTokens": {
- "description": "Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the `Model` specification.",
- "type": "integer",
- "format": "int32"
- },
- "stopSequences": {
- "type": "array",
- "description": "The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response.",
- "items": {
- "type": "string"
- }
- },
- "temperature": {
"format": "float",
- "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned the `getModel` function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model.",
- "type": "number"
- },
- "topK": {
- "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function.",
- "format": "int32",
- "type": "integer"
+ "description": "The numeric value to filter the metadata on."
}
},
- "id": "GenerateTextRequest",
- "type": "object",
- "description": "Request to generate a text completion response from the model."
+ "description": "Filter condition applicable to a single key."
},
- "RelevantChunk": {
+ "Message": {
"properties": {
- "chunkRelevanceScore": {
- "type": "number",
- "format": "float",
- "description": "`Chunk` relevance to the query."
+ "citationMetadata": {
+ "readOnly": true,
+ "$ref": "CitationMetadata",
+ "description": "Output only. Citation information for model-generated `content` in this `Message`. If this `Message` was generated as output from the model, this field may be populated with attribution information for any text included in the `content`. This field is used only on output."
},
- "chunk": {
- "$ref": "Chunk",
- "description": "`Chunk` associated with the query."
+ "author": {
+ "description": "Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string.",
+ "type": "string"
+ },
+ "content": {
+ "type": "string",
+ "description": "Required. The text content of the structured `Message`."
}
},
- "id": "RelevantChunk",
+ "id": "Message",
"type": "object",
- "description": "The information for a chunk relevant to a query."
- },
- "Empty": {
- "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }",
- "id": "Empty",
- "properties": {},
- "type": "object"
+ "description": "The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text."
},
- "SemanticRetrieverConfig": {
- "id": "SemanticRetrieverConfig",
- "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.",
+ "GenerateContentResponse": {
+ "id": "GenerateContentResponse",
"type": "object",
"properties": {
- "maxChunksCount": {
- "type": "integer",
- "description": "Optional. Maximum number of relevant `Chunk`s to retrieve.",
- "format": "int32"
+ "usageMetadata": {
+ "$ref": "UsageMetadata",
+ "readOnly": true,
+ "description": "Output only. Metadata on the generation requests' token usage."
},
- "metadataFilters": {
- "type": "array",
+ "promptFeedback": {
+ "$ref": "PromptFeedback",
+ "description": "Returns the prompt's feedback related to the content filters."
+ },
+ "candidates": {
+ "description": "Candidate responses from the model.",
"items": {
- "$ref": "MetadataFilter"
+ "$ref": "Candidate"
},
- "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource."
- },
- "query": {
- "description": "Required. Query to use for similarity matching `Chunk`s in the given resource.",
- "$ref": "Content"
- },
- "minimumRelevanceScore": {
- "format": "float",
- "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s.",
- "type": "number"
- },
- "source": {
- "type": "string",
- "description": "Required. Name of the resource for retrieval, e.g. corpora/123 or corpora/123/documents/abc."
+ "type": "array"
}
- }
+ },
+ "description": "Response from the model supporting multiple candidates. Note on safety ratings and content filtering. They are reported for both prompt in `GenerateContentResponse.prompt_feedback` and for each candidate in `finish_reason` and in `safety_ratings`. The API contract is that: - either all requested candidates are returned or no candidates at all - no candidates are returned only if there was something wrong with the prompt (see `prompt_feedback`) - feedback on each candidate is reported on `finish_reason` and `safety_ratings`."
},
- "GenerateTextResponse": {
+ "QueryDocumentRequest": {
"properties": {
- "candidates": {
- "description": "Candidate responses from the model.",
+ "metadataFilters": {
+ "description": "Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical \"AND\"s. Note: `Document`-level filtering is not supported for this request because a `Document` name is already specified. Example query: (year \u003e= 2020 OR year \u003c 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}}, {key = \"chunk.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}}] Example query for a numeric range of values: (year \u003e 2015 AND year \u003c= 2020) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2015, operation = GREATER}]}, {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: \"AND\"s for the same key are only supported for numeric values. String values only support \"OR\"s for the same key.",
"items": {
- "$ref": "TextCompletion"
+ "$ref": "MetadataFilter"
},
"type": "array"
},
- "safetyFeedback": {
- "description": "Returns any safety feedback related to content filtering.",
- "type": "array",
- "items": {
- "$ref": "SafetyFeedback"
- }
+ "resultsCount": {
+ "type": "integer",
+ "description": "Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.",
+ "format": "int32"
},
- "filters": {
- "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API).",
- "items": {
- "$ref": "ContentFilter"
- },
- "type": "array"
+ "query": {
+ "description": "Required. Query string to perform semantic search.",
+ "type": "string"
}
},
- "type": "object",
- "description": "The response from the model, including candidate completions.",
- "id": "GenerateTextResponse"
+ "id": "QueryDocumentRequest",
+ "description": "Request for querying a `Document`.",
+ "type": "object"
},
- "Chunk": {
+ "CitationMetadata": {
"properties": {
- "customMetadata": {
- "description": "Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20.",
+ "citationSources": {
"type": "array",
+ "description": "Citations to sources for a specific response.",
"items": {
- "$ref": "CustomMetadata"
+ "$ref": "CitationSource"
}
- },
- "updateTime": {
- "readOnly": true,
- "type": "string",
- "description": "Output only. The Timestamp of when the `Chunk` was last updated.",
- "format": "google-datetime"
- },
- "createTime": {
- "format": "google-datetime",
- "description": "Output only. The Timestamp of when the `Chunk` was created.",
- "type": "string",
- "readOnly": true
- },
- "data": {
- "$ref": "ChunkData",
- "description": "Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043."
- },
- "name": {
- "type": "string",
- "description": "Immutable. Identifier. The `Chunk` resource name. The ID (name excluding the \"corpora/*/documents/*/chunks/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`"
- },
- "state": {
- "type": "string",
- "enumDescriptions": [
- "The default value. This value is used if the state is omitted.",
- "`Chunk` is being processed (embedding and vector storage).",
- "`Chunk` is processed and available for querying.",
- "`Chunk` failed processing."
- ],
- "enum": [
- "STATE_UNSPECIFIED",
- "STATE_PENDING_PROCESSING",
- "STATE_ACTIVE",
- "STATE_FAILED"
- ],
- "description": "Output only. Current state of the `Chunk`.",
- "readOnly": true
}
},
- "description": "A `Chunk` is a subpart of a `Document` that is treated as an independent unit for the purposes of vector representation and storage. A `Corpus` can have a maximum of 1 million `Chunk`s.",
"type": "object",
- "id": "Chunk"
+ "description": "A collection of source attributions for a piece of content.",
+ "id": "CitationMetadata"
},
- "Schema": {
- "description": "The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).",
+ "BatchDeleteChunksRequest": {
"properties": {
- "items": {
- "description": "Optional. Schema of the elements of Type.ARRAY.",
- "$ref": "Schema"
- },
- "properties": {
- "description": "Optional. Properties of Type.OBJECT.",
- "additionalProperties": {
- "$ref": "Schema"
- },
- "type": "object"
- },
- "required": {
- "type": "array",
- "description": "Optional. Required properties of Type.OBJECT.",
- "items": {
- "type": "string"
- }
- },
- "type": {
- "description": "Required. Data type.",
- "enumDescriptions": [
- "Not specified, should not be used.",
- "String type.",
- "Number type.",
- "Integer type.",
- "Boolean type.",
- "Array type.",
- "Object type."
- ],
- "type": "string",
- "enum": [
- "TYPE_UNSPECIFIED",
- "STRING",
- "NUMBER",
- "INTEGER",
- "BOOLEAN",
- "ARRAY",
- "OBJECT"
- ]
- },
- "enum": {
+ "requests": {
"type": "array",
- "description": "Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]}",
+ "description": "Required. The request messages specifying the `Chunk`s to delete.",
"items": {
- "type": "string"
+ "$ref": "DeleteChunkRequest"
}
- },
- "format": {
- "type": "string",
- "description": "Optional. The format of the data. This is used only for primitive datatypes. Supported formats: for NUMBER type: float, double for INTEGER type: int32, int64"
- },
- "description": {
- "type": "string",
- "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown."
- },
- "nullable": {
- "description": "Optional. Indicates if the value may be null.",
- "type": "boolean"
}
},
- "id": "Schema",
- "type": "object"
+ "description": "Request to batch delete `Chunk`s.",
+ "type": "object",
+ "id": "BatchDeleteChunksRequest"
},
"SafetyRating": {
- "id": "SafetyRating",
- "type": "object",
"properties": {
"blocked": {
"type": "boolean",
"description": "Was this content blocked because of this rating?"
},
"category": {
- "description": "Required. The category for this rating.",
+ "type": "string",
"enumDescriptions": [
"Category is unspecified.",
"Negative or harmful comments targeting identity and/or protected attribute.",
@@ -922,7 +1852,7 @@
"Sexually explicit content.",
"Dangerous content."
],
- "type": "string",
+ "description": "Required. The category for this rating.",
"enum": [
"HARM_CATEGORY_UNSPECIFIED",
"HARM_CATEGORY_DEROGATORY",
@@ -938,8 +1868,6 @@
]
},
"probability": {
- "type": "string",
- "description": "Required. The probability of harm for this content.",
"enumDescriptions": [
"Probability is unspecified.",
"Content has a negligible chance of being unsafe.",
@@ -947,248 +1875,195 @@
"Content has a medium chance of being unsafe.",
"Content has a high chance of being unsafe."
],
+ "description": "Required. The probability of harm for this content.",
"enum": [
"HARM_PROBABILITY_UNSPECIFIED",
"NEGLIGIBLE",
"LOW",
"MEDIUM",
"HIGH"
- ]
+ ],
+ "type": "string"
}
},
- "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here."
+ "description": "Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.",
+ "id": "SafetyRating",
+ "type": "object"
},
- "File": {
+ "FileData": {
+ "description": "URI based data.",
+ "id": "FileData",
"type": "object",
- "description": "A file uploaded to the API.",
- "id": "File",
"properties": {
- "error": {
- "$ref": "Status",
- "readOnly": true,
- "description": "Output only. Error status if File processing failed."
- },
- "updateTime": {
- "description": "Output only. The timestamp of when the `File` was last updated.",
- "format": "google-datetime",
- "readOnly": true,
- "type": "string"
- },
- "name": {
- "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`",
+ "mimeType": {
+ "description": "Optional. The IANA standard MIME type of the source data.",
"type": "string"
},
- "createTime": {
- "type": "string",
- "format": "google-datetime",
- "description": "Output only. The timestamp of when the `File` was created.",
- "readOnly": true
- },
- "sizeBytes": {
+ "fileUri": {
"type": "string",
- "description": "Output only. Size of the file in bytes.",
- "readOnly": true,
- "format": "int64"
+ "description": "Required. URI."
+ }
+ }
+ },
+ "EmbedContentRequest": {
+ "type": "object",
+ "id": "EmbedContentRequest",
+ "description": "Request containing the `Content` for the model to embed.",
+ "properties": {
+ "model": {
+ "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
+ "type": "string"
},
- "sha256Hash": {
+ "taskType": {
"type": "string",
- "description": "Output only. SHA-256 hash of the uploaded bytes.",
- "readOnly": true,
- "format": "byte"
- },
- "state": {
- "readOnly": true,
- "description": "Output only. Processing state of the File.",
- "enum": [
- "STATE_UNSPECIFIED",
- "PROCESSING",
- "ACTIVE",
- "FAILED"
- ],
+ "description": "Optional. Optional task type for which the embeddings will be used. Can only be set for `models/embedding-001`.",
"enumDescriptions": [
- "The default value. This value is used if the state is omitted.",
- "File is being processed and cannot be used for inference yet.",
- "File is processed and available for inference.",
- "File failed processing."
+ "Unset value, which will default to one of the other enum values.",
+ "Specifies the given text is a query in a search/retrieval setting.",
+ "Specifies the given text is a document from the corpus being searched.",
+ "Specifies the given text will be used for STS.",
+ "Specifies that the given text will be classified.",
+ "Specifies that the embeddings will be used for clustering.",
+ "Specifies that the given text will be used for question answering.",
+ "Specifies that the given text will be used for fact verification."
],
- "type": "string"
- },
- "displayName": {
- "type": "string",
- "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\""
- },
- "videoMetadata": {
- "$ref": "VideoMetadata",
- "readOnly": true,
- "description": "Output only. Metadata for a video."
+ "enum": [
+ "TASK_TYPE_UNSPECIFIED",
+ "RETRIEVAL_QUERY",
+ "RETRIEVAL_DOCUMENT",
+ "SEMANTIC_SIMILARITY",
+ "CLASSIFICATION",
+ "CLUSTERING",
+ "QUESTION_ANSWERING",
+ "FACT_VERIFICATION"
+ ]
},
- "uri": {
- "readOnly": true,
- "type": "string",
- "description": "Output only. The uri of the `File`."
+ "outputDimensionality": {
+ "format": "int32",
+ "description": "Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024, and the earlier model (`models/embedding-001`) cannot specify this value.",
+ "type": "integer"
},
- "expirationTime": {
- "type": "string",
- "readOnly": true,
- "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire.",
- "format": "google-datetime"
+ "content": {
+ "$ref": "Content",
+ "description": "Required. The content to embed. Only the `parts.text` fields will be counted."
},
- "mimeType": {
+ "title": {
"type": "string",
- "description": "Output only. MIME type of the file.",
- "readOnly": true
- }
- }
- },
- "BatchUpdateChunksRequest": {
- "description": "Request to batch update `Chunk`s.",
- "id": "BatchUpdateChunksRequest",
- "type": "object",
- "properties": {
- "requests": {
- "items": {
- "$ref": "UpdateChunkRequest"
- },
- "type": "array",
- "description": "Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch."
+ "description": "Optional. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval."
}
}
},
- "CountMessageTokensResponse": {
- "id": "CountMessageTokensResponse",
+ "UsageMetadata": {
+ "description": "Metadata on the generation request's token usage.",
"properties": {
- "tokenCount": {
- "format": "int32",
+ "candidatesTokenCount": {
"type": "integer",
- "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative."
- }
- },
- "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.",
- "type": "object"
- },
- "Corpus": {
- "properties": {
- "updateTime": {
- "readOnly": true,
- "description": "Output only. The Timestamp of when the `Corpus` was last updated.",
- "type": "string",
- "format": "google-datetime"
+ "description": "Total number of tokens across the generated candidates.",
+ "format": "int32"
},
- "createTime": {
- "description": "Output only. The Timestamp of when the `Corpus` was created.",
- "type": "string",
- "format": "google-datetime",
- "readOnly": true
+ "cachedContentTokenCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Number of tokens in the cached part of the prompt, i.e. in the cached content."
},
- "displayName": {
- "description": "Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\"",
- "type": "string"
+ "promptTokenCount": {
+ "format": "int32",
+ "type": "integer",
+ "description": "Number of tokens in the prompt. When cached_content is set, this is still the total effective prompt size. I.e. this includes the number of tokens in the cached content."
},
- "name": {
- "type": "string",
- "description": "Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`"
+ "totalTokenCount": {
+ "type": "integer",
+ "description": "Total token count for the generation request (prompt + candidates).",
+ "format": "int32"
}
},
- "id": "Corpus",
- "description": "A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.",
+ "id": "UsageMetadata",
"type": "object"
},
- "TuningExamples": {
- "id": "TuningExamples",
- "description": "A set of tuning examples. Can be training or validation data.",
+ "GroundingPassages": {
+ "id": "GroundingPassages",
"type": "object",
+ "description": "A repeated list of passages.",
"properties": {
- "examples": {
- "items": {
- "$ref": "TuningExample"
- },
+ "passages": {
"type": "array",
- "description": "Required. The examples. Example input can be for text or discuss, but all examples in a set must be of the same type."
+ "description": "List of passages.",
+ "items": {
+ "$ref": "GroundingPassage"
+ }
}
}
},
- "Example": {
- "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.",
- "id": "Example",
+ "UpdateChunkRequest": {
+ "description": "Request to update a `Chunk`.",
+ "id": "UpdateChunkRequest",
+ "type": "object",
"properties": {
- "input": {
- "$ref": "Message",
- "description": "Required. An example of an input `Message` from the user."
+ "updateMask": {
+ "format": "google-fieldmask",
+ "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.",
+ "type": "string"
},
- "output": {
- "$ref": "Message",
- "description": "Required. An example of what the model should output given the input."
+ "chunk": {
+ "$ref": "Chunk",
+ "description": "Required. The `Chunk` to update."
}
- },
- "type": "object"
+ }
},
- "StringList": {
- "id": "StringList",
+ "InputFeedback": {
+ "description": "Feedback related to the input data used to answer the question, as opposed to model-generated response to the question.",
+ "type": "object",
+ "id": "InputFeedback",
"properties": {
- "values": {
- "description": "The string values of the metadata to store.",
+ "blockReason": {
+ "enumDescriptions": [
+ "Default value. This value is unused.",
+ "Input was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.",
+ "Input was blocked due to other reasons."
+ ],
+ "type": "string",
+ "enum": [
+ "BLOCK_REASON_UNSPECIFIED",
+ "SAFETY",
+ "OTHER"
+ ],
+ "description": "Optional. If set, the input was blocked and no candidates are returned. Rephrase your input."
+ },
+ "safetyRatings": {
+ "description": "Ratings for safety of the input. There is at most one rating per category.",
"items": {
- "type": "string"
+ "$ref": "SafetyRating"
},
"type": "array"
}
- },
- "description": "User provided string values assigned to a single metadata key.",
- "type": "object"
- },
- "SafetyFeedback": {
- "type": "object",
- "description": "Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.",
- "id": "SafetyFeedback",
- "properties": {
- "rating": {
- "description": "Safety rating evaluated from content.",
- "$ref": "SafetyRating"
- },
- "setting": {
- "$ref": "SafetySetting",
- "description": "Safety settings applied to the request."
- }
}
},
- "CountMessageTokensRequest": {
- "properties": {
- "prompt": {
- "description": "Required. The prompt, whose token count is to be returned.",
- "$ref": "MessagePrompt"
- }
- },
- "type": "object",
- "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
- "id": "CountMessageTokensRequest"
- },
- "CustomMetadata": {
- "id": "CustomMetadata",
+ "TextCompletion": {
"type": "object",
- "description": "User provided metadata stored as key-value pairs.",
+ "description": "Output text returned from a model.",
"properties": {
- "stringValue": {
- "description": "The string value of the metadata to store.",
- "type": "string"
- },
- "key": {
- "description": "Required. The key of the metadata to store.",
- "type": "string"
+ "citationMetadata": {
+ "$ref": "CitationMetadata",
+ "readOnly": true,
+ "description": "Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`."
},
- "numericValue": {
- "description": "The numeric value of the metadata to store.",
- "type": "number",
- "format": "float"
+ "output": {
+ "description": "Output only. The generated text returned from the model.",
+ "type": "string",
+ "readOnly": true
},
- "stringListValue": {
- "description": "The StringList value of the metadata to store.",
- "$ref": "StringList"
+ "safetyRatings": {
+ "description": "Ratings for the safety of a response. There is at most one rating per category.",
+ "type": "array",
+ "items": {
+ "$ref": "SafetyRating"
+ }
}
- }
+ },
+ "id": "TextCompletion"
},
"MessagePrompt": {
- "type": "object",
- "id": "MessagePrompt",
+ "description": "All of the structured input text passed to the model as a prompt. A `MessagePrompt` contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model.",
"properties": {
"messages": {
"type": "array",
@@ -1197,40 +2072,68 @@
"$ref": "Message"
}
},
- "context": {
- "type": "string",
- "description": "Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: \"Translate the phrase from English to French.\" or \"Given a statement, classify the sentiment as happy, sad or neutral.\" Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated."
- },
"examples": {
- "type": "array",
+ "description": "Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`.",
"items": {
"$ref": "Example"
},
- "description": "Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`."
+ "type": "array"
+ },
+ "context": {
+ "type": "string",
+ "description": "Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: \"Translate the phrase from English to French.\" or \"Given a statement, classify the sentiment as happy, sad or neutral.\" Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated."
}
},
- "description": "All of the structured input text passed to the model as a prompt. A `MessagePrompt` contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model."
+ "id": "MessagePrompt",
+ "type": "object"
},
- "CreateFileRequest": {
+ "QueryCorpusRequest": {
"type": "object",
+ "description": "Request for querying a `Corpus`.",
"properties": {
- "file": {
- "description": "Optional. Metadata for the file to create.",
- "$ref": "File"
+ "query": {
+ "description": "Required. Query string to perform semantic search.",
+ "type": "string"
+ },
+ "metadataFilters": {
+ "type": "array",
+ "description": "Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical \"AND\"s. Example query at document level: (year \u003e= 2020 OR year \u003c 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]}] Example query at chunk level for a numeric range of values: (year \u003e 2015 AND year \u003c= 2020) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2015, operation = GREATER}]}, {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: \"AND\"s for the same key are only supported for numeric values. String values only support \"OR\"s for the same key.",
+ "items": {
+ "$ref": "MetadataFilter"
+ }
+ },
+ "resultsCount": {
+ "description": "Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.",
+ "type": "integer",
+ "format": "int32"
}
},
- "description": "Request for `CreateFile`.",
- "id": "CreateFileRequest"
+ "id": "QueryCorpusRequest"
},
"GenerateAnswerRequest": {
+ "id": "GenerateAnswerRequest",
"description": "Request to generate a grounded answer from the model.",
+ "type": "object",
"properties": {
"safetySettings": {
+ "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateAnswerRequest.contents` and `GenerateAnswerResponse.candidate`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported.",
"type": "array",
"items": {
"$ref": "SafetySetting"
- },
- "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateAnswerRequest.contents` and `GenerateAnswerResponse.candidate`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported."
+ }
+ },
+ "temperature": {
+ "description": "Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases.",
+ "format": "float",
+ "type": "number"
+ },
+ "inlinePassages": {
+ "$ref": "GroundingPassages",
+ "description": "Passages provided inline with the request."
+ },
+ "semanticRetriever": {
+ "description": "Content retrieved from resources created via the Semantic Retriever API.",
+ "$ref": "SemanticRetrieverConfig"
},
"contents": {
"type": "array",
@@ -1239,12 +2142,8 @@
},
"description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single question to answer. For multi-turn queries, this is a repeated field that contains conversation history and the last `Content` in the list containing the question. Note: GenerateAnswer currently only supports queries in English."
},
- "temperature": {
- "type": "number",
- "format": "float",
- "description": "Optional. Controls the randomness of the output. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model. A low temperature (~0.2) is usually recommended for Attributed-Question-Answering use cases."
- },
"answerStyle": {
+ "type": "string",
"enumDescriptions": [
"Unspecified answer style.",
"Succint but abstract style.",
@@ -1257,838 +2156,1493 @@
"EXTRACTIVE",
"VERBOSE"
],
- "description": "Required. Style in which answers should be returned.",
- "type": "string"
- },
- "semanticRetriever": {
- "$ref": "SemanticRetrieverConfig",
- "description": "Content retrieved from resources created via the Semantic Retriever API."
+ "description": "Required. Style in which answers should be returned."
+ }
+ }
+ },
+ "FunctionCallingConfig": {
+ "type": "object",
+ "id": "FunctionCallingConfig",
+ "properties": {
+ "mode": {
+ "type": "string",
+ "enum": [
+ "MODE_UNSPECIFIED",
+ "AUTO",
+ "ANY",
+ "NONE"
+ ],
+ "enumDescriptions": [
+ "Unspecified function calling mode. This value should not be used.",
+ "Default model behavior, model decides to predict either a function call or a natural language response.",
+ "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".",
+ "Model will not predict any function call. Model behavior is same as when not passing any function declarations."
+ ],
+ "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO."
},
- "inlinePassages": {
- "$ref": "GroundingPassages",
- "description": "Passages provided inline with the request."
+ "allowedFunctionNames": {
+ "type": "array",
+ "description": "Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.",
+ "items": {
+ "type": "string"
+ }
}
},
- "id": "GenerateAnswerRequest",
- "type": "object"
+ "description": "Configuration for specifying function calling behavior."
},
- "Message": {
- "id": "Message",
+ "CustomMetadata": {
+ "id": "CustomMetadata",
+ "description": "User provided metadata stored as key-value pairs.",
"properties": {
- "author": {
+ "key": {
"type": "string",
- "description": "Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string."
+ "description": "Required. The key of the metadata to store."
},
- "citationMetadata": {
- "readOnly": true,
- "$ref": "CitationMetadata",
- "description": "Output only. Citation information for model-generated `content` in this `Message`. If this `Message` was generated as output from the model, this field may be populated with attribution information for any text included in the `content`. This field is used only on output."
+ "stringValue": {
+ "type": "string",
+ "description": "The string value of the metadata to store."
},
- "content": {
- "description": "Required. The text content of the structured `Message`.",
- "type": "string"
+ "stringListValue": {
+ "$ref": "StringList",
+ "description": "The StringList value of the metadata to store."
+ },
+ "numericValue": {
+ "format": "float",
+ "description": "The numeric value of the metadata to store.",
+ "type": "number"
}
},
- "description": "The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text.",
"type": "object"
},
- "CitationSource": {
+ "CountTokensRequest": {
"properties": {
- "startIndex": {
- "format": "int32",
- "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.",
- "type": "integer"
+ "generateContentRequest": {
+ "$ref": "GenerateContentRequest",
+ "description": "Optional. The overall input given to the model. CountTokens will count prompt, function calling, etc."
},
- "license": {
- "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.",
- "type": "string"
+ "contents": {
+ "items": {
+ "$ref": "Content"
+ },
+ "type": "array",
+ "description": "Optional. The input given to the model as a prompt. This field is ignored when `generate_content_request` is set."
+ }
+ },
+ "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
+ "type": "object",
+ "id": "CountTokensRequest"
+ },
+ "ListDocumentsResponse": {
+ "properties": {
+ "documents": {
+ "description": "The returned `Document`s.",
+ "type": "array",
+ "items": {
+ "$ref": "Document"
+ }
},
- "uri": {
- "description": "Optional. URI that is attributed as a source for a portion of the text.",
+ "nextPageToken": {
+ "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.",
"type": "string"
- },
- "endIndex": {
- "description": "Optional. End of the attributed segment, exclusive.",
- "format": "int32",
- "type": "integer"
}
},
- "description": "A citation to a source for a portion of a specific response.",
- "id": "CitationSource",
+ "id": "ListDocumentsResponse",
+ "type": "object",
+ "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`."
+ },
+ "ToolConfig": {
+ "id": "ToolConfig",
+ "description": "The Tool configuration containing parameters for specifying `Tool` use in the request.",
+ "properties": {
+ "functionCallingConfig": {
+ "$ref": "FunctionCallingConfig",
+ "description": "Optional. Function calling config."
+ }
+ },
"type": "object"
},
- "GenerateMessageRequest": {
+ "GenerateTextRequest": {
+ "description": "Request to generate a text completion response from the model.",
"type": "object",
- "description": "Request to generate a message response from the model.",
+ "id": "GenerateTextRequest",
"properties": {
- "prompt": {
- "description": "Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.",
- "$ref": "MessagePrompt"
+ "candidateCount": {
+ "type": "integer",
+ "description": "Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.",
+ "format": "int32"
},
- "topP": {
- "type": "number",
- "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`.",
- "format": "float"
+ "maxOutputTokens": {
+ "type": "integer",
+ "description": "Optional. The maximum number of tokens to include in a candidate. If unset, this will default to output_token_limit specified in the `Model` specification.",
+ "format": "int32"
},
"temperature": {
- "type": "number",
+ "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned the `getModel` function. Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied and creative, while a value closer to 0.0 will typically result in more straightforward responses from the model.",
"format": "float",
- "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model."
+ "type": "number"
},
- "candidateCount": {
- "type": "integer",
- "format": "int32",
- "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`."
+ "stopSequences": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response."
+ },
+ "topP": {
+ "type": "number",
+ "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned the `getModel` function.",
+ "format": "float"
},
"topK": {
- "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens.",
"type": "integer",
+ "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Defaults to 40. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned the `getModel` function.",
"format": "int32"
+ },
+ "prompt": {
+ "description": "Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text.",
+ "$ref": "TextPrompt"
+ },
+ "safetySettings": {
+ "type": "array",
+ "items": {
+ "$ref": "SafetySetting"
+ },
+ "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text service."
+ }
+ }
+ },
+ "GroundingPassage": {
+ "type": "object",
+ "description": "Passage included inline with a grounding configuration.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Identifier for the passage for attributing this passage in grounded answers."
+ },
+ "content": {
+ "$ref": "Content",
+ "description": "Content of the passage."
}
},
- "id": "GenerateMessageRequest"
+ "id": "GroundingPassage"
+ },
+ "Operation": {
+ "properties": {
+ "name": {
+ "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.",
+ "type": "string"
+ },
+ "done": {
+ "type": "boolean",
+ "description": "If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available."
+ },
+ "metadata": {
+ "type": "object",
+ "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.",
+ "additionalProperties": {
+ "type": "any",
+ "description": "Properties of the object. Contains field @type with type URL."
+ }
+ },
+ "response": {
+ "additionalProperties": {
+ "type": "any",
+ "description": "Properties of the object. Contains field @type with type URL."
+ },
+ "type": "object",
+ "description": "The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`."
+ },
+ "error": {
+ "$ref": "Status",
+ "description": "The error result of the operation in case of failure or cancellation."
+ }
+ },
+ "description": "This resource represents a long-running operation that is the result of a network API call.",
+ "id": "Operation",
+ "type": "object"
},
"CreateFileResponse": {
"description": "Response for `CreateFile`.",
- "id": "CreateFileResponse",
"type": "object",
"properties": {
"file": {
"$ref": "File",
"description": "Metadata for the created file."
}
- }
+ },
+ "id": "CreateFileResponse"
},
- "CountTextTokensResponse": {
- "id": "CountTextTokensResponse",
+ "CountMessageTokensResponse": {
+ "description": "A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.",
+ "type": "object",
"properties": {
"tokenCount": {
+ "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.",
"type": "integer",
- "format": "int32",
- "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative."
+ "format": "int32"
+ }
+ },
+ "id": "CountMessageTokensResponse"
+ },
+ "GenerateAnswerResponse": {
+ "description": "Response from the model for a grounded answer.",
+ "properties": {
+ "answerableProbability": {
+ "type": "number",
+ "description": "Output only. The model's estimate of the probability that its answer is correct and grounded in the input passages. A low answerable_probability indicates that the answer might not be grounded in the sources. When `answerable_probability` is low, some clients may wish to: * Display a message to the effect of \"We couldn’t answer that question\" to the user. * Fall back to a general-purpose LLM that answers the question from world knowledge. The threshold and nature of such fallbacks will depend on individual clients’ use cases. 0.5 is a good starting threshold.",
+ "format": "float",
+ "readOnly": true
+ },
+ "answer": {
+ "$ref": "Candidate",
+ "description": "Candidate answer from the model. Note: The model *always* attempts to provide a grounded answer, even when the answer is unlikely to be answerable from the given passages. In that case, a low-quality or ungrounded answer may be provided, along with a low `answerable_probability`."
+ },
+ "inputFeedback": {
+ "description": "Output only. Feedback related to the input data used to answer the question, as opposed to model-generated response to the question. \"Input data\" can be one or more of the following: - Question specified by the last entry in `GenerateAnswerRequest.content` - Conversation history specified by the other entries in `GenerateAnswerRequest.content` - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or `GenerateAnswerRequest.inline_passages`)",
+ "readOnly": true,
+ "$ref": "InputFeedback"
}
},
"type": "object",
- "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`."
+ "id": "GenerateAnswerResponse"
},
- "ListChunksResponse": {
+ "QueryDocumentResponse": {
+ "id": "QueryDocumentResponse",
"type": "object",
- "id": "ListChunksResponse",
+ "description": "Response from `QueryDocument` containing a list of relevant chunks.",
"properties": {
- "nextPageToken": {
- "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.",
- "type": "string"
- },
- "chunks": {
+ "relevantChunks": {
"type": "array",
- "description": "The returned `Chunk`s.",
+ "description": "The returned relevant chunks.",
"items": {
- "$ref": "Chunk"
+ "$ref": "RelevantChunk"
+ }
+ }
+ }
+ },
+ "StringList": {
+ "id": "StringList",
+ "properties": {
+ "values": {
+ "description": "The string values of the metadata to store.",
+ "type": "array",
+ "items": {
+ "type": "string"
}
}
},
- "description": "Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`."
+ "description": "User provided string values assigned to a single metadata key.",
+ "type": "object"
},
- "TransferOwnershipResponse": {
+ "SafetyFeedback": {
+ "id": "SafetyFeedback",
"type": "object",
- "description": "Response from `TransferOwnership`.",
- "properties": {},
- "id": "TransferOwnershipResponse"
+ "properties": {
+ "rating": {
+ "description": "Safety rating evaluated from content.",
+ "$ref": "SafetyRating"
+ },
+ "setting": {
+ "$ref": "SafetySetting",
+ "description": "Safety settings applied to the request."
+ }
+ },
+ "description": "Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result."
},
- "BatchDeleteChunksRequest": {
- "id": "BatchDeleteChunksRequest",
+ "BatchCreateChunksResponse": {
"properties": {
- "requests": {
+ "chunks": {
+ "type": "array",
"items": {
- "$ref": "DeleteChunkRequest"
+ "$ref": "Chunk"
},
- "description": "Required. The request messages specifying the `Chunk`s to delete.",
- "type": "array"
+ "description": "`Chunk`s created."
}
},
+ "description": "Response from `BatchCreateChunks` containing a list of created `Chunk`s.",
"type": "object",
- "description": "Request to batch delete `Chunk`s."
+ "id": "BatchCreateChunksResponse"
},
- "ListPermissionsResponse": {
+ "GenerateMessageResponse": {
"properties": {
- "permissions": {
- "description": "Returned permissions.",
+ "messages": {
"type": "array",
"items": {
- "$ref": "Permission"
+ "$ref": "Message"
+ },
+ "description": "The conversation history used by the model."
+ },
+ "candidates": {
+ "description": "Candidate response messages from the model.",
+ "type": "array",
+ "items": {
+ "$ref": "Message"
}
},
- "nextPageToken": {
- "type": "string",
- "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."
+ "filters": {
+ "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category.",
+ "items": {
+ "$ref": "ContentFilter"
+ },
+ "type": "array"
+ }
+ },
+ "description": "The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.",
+ "id": "GenerateMessageResponse",
+ "type": "object"
+ },
+ "CreateChunkRequest": {
+ "properties": {
+ "chunk": {
+ "description": "Required. The `Chunk` to create.",
+ "$ref": "Chunk"
+ },
+ "parent": {
+ "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
+ "type": "string"
}
},
"type": "object",
- "id": "ListPermissionsResponse",
- "description": "Response from `ListPermissions` containing a paginated list of permissions."
+ "id": "CreateChunkRequest",
+ "description": "Request to create a `Chunk`."
},
- "DeleteChunkRequest": {
+ "CachedContentUsageMetadata": {
+ "description": "Metadata on the usage of the cached content.",
+ "type": "object",
+ "id": "CachedContentUsageMetadata",
"properties": {
- "name": {
- "type": "string",
- "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`"
+ "totalTokenCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of tokens that the cached content consumes."
+ }
+ }
+ },
+ "BatchEmbedTextResponse": {
+ "properties": {
+ "embeddings": {
+ "type": "array",
+ "items": {
+ "$ref": "Embedding"
+ },
+ "description": "Output only. The embeddings generated from the input text.",
+ "readOnly": true
}
},
- "id": "DeleteChunkRequest",
- "description": "Request to delete a `Chunk`.",
- "type": "object"
+ "description": "The response to a EmbedTextRequest.",
+ "type": "object",
+ "id": "BatchEmbedTextResponse"
},
"Status": {
"properties": {
- "message": {
- "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
- "type": "string"
- },
"code": {
- "type": "integer",
"description": "The status code, which should be an enum value of google.rpc.Code.",
+ "type": "integer",
"format": "int32"
},
+ "message": {
+ "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
+ "type": "string"
+ },
"details": {
"items": {
- "type": "object",
"additionalProperties": {
- "description": "Properties of the object. Contains field @type with type URL.",
- "type": "any"
- }
+ "type": "any",
+ "description": "Properties of the object. Contains field @type with type URL."
+ },
+ "type": "object"
},
- "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
- "type": "array"
+ "type": "array",
+ "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use."
}
},
"id": "Status",
- "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).",
- "type": "object"
- },
- "Hyperparameters": {
"type": "object",
+ "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors)."
+ },
+ "CitationSource": {
+ "id": "CitationSource",
+ "description": "A citation to a source for a portion of a specific response.",
"properties": {
- "batchSize": {
+ "license": {
+ "description": "Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.",
+ "type": "string"
+ },
+ "endIndex": {
"format": "int32",
- "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.",
+ "description": "Optional. End of the attributed segment, exclusive.",
"type": "integer"
},
- "epochCount": {
+ "startIndex": {
+ "description": "Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.",
"format": "int32",
- "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used.",
"type": "integer"
},
- "learningRateMultiplier": {
- "format": "float",
- "type": "number",
- "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used."
- },
- "learningRate": {
- "type": "number",
- "format": "float",
- "description": "Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples."
+ "uri": {
+ "description": "Optional. URI that is attributed as a source for a portion of the text.",
+ "type": "string"
}
},
- "id": "Hyperparameters",
- "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance"
+ "type": "object"
},
- "BatchCreateChunksResponse": {
- "id": "BatchCreateChunksResponse",
+ "ListChunksResponse": {
+ "description": "Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`.",
+ "type": "object",
"properties": {
"chunks": {
- "type": "array",
- "description": "`Chunk`s created.",
"items": {
"$ref": "Chunk"
- }
+ },
+ "type": "array",
+ "description": "The returned `Chunk`s."
+ },
+ "nextPageToken": {
+ "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.",
+ "type": "string"
}
},
- "description": "Response from `BatchCreateChunks` containing a list of created `Chunk`s.",
- "type": "object"
+ "id": "ListChunksResponse"
},
- "GroundingAttribution": {
- "description": "Attribution for a source that contributed to an answer.",
+ "ListTunedModelsResponse": {
+ "type": "object",
+ "description": "Response from `ListTunedModels` containing a paginated list of Models.",
"properties": {
- "sourceId": {
- "$ref": "AttributionSourceId",
- "readOnly": true,
- "description": "Output only. Identifier for the source contributing to this attribution."
+ "nextPageToken": {
+ "type": "string",
+ "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."
},
- "content": {
- "description": "Grounding source content that makes up this attribution.",
- "$ref": "Content"
+ "tunedModels": {
+ "description": "The returned Models.",
+ "items": {
+ "$ref": "TunedModel"
+ },
+ "type": "array"
}
},
- "type": "object",
- "id": "GroundingAttribution"
+ "id": "ListTunedModelsResponse"
},
- "Condition": {
- "id": "Condition",
+ "TransferOwnershipResponse": {
"type": "object",
+ "description": "Response from `TransferOwnership`.",
+ "properties": {},
+ "id": "TransferOwnershipResponse"
+ },
+ "GenerateContentRequest": {
+ "id": "GenerateContentRequest",
"properties": {
- "stringValue": {
+ "cachedContent": {
"type": "string",
- "description": "The string value to filter the metadata on."
+ "description": "Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `cachedContents/{cachedContent}`"
},
- "operation": {
- "description": "Required. Operator applied to the given key-value pair to trigger the condition.",
+ "generationConfig": {
+ "description": "Optional. Configuration options for model generation and outputs.",
+ "$ref": "GenerationConfig"
+ },
+ "model": {
"type": "string",
- "enum": [
- "OPERATOR_UNSPECIFIED",
- "LESS",
- "LESS_EQUAL",
- "EQUAL",
- "GREATER_EQUAL",
- "GREATER",
- "NOT_EQUAL",
- "INCLUDES",
- "EXCLUDES"
- ],
- "enumDescriptions": [
- "The default value. This value is unused.",
- "Supported by numeric.",
- "Supported by numeric.",
- "Supported by numeric & string.",
- "Supported by numeric.",
- "Supported by numeric.",
- "Supported by numeric & string.",
- "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`.",
- "Supported by string only when `CustomMetadata` value type for the given key has a `string_list_value`."
- ]
+ "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`."
},
- "numericValue": {
- "type": "number",
- "description": "The numeric value to filter the metadata on.",
- "format": "float"
- }
- },
- "description": "Filter condition applicable to a single key."
- },
- "ContentEmbedding": {
- "description": "A list of floats representing an embedding.",
- "properties": {
- "values": {
+ "systemInstruction": {
+ "description": "Optional. Developer set system instruction. Currently, text only.",
+ "$ref": "Content"
+ },
+ "contents": {
+ "type": "array",
+ "items": {
+ "$ref": "Content"
+ },
+ "description": "Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request."
+ },
+ "toolConfig": {
+ "description": "Optional. Tool configuration for any `Tool` specified in the request.",
+ "$ref": "ToolConfig"
+ },
+ "tools": {
+ "type": "array",
+ "description": "Optional. A list of `Tools` the model may use to generate the next response. 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. The only supported tool is currently `Function`.",
+ "items": {
+ "$ref": "Tool"
+ }
+ },
+ "safetySettings": {
"items": {
- "format": "float",
- "type": "number"
+ "$ref": "SafetySetting"
},
"type": "array",
- "description": "The embedding values."
+ "description": "Optional. A list of unique `SafetySetting` instances for blocking unsafe content. This will be enforced on the `GenerateContentRequest.contents` and `GenerateContentResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any contents and responses that fail to meet the thresholds set by these settings. This list overrides the default settings for each `SafetyCategory` specified in the safety_settings. If there is no `SafetySetting` for a given `SafetyCategory` provided in the list, the API will use the default safety setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, HARM_CATEGORY_HARASSMENT are supported."
}
},
- "id": "ContentEmbedding",
+ "description": "Request to generate a completion from the model.",
"type": "object"
},
- "UsageMetadata": {
+ "TextPrompt": {
+ "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.",
"type": "object",
- "description": "Metadata on the generation request's token usage.",
- "id": "UsageMetadata",
"properties": {
- "promptTokenCount": {
- "type": "integer",
- "format": "int32",
- "description": "Number of tokens in the prompt."
- },
- "candidatesTokenCount": {
- "format": "int32",
- "description": "Total number of tokens across the generated candidates.",
- "type": "integer"
+ "text": {
+ "description": "Required. The prompt text.",
+ "type": "string"
+ }
+ },
+ "id": "TextPrompt"
+ },
+ "SafetySetting": {
+ "type": "object",
+ "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.",
+ "id": "SafetySetting",
+ "properties": {
+ "category": {
+ "description": "Required. The category for this setting.",
+ "type": "string",
+ "enum": [
+ "HARM_CATEGORY_UNSPECIFIED",
+ "HARM_CATEGORY_DEROGATORY",
+ "HARM_CATEGORY_TOXICITY",
+ "HARM_CATEGORY_VIOLENCE",
+ "HARM_CATEGORY_SEXUAL",
+ "HARM_CATEGORY_MEDICAL",
+ "HARM_CATEGORY_DANGEROUS",
+ "HARM_CATEGORY_HARASSMENT",
+ "HARM_CATEGORY_HATE_SPEECH",
+ "HARM_CATEGORY_SEXUALLY_EXPLICIT",
+ "HARM_CATEGORY_DANGEROUS_CONTENT"
+ ],
+ "enumDescriptions": [
+ "Category is unspecified.",
+ "Negative or harmful comments targeting identity and/or protected attribute.",
+ "Content that is rude, disrespectful, or profane.",
+ "Describes scenarios depicting violence against an individual or group, or general descriptions of gore.",
+ "Contains references to sexual acts or other lewd content.",
+ "Promotes unchecked medical advice.",
+ "Dangerous content that promotes, facilitates, or encourages harmful acts.",
+ "Harasment content.",
+ "Hate speech and content.",
+ "Sexually explicit content.",
+ "Dangerous content."
+ ]
},
- "totalTokenCount": {
- "type": "integer",
- "format": "int32",
- "description": "Total token count for the generation request (prompt + candidates)."
+ "threshold": {
+ "enum": [
+ "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
+ "BLOCK_LOW_AND_ABOVE",
+ "BLOCK_MEDIUM_AND_ABOVE",
+ "BLOCK_ONLY_HIGH",
+ "BLOCK_NONE"
+ ],
+ "enumDescriptions": [
+ "Threshold is unspecified.",
+ "Content with NEGLIGIBLE will be allowed.",
+ "Content with NEGLIGIBLE and LOW will be allowed.",
+ "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.",
+ "All content will be allowed."
+ ],
+ "type": "string",
+ "description": "Required. Controls the probability threshold at which harm is blocked."
}
}
},
- "TuningTask": {
+ "GenerationConfig": {
+ "id": "GenerationConfig",
+ "type": "object",
"properties": {
- "trainingData": {
- "description": "Required. Input only. Immutable. The model training data.",
- "$ref": "Dataset"
- },
- "snapshots": {
+ "stopSequences": {
"items": {
- "$ref": "TuningSnapshot"
+ "type": "string"
},
- "description": "Output only. Metrics collected during tuning.",
- "readOnly": true,
- "type": "array"
+ "type": "array",
+ "description": "Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response."
},
- "completeTime": {
- "format": "google-datetime",
- "description": "Output only. The timestamp when tuning this model completed.",
- "readOnly": true,
- "type": "string"
+ "responseSchema": {
+ "$ref": "Schema",
+ "description": "Optional. Output response schema of the generated candidate text when response mime type can have schema. Schema can be objects, primitives or arrays and is a subset of [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
},
- "hyperparameters": {
- "$ref": "Hyperparameters",
- "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used."
+ "responseMimeType": {
+ "type": "string",
+ "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: `text/plain`: (default) Text output. `application/json`: JSON response in the candidates."
},
- "startTime": {
- "format": "google-datetime",
- "description": "Output only. The timestamp when tuning this model started.",
- "readOnly": true,
- "type": "string"
+ "topP": {
+ "type": "number",
+ "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned from the `getModel` function.",
+ "format": "float"
+ },
+ "candidateCount": {
+ "description": "Optional. Number of generated responses to return. Currently, this value can only be set to 1. If unset, this will default to 1.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "maxOutputTokens": {
+ "description": "Optional. The maximum number of tokens to include in a candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "topK": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Optional. The maximum number of tokens to consider when sampling. Models use nucleus sampling or combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned from the `getModel` function. Empty `top_k` field in `Model` indicates the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests."
+ },
+ "temperature": {
+ "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0].",
+ "type": "number",
+ "format": "float"
}
},
- "type": "object",
- "description": "Tuning tasks that create tuned models.",
- "id": "TuningTask"
+ "description": "Configuration options for model generation and outputs. Not all parameters may be configurable for every model."
},
- "QueryDocumentRequest": {
+ "SemanticRetrieverConfig": {
+ "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.",
+ "id": "SemanticRetrieverConfig",
"type": "object",
"properties": {
- "query": {
+ "source": {
"type": "string",
- "description": "Required. Query string to perform semantic search."
+ "description": "Required. Name of the resource for retrieval, e.g. corpora/123 or corpora/123/documents/abc."
},
- "resultsCount": {
- "description": "Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.",
+ "minimumRelevanceScore": {
+ "format": "float",
+ "type": "number",
+ "description": "Optional. Minimum relevance score for retrieved relevant `Chunk`s."
+ },
+ "maxChunksCount": {
"type": "integer",
- "format": "int32"
+ "format": "int32",
+ "description": "Optional. Maximum number of relevant `Chunk`s to retrieve."
},
"metadataFilters": {
"type": "array",
+ "description": "Optional. Filters for selecting `Document`s and/or `Chunk`s from the resource.",
"items": {
"$ref": "MetadataFilter"
- },
- "description": "Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical \"AND\"s. Note: `Document`-level filtering is not supported for this request because a `Document` name is already specified. Example query: (year \u003e= 2020 OR year \u003c 2010) AND (genre = drama OR genre = action) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}}, {key = \"chunk.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}}] Example query for a numeric range of values: (year \u003e 2015 AND year \u003c= 2020) `MetadataFilter` object list: metadata_filters = [ {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2015, operation = GREATER}]}, {key = \"chunk.custom_metadata.year\" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] Note: \"AND\"s for the same key are only supported for numeric values. String values only support \"OR\"s for the same key."
+ }
+ },
+ "query": {
+ "$ref": "Content",
+ "description": "Required. Query to use for similarity matching `Chunk`s in the given resource."
}
- },
- "description": "Request for querying a `Document`.",
- "id": "QueryDocumentRequest"
+ }
},
- "BatchEmbedTextRequest": {
- "id": "BatchEmbedTextRequest",
- "type": "object",
+ "BatchUpdateChunksResponse": {
"properties": {
- "texts": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "description": "Optional. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown."
- },
- "requests": {
+ "chunks": {
"items": {
- "$ref": "EmbedTextRequest"
+ "$ref": "Chunk"
},
"type": "array",
- "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set."
+ "description": "`Chunk`s updated."
}
},
- "description": "Batch request to get a text embedding from the model."
+ "description": "Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.",
+ "id": "BatchUpdateChunksResponse",
+ "type": "object"
},
- "AttributionSourceId": {
- "id": "AttributionSourceId",
+ "CountTextTokensRequest": {
"type": "object",
+ "id": "CountTextTokensRequest",
+ "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
"properties": {
- "semanticRetrieverChunk": {
- "$ref": "SemanticRetrieverChunk",
- "description": "Identifier for a `Chunk` fetched via Semantic Retriever."
- },
- "groundingPassage": {
- "$ref": "GroundingPassageId",
- "description": "Identifier for an inline passage."
+ "prompt": {
+ "description": "Required. The free-form input text given to the model as a prompt.",
+ "$ref": "TextPrompt"
}
- },
- "description": "Identifier for the source contributing to this attribution."
+ }
},
- "EmbedTextResponse": {
+ "ListFilesResponse": {
+ "description": "Response for `ListFiles`.",
"properties": {
- "embedding": {
- "description": "Output only. The embedding generated from the input text.",
- "$ref": "Embedding",
- "readOnly": true
+ "files": {
+ "items": {
+ "$ref": "File"
+ },
+ "description": "The list of `File`s.",
+ "type": "array"
+ },
+ "nextPageToken": {
+ "type": "string",
+ "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call."
}
},
- "type": "object",
- "description": "The response to a EmbedTextRequest.",
- "id": "EmbedTextResponse"
+ "id": "ListFilesResponse",
+ "type": "object"
},
- "GroundingPassage": {
- "id": "GroundingPassage",
- "type": "object",
- "description": "Passage included inline with a grounding configuration.",
+ "ListModelsResponse": {
+ "id": "ListModelsResponse",
"properties": {
- "content": {
- "$ref": "Content",
- "description": "Content of the passage."
+ "models": {
+ "description": "The returned Models.",
+ "type": "array",
+ "items": {
+ "$ref": "Model"
+ }
},
- "id": {
- "description": "Identifier for the passage for attributing this passage in grounded answers.",
- "type": "string"
+ "nextPageToken": {
+ "type": "string",
+ "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."
}
- }
+ },
+ "type": "object",
+ "description": "Response from `ListModel` containing a paginated list of Models."
},
- "FunctionCall": {
- "id": "FunctionCall",
+ "Part": {
+ "description": "A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.",
"properties": {
- "args": {
- "type": "object",
- "description": "Optional. The function parameters and values in JSON object format.",
- "additionalProperties": {
- "description": "Properties of the object.",
- "type": "any"
- }
+ "inlineData": {
+ "$ref": "Blob",
+ "description": "Inline media bytes."
},
- "name": {
+ "functionResponse": {
+ "$ref": "FunctionResponse",
+ "description": "The result output of a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model."
+ },
+ "executableCode": {
+ "$ref": "ExecutableCode",
+ "description": "Code generated by the model that is meant to be executed."
+ },
+ "fileData": {
+ "$ref": "FileData",
+ "description": "URI based data."
+ },
+ "functionCall": {
+ "$ref": "FunctionCall",
+ "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values."
+ },
+ "text": {
"type": "string",
- "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63."
+ "description": "Inline text."
+ },
+ "codeExecutionResult": {
+ "description": "Result of executing the `ExecutableCode`.",
+ "$ref": "CodeExecutionResult"
}
},
- "description": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.",
- "type": "object"
+ "type": "object",
+ "id": "Part"
},
- "GenerationConfig": {
- "id": "GenerationConfig",
+ "TunedModel": {
"properties": {
- "topK": {
- "type": "integer",
- "description": "Optional. The maximum number of tokens to consider when sampling. Models use nucleus sampling or combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens. Models running with nucleus sampling don't allow top_k setting. Note: The default value varies by model, see the `Model.top_k` attribute of the `Model` returned from the `getModel` function. Empty `top_k` field in `Model` indicates the model doesn't apply top-k sampling and doesn't allow setting `top_k` on requests.",
- "format": "int32"
+ "createTime": {
+ "format": "google-datetime",
+ "description": "Output only. The timestamp when this model was created.",
+ "readOnly": true,
+ "type": "string"
},
- "maxOutputTokens": {
- "type": "integer",
- "description": "Optional. The maximum number of tokens to include in a candidate. Note: The default value varies by model, see the `Model.output_token_limit` attribute of the `Model` returned from the `getModel` function.",
- "format": "int32"
+ "tuningTask": {
+ "description": "Required. The tuning task that creates the tuned model.",
+ "$ref": "TuningTask"
},
- "candidateCount": {
- "type": "integer",
- "description": "Optional. Number of generated responses to return. Currently, this value can only be set to 1. If unset, this will default to 1.",
- "format": "int32"
+ "displayName": {
+ "type": "string",
+ "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces."
},
"topP": {
- "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number of tokens based on the cumulative probability. Note: The default value varies by model, see the `Model.top_p` attribute of the `Model` returned from the `getModel` function.",
- "format": "float",
- "type": "number"
+ "type": "number",
+ "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.",
+ "format": "float"
},
- "responseMimeType": {
+ "name": {
"type": "string",
- "description": "Optional. Output response mimetype of the generated candidate text. Supported mimetype: `text/plain`: (default) Text output. `application/json`: JSON response in the candidates."
+ "readOnly": true,
+ "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: display_name = \"Sentence Translator\" name = \"tunedModels/sentence-translator-u3b7m\""
+ },
+ "state": {
+ "enumDescriptions": [
+ "The default value. This value is unused.",
+ "The model is being created.",
+ "The model is ready to be used.",
+ "The model failed to be created."
+ ],
+ "type": "string",
+ "description": "Output only. The state of the tuned model.",
+ "enum": [
+ "STATE_UNSPECIFIED",
+ "CREATING",
+ "ACTIVE",
+ "FAILED"
+ ],
+ "readOnly": true
+ },
+ "updateTime": {
+ "description": "Output only. The timestamp when this model was updated.",
+ "format": "google-datetime",
+ "readOnly": true,
+ "type": "string"
+ },
+ "baseModel": {
+ "description": "Immutable. The name of the `Model` to tune. Example: `models/text-bison-001`",
+ "type": "string"
},
"temperature": {
"type": "number",
- "format": "float",
- "description": "Optional. Controls the randomness of the output. Note: The default value varies by model, see the `Model.temperature` attribute of the `Model` returned from the `getModel` function. Values can range from [0.0, 2.0]."
+ "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.",
+ "format": "float"
},
- "responseSchema": {
- "$ref": "Schema",
- "description": "Optional. Output response schema of the generated candidate text when response mime type can have schema. Schema can be objects, primitives or arrays and is a subset of [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."
+ "topK": {
+ "type": "integer",
+ "description": "Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.",
+ "format": "int32"
},
- "stopSequences": {
+ "tunedModelSource": {
+ "$ref": "TunedModelSource",
+ "description": "Optional. TunedModel to use as the starting point for training the new model."
+ },
+ "description": {
+ "type": "string",
+ "description": "Optional. A short description of this model."
+ }
+ },
+ "description": "A fine-tuned model created using ModelService.CreateTunedModel.",
+ "type": "object",
+ "id": "TunedModel"
+ },
+ "TuningSnapshot": {
+ "type": "object",
+ "properties": {
+ "computeTime": {
+ "format": "google-datetime",
+ "type": "string",
+ "readOnly": true,
+ "description": "Output only. The timestamp when this metric was computed."
+ },
+ "epoch": {
+ "type": "integer",
+ "format": "int32",
+ "readOnly": true,
+ "description": "Output only. The epoch this step was part of."
+ },
+ "meanLoss": {
+ "description": "Output only. The mean loss of the training examples for this step.",
+ "type": "number",
+ "format": "float",
+ "readOnly": true
+ },
+ "step": {
+ "description": "Output only. The tuning step.",
+ "type": "integer",
+ "readOnly": true,
+ "format": "int32"
+ }
+ },
+ "id": "TuningSnapshot",
+ "description": "Record for a single tuning step."
+ },
+ "Embedding": {
+ "type": "object",
+ "id": "Embedding",
+ "properties": {
+ "value": {
+ "type": "array",
"items": {
- "type": "string"
+ "type": "number",
+ "format": "float"
},
- "type": "array",
- "description": "Optional. The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response."
+ "description": "The embedding values."
}
},
- "description": "Configuration options for model generation and outputs. Not all parameters may be configurable for every model.",
- "type": "object"
+ "description": "A list of floats representing the embedding."
},
- "TextCompletion": {
- "id": "TextCompletion",
+ "Blob": {
+ "id": "Blob",
"type": "object",
- "description": "Output text returned from a model.",
+ "description": "Raw media bytes. Text should not be sent as raw bytes, use the 'text' field.",
"properties": {
+ "data": {
+ "description": "Raw bytes for media formats.",
+ "format": "byte",
+ "type": "string"
+ },
+ "mimeType": {
+ "description": "The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).",
+ "type": "string"
+ }
+ }
+ },
+ "Candidate": {
+ "description": "A response candidate generated from the model.",
+ "id": "Candidate",
+ "type": "object",
+ "properties": {
+ "index": {
+ "type": "integer",
+ "description": "Output only. Index of the candidate in the list of candidates.",
+ "readOnly": true,
+ "format": "int32"
+ },
"safetyRatings": {
+ "type": "array",
+ "description": "List of ratings for the safety of a response candidate. There is at most one rating per category.",
"items": {
"$ref": "SafetyRating"
- },
+ }
+ },
+ "content": {
+ "$ref": "Content",
+ "description": "Output only. Generated content returned from the model.",
+ "readOnly": true
+ },
+ "groundingAttributions": {
+ "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls.",
"type": "array",
- "description": "Ratings for the safety of a response. There is at most one rating per category."
+ "items": {
+ "$ref": "GroundingAttribution"
+ },
+ "readOnly": true
},
- "citationMetadata": {
+ "finishReason": {
+ "enumDescriptions": [
+ "Default value. This value is unused.",
+ "Natural stop point of the model or provided stop sequence.",
+ "The maximum number of tokens as specified in the request was reached.",
+ "The candidate content was flagged for safety reasons.",
+ "The candidate content was flagged for recitation reasons.",
+ "The candidate content was flagged for using an unsupported language.",
+ "Unknown reason."
+ ],
"readOnly": true,
- "description": "Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`.",
- "$ref": "CitationMetadata"
+ "description": "Optional. Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.",
+ "type": "string",
+ "enum": [
+ "FINISH_REASON_UNSPECIFIED",
+ "STOP",
+ "MAX_TOKENS",
+ "SAFETY",
+ "RECITATION",
+ "LANGUAGE",
+ "OTHER"
+ ]
},
- "output": {
+ "citationMetadata": {
"readOnly": true,
- "type": "string",
- "description": "Output only. The generated text returned from the model."
+ "$ref": "CitationMetadata",
+ "description": "Output only. Citation information for model-generated candidate. This field may be populated with recitation information for any text included in the `content`. These are passages that are \"recited\" from copyrighted material in the foundational LLM's training data."
+ },
+ "tokenCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Output only. Token count for this candidate.",
+ "readOnly": true
}
}
},
- "BatchUpdateChunksResponse": {
+ "CreateFileRequest": {
+ "type": "object",
+ "description": "Request for `CreateFile`.",
+ "id": "CreateFileRequest",
"properties": {
- "chunks": {
- "description": "`Chunk`s updated.",
+ "file": {
+ "$ref": "File",
+ "description": "Optional. Metadata for the file to create."
+ }
+ }
+ },
+ "PromptFeedback": {
+ "properties": {
+ "safetyRatings": {
+ "description": "Ratings for safety of the prompt. There is at most one rating per category.",
"items": {
- "$ref": "Chunk"
+ "$ref": "SafetyRating"
},
"type": "array"
+ },
+ "blockReason": {
+ "enumDescriptions": [
+ "Default value. This value is unused.",
+ "Prompt was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.",
+ "Prompt was blocked due to unknown reasons."
+ ],
+ "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase your prompt.",
+ "enum": [
+ "BLOCK_REASON_UNSPECIFIED",
+ "SAFETY",
+ "OTHER"
+ ],
+ "type": "string"
}
},
- "description": "Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.",
- "type": "object",
- "id": "BatchUpdateChunksResponse"
+ "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.",
+ "id": "PromptFeedback",
+ "type": "object"
},
- "ListCorporaResponse": {
+ "SemanticRetrieverChunk": {
+ "type": "object",
+ "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.",
"properties": {
- "nextPageToken": {
+ "source": {
+ "readOnly": true,
"type": "string",
- "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."
+ "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`"
},
- "corpora": {
- "description": "The returned corpora.",
- "type": "array",
- "items": {
- "$ref": "Corpus"
- }
+ "chunk": {
+ "readOnly": true,
+ "type": "string",
+ "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`"
+ }
+ },
+ "id": "SemanticRetrieverChunk"
+ },
+ "EmbedContentResponse": {
+ "id": "EmbedContentResponse",
+ "description": "The response to an `EmbedContentRequest`.",
+ "properties": {
+ "embedding": {
+ "readOnly": true,
+ "$ref": "ContentEmbedding",
+ "description": "Output only. The embedding generated from the input content."
}
},
- "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.",
- "id": "ListCorporaResponse",
"type": "object"
},
- "ListDocumentsResponse": {
- "description": "Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.",
- "id": "ListDocumentsResponse",
+ "MetadataFilter": {
+ "description": "User provided filter to limit retrieval based on `Chunk` or `Document` level metadata values. Example (genre = drama OR genre = action): key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]",
+ "id": "MetadataFilter",
"properties": {
- "documents": {
- "description": "The returned `Document`s.",
- "type": "array",
+ "conditions": {
"items": {
- "$ref": "Document"
- }
+ "$ref": "Condition"
+ },
+ "type": "array",
+ "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs."
},
- "nextPageToken": {
+ "key": {
"type": "string",
- "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."
+ "description": "Required. The key of the metadata to filter on."
}
},
"type": "object"
},
- "Dataset": {
- "description": "Dataset for training or validation.",
+ "TunedModelSource": {
+ "type": "object",
+ "id": "TunedModelSource",
"properties": {
- "examples": {
- "$ref": "TuningExamples",
- "description": "Optional. Inline examples."
+ "baseModel": {
+ "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/text-bison-001`",
+ "readOnly": true,
+ "type": "string"
+ },
+ "tunedModel": {
+ "type": "string",
+ "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`"
}
},
- "id": "Dataset",
- "type": "object"
+ "description": "Tuned model as a source for training a new model."
},
- "UpdateChunkRequest": {
+ "Model": {
"type": "object",
+ "description": "Information about a Generative Language Model.",
"properties": {
- "updateMask": {
- "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.",
+ "description": {
"type": "string",
- "format": "google-fieldmask"
+ "description": "A short description of the model."
},
- "chunk": {
- "description": "Required. The `Chunk` to update.",
- "$ref": "Chunk"
+ "topP": {
+ "description": "For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.",
+ "format": "float",
+ "type": "number"
+ },
+ "inputTokenLimit": {
+ "format": "int32",
+ "description": "Maximum number of input tokens allowed for this model.",
+ "type": "integer"
+ },
+ "version": {
+ "type": "string",
+ "description": "Required. The version number of the model. This represents the major version"
+ },
+ "baseModelId": {
+ "type": "string",
+ "description": "Required. The name of the base model, pass this to the generation request. Examples: * `chat-bison`"
+ },
+ "supportedGenerationMethods": {
+ "type": "array",
+ "description": "The model's supported generation methods. The method names are defined as Pascal case strings, such as `generateMessage` which correspond to API methods.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "outputTokenLimit": {
+ "format": "int32",
+ "description": "Maximum number of output tokens available for this model.",
+ "type": "integer"
+ },
+ "name": {
+ "description": "Required. The resource name of the `Model`. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/chat-bison-001`",
+ "type": "string"
+ },
+ "maxTemperature": {
+ "format": "float",
+ "type": "number",
+ "description": "The maximum temperature this model can use."
+ },
+ "temperature": {
+ "description": "Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.",
+ "format": "float",
+ "type": "number"
+ },
+ "topK": {
+ "format": "int32",
+ "type": "integer",
+ "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter."
+ },
+ "displayName": {
+ "description": "The human-readable name of the model. E.g. \"Chat Bison\". The name can be up to 128 characters long and can consist of any UTF-8 characters.",
+ "type": "string"
}
},
- "id": "UpdateChunkRequest",
- "description": "Request to update a `Chunk`."
+ "id": "Model"
},
- "TextPrompt": {
- "id": "TextPrompt",
- "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.",
+ "ListCorporaResponse": {
+ "type": "object",
+ "id": "ListCorporaResponse",
+ "description": "Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.",
"properties": {
- "text": {
- "type": "string",
- "description": "Required. The prompt text."
+ "nextPageToken": {
+ "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.",
+ "type": "string"
+ },
+ "corpora": {
+ "items": {
+ "$ref": "Corpus"
+ },
+ "type": "array",
+ "description": "The returned corpora."
}
- },
- "type": "object"
+ }
},
- "ListModelsResponse": {
- "description": "Response from `ListModel` containing a paginated list of Models.",
+ "TuningTask": {
+ "id": "TuningTask",
+ "type": "object",
+ "description": "Tuning tasks that create tuned models.",
"properties": {
- "nextPageToken": {
+ "hyperparameters": {
+ "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.",
+ "$ref": "Hyperparameters"
+ },
+ "startTime": {
"type": "string",
- "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages."
+ "format": "google-datetime",
+ "readOnly": true,
+ "description": "Output only. The timestamp when tuning this model started."
},
- "models": {
+ "completeTime": {
+ "format": "google-datetime",
+ "description": "Output only. The timestamp when tuning this model completed.",
+ "readOnly": true,
+ "type": "string"
+ },
+ "snapshots": {
+ "type": "array",
+ "readOnly": true,
"items": {
- "$ref": "Model"
+ "$ref": "TuningSnapshot"
},
- "description": "The returned Models.",
- "type": "array"
+ "description": "Output only. Metrics collected during tuning."
+ },
+ "trainingData": {
+ "$ref": "Dataset",
+ "description": "Required. Input only. Immutable. The model training data."
}
- },
- "type": "object",
- "id": "ListModelsResponse"
+ }
},
- "PromptFeedback": {
- "id": "PromptFeedback",
+ "Schema": {
+ "id": "Schema",
"type": "object",
- "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.",
"properties": {
- "safetyRatings": {
+ "enum": {
+ "description": "Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:[\"EAST\", NORTH\", \"SOUTH\", \"WEST\"]}",
"type": "array",
- "description": "Ratings for safety of the prompt. There is at most one rating per category.",
"items": {
- "$ref": "SafetyRating"
+ "type": "string"
}
},
- "blockReason": {
- "description": "Optional. If set, the prompt was blocked and no candidates are returned. Rephrase your prompt.",
- "enumDescriptions": [
- "Default value. This value is unused.",
- "Prompt was blocked due to safety reasons. You can inspect `safety_ratings` to understand which safety category blocked it.",
- "Prompt was blocked due to unknown reaasons."
- ],
+ "type": {
"enum": [
- "BLOCK_REASON_UNSPECIFIED",
- "SAFETY",
- "OTHER"
+ "TYPE_UNSPECIFIED",
+ "STRING",
+ "NUMBER",
+ "INTEGER",
+ "BOOLEAN",
+ "ARRAY",
+ "OBJECT"
+ ],
+ "type": "string",
+ "enumDescriptions": [
+ "Not specified, should not be used.",
+ "String type.",
+ "Number type.",
+ "Integer type.",
+ "Boolean type.",
+ "Array type.",
+ "Object type."
],
+ "description": "Required. Data type."
+ },
+ "description": {
+ "type": "string",
+ "description": "Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown."
+ },
+ "nullable": {
+ "description": "Optional. Indicates if the value may be null.",
+ "type": "boolean"
+ },
+ "required": {
+ "description": "Optional. Required properties of Type.OBJECT.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "items": {
+ "$ref": "Schema",
+ "description": "Optional. Schema of the elements of Type.ARRAY."
+ },
+ "format": {
+ "description": "Optional. The format of the data. This is used only for primitive datatypes. Supported formats: for NUMBER type: float, double for INTEGER type: int32, int64 for STRING type: enum",
"type": "string"
+ },
+ "properties": {
+ "type": "object",
+ "description": "Optional. Properties of Type.OBJECT.",
+ "additionalProperties": {
+ "$ref": "Schema"
+ }
}
- }
+ },
+ "description": "The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema)."
},
- "ListFilesResponse": {
- "id": "ListFilesResponse",
- "description": "Response for `ListFiles`.",
+ "ChunkData": {
"type": "object",
"properties": {
- "files": {
+ "stringValue": {
+ "type": "string",
+ "description": "The `Chunk` content as a string. The maximum number of tokens per chunk is 2043."
+ }
+ },
+ "id": "ChunkData",
+ "description": "Extracted data that represents the `Chunk` content."
+ },
+ "CountMessageTokensRequest": {
+ "id": "CountMessageTokensRequest",
+ "type": "object",
+ "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
+ "properties": {
+ "prompt": {
+ "$ref": "MessagePrompt",
+ "description": "Required. The prompt, whose token count is to be returned."
+ }
+ }
+ },
+ "ListCachedContentsResponse": {
+ "properties": {
+ "cachedContents": {
"type": "array",
- "description": "The list of `File`s.",
+ "description": "List of cached contents.",
"items": {
- "$ref": "File"
+ "$ref": "CachedContent"
}
},
"nextPageToken": {
- "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.",
+ "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.",
"type": "string"
}
- }
- },
- "EmbedContentRequest": {
+ },
"type": "object",
+ "id": "ListCachedContentsResponse",
+ "description": "Response with CachedContents list."
+ },
+ "Content": {
+ "description": "The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.",
+ "id": "Content",
"properties": {
- "model": {
+ "role": {
"type": "string",
- "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`"
+ "description": "Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset."
},
- "outputDimensionality": {
- "description": "Optional. Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024, and the earlier model (`models/embedding-001`) cannot specify this value.",
+ "parts": {
+ "description": "Ordered `Parts` that constitute a single message. Parts may have different MIME types.",
+ "items": {
+ "$ref": "Part"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object"
+ },
+ "CountTokensResponse": {
+ "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.",
+ "properties": {
+ "totalTokens": {
+ "format": "int32",
"type": "integer",
- "format": "int32"
- },
- "taskType": {
- "type": "string",
- "enum": [
- "TASK_TYPE_UNSPECIFIED",
- "RETRIEVAL_QUERY",
- "RETRIEVAL_DOCUMENT",
- "SEMANTIC_SIMILARITY",
- "CLASSIFICATION",
- "CLUSTERING",
- "QUESTION_ANSWERING",
- "FACT_VERIFICATION"
- ],
- "enumDescriptions": [
- "Unset value, which will default to one of the other enum values.",
- "Specifies the given text is a query in a search/retrieval setting.",
- "Specifies the given text is a document from the corpus being searched.",
- "Specifies the given text will be used for STS.",
- "Specifies that the given text will be classified.",
- "Specifies that the embeddings will be used for clustering.",
- "Specifies that the given text will be used for question answering.",
- "Specifies that the given text will be used for fact verification."
- ],
- "description": "Optional. Optional task type for which the embeddings will be used. Can only be set for `models/embedding-001`."
- },
- "title": {
- "type": "string",
- "description": "Optional. An optional title for the text. Only applicable when TaskType is `RETRIEVAL_DOCUMENT`. Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality embeddings for retrieval."
- },
- "content": {
- "description": "Required. The content to embed. Only the `parts.text` fields will be counted.",
- "$ref": "Content"
+ "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative. When cached_content is set, this is still the total effective prompt size. I.e. this includes the number of tokens in the cached content."
}
},
- "description": "Request containing the `Content` for the model to embed.",
- "id": "EmbedContentRequest"
+ "type": "object",
+ "id": "CountTokensResponse"
},
- "TunedModel": {
+ "CachedContent": {
+ "type": "object",
+ "id": "CachedContent",
"properties": {
- "state": {
- "readOnly": true,
- "description": "Output only. The state of the tuned model.",
+ "model": {
"type": "string",
- "enumDescriptions": [
- "The default value. This value is unused.",
- "The model is being created.",
- "The model is ready to be used.",
- "The model failed to be created."
- ],
- "enum": [
- "STATE_UNSPECIFIED",
- "CREATING",
- "ACTIVE",
- "FAILED"
- ]
+ "description": "Required. Immutable. The name of the `Model` to use for cached content Format: `models/{model}`"
},
- "updateTime": {
- "description": "Output only. The timestamp when this model was updated.",
- "readOnly": true,
- "format": "google-datetime",
- "type": "string"
+ "ttl": {
+ "type": "string",
+ "format": "google-duration",
+ "description": "Input only. New TTL for this resource, input only."
},
"name": {
- "readOnly": true,
+ "description": "Optional. Identifier. The resource name referring to the cached content. Format: `cachedContents/{id}`",
+ "type": "string"
+ },
+ "expireTime": {
"type": "string",
- "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: display_name = \"Sentence Translator\" name = \"tunedModels/sentence-translator-u3b7m\""
+ "description": "Timestamp in UTC of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.",
+ "format": "google-datetime"
},
- "tuningTask": {
- "description": "Required. The tuning task that creates the tuned model.",
- "$ref": "TuningTask"
+ "tools": {
+ "description": "Optional. Input only. Immutable. A list of `Tools` the model may use to generate the next response",
+ "items": {
+ "$ref": "Tool"
+ },
+ "type": "array"
},
- "displayName": {
+ "createTime": {
+ "readOnly": true,
+ "description": "Output only. Creation time of the cache entry.",
"type": "string",
- "description": "Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces."
+ "format": "google-datetime"
},
- "createTime": {
+ "displayName": {
+ "description": "Optional. Immutable. The user-generated meaningful display name of the cached content. Maximum 128 Unicode characters.",
+ "type": "string"
+ },
+ "systemInstruction": {
+ "$ref": "Content",
+ "description": "Optional. Input only. Immutable. Developer set system instruction. Currently text only."
+ },
+ "contents": {
+ "description": "Optional. Input only. Immutable. The content to cache.",
+ "items": {
+ "$ref": "Content"
+ },
+ "type": "array"
+ },
+ "usageMetadata": {
+ "readOnly": true,
+ "$ref": "CachedContentUsageMetadata",
+ "description": "Output only. Metadata on the usage of the cached content."
+ },
+ "updateTime": {
+ "description": "Output only. When the cache entry was last updated in UTC time.",
"type": "string",
"format": "google-datetime",
- "readOnly": true,
- "description": "Output only. The timestamp when this model was created."
+ "readOnly": true
},
- "temperature": {
- "format": "float",
- "type": "number",
- "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model."
+ "toolConfig": {
+ "description": "Optional. Input only. Immutable. Tool config. This config is shared for all tools.",
+ "$ref": "ToolConfig"
+ }
+ },
+ "description": "Content that has been preprocessed and can be used in subsequent request to GenerativeService. Cached content can be only used with model it was created for."
+ },
+ "BatchEmbedTextRequest": {
+ "description": "Batch request to get a text embedding from the model.",
+ "id": "BatchEmbedTextRequest",
+ "type": "object",
+ "properties": {
+ "requests": {
+ "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set.",
+ "type": "array",
+ "items": {
+ "$ref": "EmbedTextRequest"
+ }
},
+ "texts": {
+ "items": {
+ "type": "string"
+ },
+ "description": "Optional. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown.",
+ "type": "array"
+ }
+ }
+ },
+ "BatchEmbedContentsResponse": {
+ "id": "BatchEmbedContentsResponse",
+ "properties": {
+ "embeddings": {
+ "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.",
+ "items": {
+ "$ref": "ContentEmbedding"
+ },
+ "type": "array",
+ "readOnly": true
+ }
+ },
+ "description": "The response to a `BatchEmbedContentsRequest`.",
+ "type": "object"
+ },
+ "FunctionDeclaration": {
+ "description": "Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.",
+ "properties": {
"description": {
- "type": "string",
- "description": "Optional. A short description of this model."
+ "description": "Required. A brief description of the function.",
+ "type": "string"
},
- "topP": {
- "description": "Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.",
+ "name": {
+ "description": "Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.",
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "Schema",
+ "description": "Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter."
+ }
+ },
+ "id": "FunctionDeclaration",
+ "type": "object"
+ },
+ "Hyperparameters": {
+ "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance",
+ "type": "object",
+ "id": "Hyperparameters",
+ "properties": {
+ "learningRateMultiplier": {
+ "format": "float",
"type": "number",
- "format": "float"
+ "description": "Optional. Immutable. The learning rate multiplier is used to calculate a final learning_rate based on the default (recommended) value. Actual learning rate := learning_rate_multiplier * default learning rate Default learning rate is dependent on base model and dataset size. If not set, a default of 1.0 will be used."
},
- "topK": {
- "format": "int32",
- "description": "Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.",
- "type": "integer"
+ "learningRate": {
+ "format": "float",
+ "description": "Optional. Immutable. The learning rate hyperparameter for tuning. If not set, a default of 0.001 or 0.0002 will be calculated based on the number of training examples.",
+ "type": "number"
},
- "baseModel": {
- "type": "string",
- "description": "Immutable. The name of the `Model` to tune. Example: `models/text-bison-001`"
+ "batchSize": {
+ "description": "Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples.",
+ "type": "integer",
+ "format": "int32"
},
- "tunedModelSource": {
- "description": "Optional. TunedModel to use as the starting point for training the new model.",
- "$ref": "TunedModelSource"
+ "epochCount": {
+ "format": "int32",
+ "type": "integer",
+ "description": "Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used."
+ }
+ }
+ },
+ "TuningExample": {
+ "description": "A single example for tuning.",
+ "id": "TuningExample",
+ "properties": {
+ "output": {
+ "description": "Required. The expected model output.",
+ "type": "string"
+ },
+ "textInput": {
+ "description": "Optional. Text model input.",
+ "type": "string"
}
},
- "description": "A fine-tuned model created using ModelService.CreateTunedModel.",
- "type": "object",
- "id": "TunedModel"
+ "type": "object"
},
"BatchCreateChunksRequest": {
+ "id": "BatchCreateChunksRequest",
"type": "object",
"properties": {
"requests": {
@@ -2099,1954 +3653,700 @@
}
}
},
- "id": "BatchCreateChunksRequest",
"description": "Request to batch create `Chunk`s."
},
- "ChunkData": {
+ "GroundingAttribution": {
+ "description": "Attribution for a source that contributed to an answer.",
+ "type": "object",
+ "id": "GroundingAttribution",
"properties": {
- "stringValue": {
- "description": "The `Chunk` content as a string. The maximum number of tokens per chunk is 2043.",
- "type": "string"
+ "content": {
+ "$ref": "Content",
+ "description": "Grounding source content that makes up this attribution."
+ },
+ "sourceId": {
+ "readOnly": true,
+ "description": "Output only. Identifier for the source contributing to this attribution.",
+ "$ref": "AttributionSourceId"
}
- },
- "type": "object",
- "description": "Extracted data that represents the `Chunk` content.",
- "id": "ChunkData"
+ }
},
- "FunctionCallingConfig": {
+ "ContentFilter": {
+ "description": "Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.",
+ "id": "ContentFilter",
"properties": {
- "mode": {
+ "message": {
+ "description": "A string that describes the filtering behavior in more detail.",
+ "type": "string"
+ },
+ "reason": {
"enum": [
- "MODE_UNSPECIFIED",
- "AUTO",
- "ANY",
- "NONE"
+ "BLOCKED_REASON_UNSPECIFIED",
+ "SAFETY",
+ "OTHER"
],
- "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.",
- "type": "string",
+ "description": "The reason content was blocked during request processing.",
"enumDescriptions": [
- "Unspecified function calling mode. This value should not be used.",
- "Default model behavior, model decides to predict either a function call or a natural language repspose.",
- "Model is constrained to always predicting a function call only. If \"allowed_function_names\" are set, the predicted function call will be limited to any one of \"allowed_function_names\", else the predicted function call will be any one of the provided \"function_declarations\".",
- "Model will not predict any function call. Model behavior is same as when not passing any function declarations."
- ]
+ "A blocked reason was not specified.",
+ "Content was blocked by safety settings.",
+ "Content was blocked, but the reason is uncategorized."
+ ],
+ "type": "string"
+ }
+ },
+ "type": "object"
+ },
+ "Tool": {
+ "id": "Tool",
+ "properties": {
+ "codeExecution": {
+ "$ref": "CodeExecution",
+ "description": "Optional. Enables the model to execute code as part of generation."
},
- "allowedFunctionNames": {
- "description": "Optional. A set of function names that, when provided, limits the functions the model will call. This should only be set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.",
+ "functionDeclarations": {
+ "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the [content.role] \"function\" generation context for the next model turn.",
"items": {
- "type": "string"
+ "$ref": "FunctionDeclaration"
},
"type": "array"
}
},
- "description": "Configuration for specifying function calling behavior.",
- "id": "FunctionCallingConfig",
+ "description": "Tool details that the model may use to generate response. 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.",
"type": "object"
},
- "SafetySetting": {
- "id": "SafetySetting",
- "description": "Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed probability that content is blocked.",
+ "BatchUpdateChunksRequest": {
+ "description": "Request to batch update `Chunk`s.",
"type": "object",
"properties": {
- "category": {
- "description": "Required. The category for this setting.",
- "type": "string",
- "enum": [
- "HARM_CATEGORY_UNSPECIFIED",
- "HARM_CATEGORY_DEROGATORY",
- "HARM_CATEGORY_TOXICITY",
- "HARM_CATEGORY_VIOLENCE",
- "HARM_CATEGORY_SEXUAL",
- "HARM_CATEGORY_MEDICAL",
- "HARM_CATEGORY_DANGEROUS",
- "HARM_CATEGORY_HARASSMENT",
- "HARM_CATEGORY_HATE_SPEECH",
- "HARM_CATEGORY_SEXUALLY_EXPLICIT",
- "HARM_CATEGORY_DANGEROUS_CONTENT"
- ],
- "enumDescriptions": [
- "Category is unspecified.",
- "Negative or harmful comments targeting identity and/or protected attribute.",
- "Content that is rude, disrespectful, or profane.",
- "Describes scenarios depicting violence against an individual or group, or general descriptions of gore.",
- "Contains references to sexual acts or other lewd content.",
- "Promotes unchecked medical advice.",
- "Dangerous content that promotes, facilitates, or encourages harmful acts.",
- "Harasment content.",
- "Hate speech and content.",
- "Sexually explicit content.",
- "Dangerous content."
- ]
+ "requests": {
+ "description": "Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch.",
+ "type": "array",
+ "items": {
+ "$ref": "UpdateChunkRequest"
+ }
+ }
+ },
+ "id": "BatchUpdateChunksRequest"
+ },
+ "RelevantChunk": {
+ "description": "The information for a chunk relevant to a query.",
+ "id": "RelevantChunk",
+ "type": "object",
+ "properties": {
+ "chunk": {
+ "description": "`Chunk` associated with the query.",
+ "$ref": "Chunk"
},
- "threshold": {
+ "chunkRelevanceScore": {
+ "type": "number",
+ "format": "float",
+ "description": "`Chunk` relevance to the query."
+ }
+ }
+ },
+ "Empty": {
+ "properties": {},
+ "id": "Empty",
+ "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }",
+ "type": "object"
+ },
+ "Example": {
+ "id": "Example",
+ "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.",
+ "type": "object",
+ "properties": {
+ "output": {
+ "$ref": "Message",
+ "description": "Required. An example of what the model should output given the input."
+ },
+ "input": {
+ "$ref": "Message",
+ "description": "Required. An example of an input `Message` from the user."
+ }
+ }
+ },
+ "ExecutableCode": {
+ "type": "object",
+ "id": "ExecutableCode",
+ "description": "Code generated by the model that is meant to be executed, and the result returned to the model. Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.",
+ "properties": {
+ "code": {
+ "description": "Required. The code to be executed.",
+ "type": "string"
+ },
+ "language": {
"type": "string",
"enumDescriptions": [
- "Threshold is unspecified.",
- "Content with NEGLIGIBLE will be allowed.",
- "Content with NEGLIGIBLE and LOW will be allowed.",
- "Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.",
- "All content will be allowed."
+ "Unspecified language. This value should not be used.",
+ "Python \u003e= 3.10, with numpy and simpy available."
],
"enum": [
- "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
- "BLOCK_LOW_AND_ABOVE",
- "BLOCK_MEDIUM_AND_ABOVE",
- "BLOCK_ONLY_HIGH",
- "BLOCK_NONE"
+ "LANGUAGE_UNSPECIFIED",
+ "PYTHON"
],
- "description": "Required. Controls the probability threshold at which harm is blocked."
+ "description": "Required. Programming language of the `code`."
}
}
},
- "Document": {
+ "Corpus": {
"properties": {
- "name": {
+ "updateTime": {
+ "format": "google-datetime",
"type": "string",
- "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"corpora/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`"
+ "description": "Output only. The Timestamp of when the `Corpus` was last updated.",
+ "readOnly": true
},
"displayName": {
- "description": "Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: \"Semantic Retriever Documentation\"",
+ "type": "string",
+ "description": "Optional. The human-readable display name for the `Corpus`. The display name must be no more than 512 characters in length, including spaces. Example: \"Docs on Semantic Retriever\""
+ },
+ "name": {
+ "type": "string",
+ "description": "Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`"
+ },
+ "createTime": {
+ "format": "google-datetime",
+ "description": "Output only. The Timestamp of when the `Corpus` was created.",
+ "readOnly": true,
"type": "string"
+ }
+ },
+ "description": "A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.",
+ "id": "Corpus",
+ "type": "object"
+ },
+ "EmbedTextResponse": {
+ "description": "The response to a EmbedTextRequest.",
+ "type": "object",
+ "id": "EmbedTextResponse",
+ "properties": {
+ "embedding": {
+ "readOnly": true,
+ "$ref": "Embedding",
+ "description": "Output only. The embedding generated from the input text."
+ }
+ }
+ },
+ "VideoMetadata": {
+ "id": "VideoMetadata",
+ "description": "Metadata for a video `File`.",
+ "type": "object",
+ "properties": {
+ "videoDuration": {
+ "type": "string",
+ "description": "Duration of the video.",
+ "format": "google-duration"
+ }
+ }
+ },
+ "CodeExecutionResult": {
+ "type": "object",
+ "properties": {
+ "outcome": {
+ "type": "string",
+ "enum": [
+ "OUTCOME_UNSPECIFIED",
+ "OUTCOME_OK",
+ "OUTCOME_FAILED",
+ "OUTCOME_DEADLINE_EXCEEDED"
+ ],
+ "description": "Required. Outcome of the code execution.",
+ "enumDescriptions": [
+ "Unspecified status. This value should not be used.",
+ "Code execution completed successfully.",
+ "Code execution finished but with a failure. `stderr` should contain the reason.",
+ "Code execution ran for too long, and was cancelled. There may or may not be a partial output present."
+ ]
+ },
+ "output": {
+ "description": "Optional. Contains stdout when code execution is successful, stderr or other description otherwise.",
+ "type": "string"
+ }
+ },
+ "description": "Result of executing the `ExecutableCode`. Only generated when using the `CodeExecution`, and always follows a `part` containing the `ExecutableCode`.",
+ "id": "CodeExecutionResult"
+ },
+ "Chunk": {
+ "description": "A `Chunk` is a subpart of a `Document` that is treated as an independent unit for the purposes of vector representation and storage. A `Corpus` can have a maximum of 1 million `Chunk`s.",
+ "type": "object",
+ "id": "Chunk",
+ "properties": {
+ "state": {
+ "enumDescriptions": [
+ "The default value. This value is used if the state is omitted.",
+ "`Chunk` is being processed (embedding and vector storage).",
+ "`Chunk` is processed and available for querying.",
+ "`Chunk` failed processing."
+ ],
+ "enum": [
+ "STATE_UNSPECIFIED",
+ "STATE_PENDING_PROCESSING",
+ "STATE_ACTIVE",
+ "STATE_FAILED"
+ ],
+ "type": "string",
+ "readOnly": true,
+ "description": "Output only. Current state of the `Chunk`."
},
"customMetadata": {
- "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.",
+ "description": "Optional. User provided custom metadata stored as key-value pairs. The maximum number of `CustomMetadata` per chunk is 20.",
"type": "array",
"items": {
"$ref": "CustomMetadata"
}
},
"createTime": {
- "type": "string",
"readOnly": true,
- "description": "Output only. The Timestamp of when the `Document` was created.",
- "format": "google-datetime"
+ "format": "google-datetime",
+ "type": "string",
+ "description": "Output only. The Timestamp of when the `Chunk` was created."
+ },
+ "data": {
+ "$ref": "ChunkData",
+ "description": "Required. The content for the `Chunk`, such as the text string. The maximum number of tokens per chunk is 2043."
},
"updateTime": {
"readOnly": true,
- "format": "google-datetime",
+ "description": "Output only. The Timestamp of when the `Chunk` was last updated.",
"type": "string",
- "description": "Output only. The Timestamp of when the `Document` was last updated."
+ "format": "google-datetime"
+ },
+ "name": {
+ "description": "Immutable. Identifier. The `Chunk` resource name. The ID (name excluding the \"corpora/*/documents/*/chunks/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`",
+ "type": "string"
+ }
+ }
+ },
+ "GenerateMessageRequest": {
+ "description": "Request to generate a message response from the model.",
+ "properties": {
+ "topK": {
+ "description": "Optional. The maximum number of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Top-k sampling considers the set of `top_k` most probable tokens.",
+ "type": "integer",
+ "format": "int32"
+ },
+ "topP": {
+ "description": "Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`.",
+ "format": "float",
+ "type": "number"
+ },
+ "temperature": {
+ "type": "number",
+ "description": "Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model.",
+ "format": "float"
+ },
+ "candidateCount": {
+ "description": "Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.",
+ "format": "int32",
+ "type": "integer"
+ },
+ "prompt": {
+ "$ref": "MessagePrompt",
+ "description": "Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion."
}
},
- "description": "A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.",
"type": "object",
- "id": "Document"
+ "id": "GenerateMessageRequest"
},
- "FunctionResponse": {
- "id": "FunctionResponse",
+ "BatchEmbedContentsRequest": {
+ "id": "BatchEmbedContentsRequest",
+ "description": "Batch request to get embeddings from the model for a list of prompts.",
"properties": {
- "name": {
- "type": "string",
- "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63."
- },
- "response": {
- "description": "Required. The function response in JSON object format.",
- "additionalProperties": {
- "type": "any",
- "description": "Properties of the object."
- },
- "type": "object"
+ "requests": {
+ "type": "array",
+ "description": "Required. Embed requests for the batch. The model in each of these requests must match the model specified `BatchEmbedContentsRequest.model`.",
+ "items": {
+ "$ref": "EmbedContentRequest"
+ }
}
},
- "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.",
"type": "object"
},
- "BatchEmbedContentsResponse": {
+ "QueryCorpusResponse": {
+ "description": "Response from `QueryCorpus` containing a list of relevant chunks.",
"properties": {
- "embeddings": {
- "readOnly": true,
+ "relevantChunks": {
+ "description": "The relevant chunks.",
"type": "array",
- "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.",
"items": {
- "$ref": "ContentEmbedding"
+ "$ref": "RelevantChunk"
}
}
},
- "id": "BatchEmbedContentsResponse",
"type": "object",
- "description": "The response to a `BatchEmbedContentsRequest`."
+ "id": "QueryCorpusResponse"
},
- "TunedModelSource": {
- "id": "TunedModelSource",
- "description": "Tuned model as a source for training a new model.",
+ "TransferOwnershipRequest": {
"properties": {
- "baseModel": {
- "description": "Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/text-bison-001`",
- "readOnly": true,
- "type": "string"
- },
- "tunedModel": {
+ "emailAddress": {
"type": "string",
- "description": "Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`"
+ "description": "Required. The email address of the user to whom the tuned model is being transferred to."
}
},
- "type": "object"
+ "id": "TransferOwnershipRequest",
+ "type": "object",
+ "description": "Request to transfer the ownership of the tuned model."
},
- "Tool": {
+ "ContentEmbedding": {
+ "type": "object",
+ "id": "ContentEmbedding",
+ "description": "A list of floats representing an embedding.",
"properties": {
- "functionDeclarations": {
+ "values": {
"type": "array",
"items": {
- "$ref": "FunctionDeclaration"
+ "type": "number",
+ "format": "float"
},
- "description": "Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling. The model or system does not execute the function. Instead the defined function may be returned as a FunctionCall with arguments to the client side for execution. The model may decide to call a subset of these functions by populating FunctionCall in the response. The next conversation turn may contain a FunctionResponse with the [content.role] \"function\" generation context for the next model turn."
+ "description": "The embedding values."
}
- },
- "id": "Tool",
+ }
+ },
+ "EmbedTextRequest": {
+ "id": "EmbedTextRequest",
"type": "object",
- "description": "Tool details that the model may use to generate response. 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."
+ "description": "Request to get a text embedding from the model.",
+ "properties": {
+ "model": {
+ "description": "Required. The model name to use with the format model=models/{model}.",
+ "type": "string"
+ },
+ "text": {
+ "type": "string",
+ "description": "Optional. The free-form input text that the model will turn into an embedding."
+ }
+ }
},
- "CountTokensResponse": {
+ "CountTextTokensResponse": {
"type": "object",
+ "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.",
"properties": {
- "totalTokens": {
- "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.",
+ "tokenCount": {
"type": "integer",
+ "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.",
"format": "int32"
}
},
- "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.",
- "id": "CountTokensResponse"
+ "id": "CountTextTokensResponse"
},
- "FileData": {
- "id": "FileData",
+ "File": {
"type": "object",
+ "id": "File",
"properties": {
- "fileUri": {
+ "updateTime": {
+ "readOnly": true,
+ "format": "google-datetime",
"type": "string",
- "description": "Required. URI."
+ "description": "Output only. The timestamp of when the `File` was last updated."
},
- "mimeType": {
+ "sizeBytes": {
"type": "string",
- "description": "Optional. The IANA standard MIME type of the source data."
- }
- },
- "description": "URI based data."
- },
- "SemanticRetrieverChunk": {
- "type": "object",
- "description": "Identifier for a `Chunk` retrieved via Semantic Retriever specified in the `GenerateAnswerRequest` using `SemanticRetrieverConfig`.",
- "id": "SemanticRetrieverChunk",
- "properties": {
- "chunk": {
"readOnly": true,
+ "format": "int64",
+ "description": "Output only. Size of the file in bytes."
+ },
+ "createTime": {
+ "description": "Output only. The timestamp of when the `File` was created.",
"type": "string",
- "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`"
+ "readOnly": true,
+ "format": "google-datetime"
},
- "source": {
+ "uri": {
"readOnly": true,
+ "description": "Output only. The uri of the `File`.",
+ "type": "string"
+ },
+ "expirationTime": {
+ "format": "google-datetime",
"type": "string",
- "description": "Output only. Name of the source matching the request's `SemanticRetrieverConfig.source`. Example: `corpora/123` or `corpora/123/documents/abc`"
- }
- }
- },
- "TuningSnapshot": {
- "description": "Record for a single tuning step.",
- "properties": {
- "meanLoss": {
- "description": "Output only. The mean loss of the training examples for this step.",
"readOnly": true,
- "type": "number",
- "format": "float"
+ "description": "Output only. The timestamp of when the `File` will be deleted. Only set if the `File` is scheduled to expire."
},
- "epoch": {
+ "state": {
"readOnly": true,
- "type": "integer",
- "format": "int32",
- "description": "Output only. The epoch this step was part of."
+ "enumDescriptions": [
+ "The default value. This value is used if the state is omitted.",
+ "File is being processed and cannot be used for inference yet.",
+ "File is processed and available for inference.",
+ "File failed processing."
+ ],
+ "enum": [
+ "STATE_UNSPECIFIED",
+ "PROCESSING",
+ "ACTIVE",
+ "FAILED"
+ ],
+ "description": "Output only. Processing state of the File.",
+ "type": "string"
},
- "computeTime": {
- "description": "Output only. The timestamp when this metric was computed.",
+ "displayName": {
+ "description": "Optional. The human-readable display name for the `File`. The display name must be no more than 512 characters in length, including spaces. Example: \"Welcome Image\"",
+ "type": "string"
+ },
+ "error": {
+ "description": "Output only. Error status if File processing failed.",
+ "$ref": "Status",
+ "readOnly": true
+ },
+ "mimeType": {
"readOnly": true,
- "format": "google-datetime",
+ "description": "Output only. MIME type of the file.",
"type": "string"
},
- "step": {
- "format": "int32",
- "type": "integer",
+ "name": {
+ "type": "string",
+ "description": "Immutable. Identifier. The `File` resource name. The ID (name excluding the \"files/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be generated. Example: `files/123-456`"
+ },
+ "videoMetadata": {
+ "readOnly": true,
+ "$ref": "VideoMetadata",
+ "description": "Output only. Metadata for a video."
+ },
+ "sha256Hash": {
+ "description": "Output only. SHA-256 hash of the uploaded bytes.",
"readOnly": true,
- "description": "Output only. The tuning step."
+ "format": "byte",
+ "type": "string"
}
},
- "id": "TuningSnapshot",
- "type": "object"
+ "description": "A file uploaded to the API."
},
- "ToolConfig": {
+ "FunctionResponse": {
+ "id": "FunctionResponse",
"type": "object",
- "id": "ToolConfig",
+ "description": "The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.",
"properties": {
- "functionCallingConfig": {
- "$ref": "FunctionCallingConfig",
- "description": "Optional. Function calling config."
+ "response": {
+ "description": "Required. The function response in JSON object format.",
+ "additionalProperties": {
+ "description": "Properties of the object.",
+ "type": "any"
+ },
+ "type": "object"
+ },
+ "name": {
+ "type": "string",
+ "description": "Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63."
}
- },
- "description": "The Tool configuration containing parameters for specifying `Tool` use in the request."
+ }
},
- "CountTextTokensRequest": {
+ "CodeExecution": {
+ "properties": {},
+ "type": "object",
+ "description": "Tool that executes code generated by the model, and automatically returns the result to the model. See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.",
+ "id": "CodeExecution"
+ },
+ "TuningExamples": {
+ "description": "A set of tuning examples. Can be training or validation data.",
+ "type": "object",
"properties": {
- "prompt": {
- "description": "Required. The free-form input text given to the model as a prompt.",
- "$ref": "TextPrompt"
+ "examples": {
+ "items": {
+ "$ref": "TuningExample"
+ },
+ "description": "Required. The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.",
+ "type": "array"
}
},
- "description": "Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.",
+ "id": "TuningExamples"
+ },
+ "Dataset": {
+ "description": "Dataset for training or validation.",
"type": "object",
- "id": "CountTextTokensRequest"
+ "properties": {
+ "examples": {
+ "$ref": "TuningExamples",
+ "description": "Optional. Inline examples."
+ }
+ },
+ "id": "Dataset"
},
- "Model": {
+ "Document": {
+ "type": "object",
+ "id": "Document",
+ "description": "A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.",
"properties": {
- "displayName": {
- "description": "The human-readable name of the model. E.g. \"Chat Bison\". The name can be up to 128 characters long and can consist of any UTF-8 characters.",
- "type": "string"
- },
- "name": {
- "type": "string",
- "description": "Required. The resource name of the `Model`. Format: `models/{model}` with a `{model}` naming convention of: * \"{base_model_id}-{version}\" Examples: * `models/chat-bison-001`"
- },
- "outputTokenLimit": {
- "format": "int32",
- "description": "Maximum number of output tokens available for this model.",
- "type": "integer"
- },
- "topP": {
- "type": "number",
- "description": "For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.",
- "format": "float"
- },
- "baseModelId": {
+ "createTime": {
"type": "string",
- "description": "Required. The name of the base model, pass this to the generation request. Examples: * `chat-bison`"
- },
- "inputTokenLimit": {
- "format": "int32",
- "description": "Maximum number of input tokens allowed for this model.",
- "type": "integer"
+ "readOnly": true,
+ "description": "Output only. The Timestamp of when the `Document` was created.",
+ "format": "google-datetime"
},
- "version": {
- "type": "string",
- "description": "Required. The version number of the model. This represents the major version"
+ "name": {
+ "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"corpora/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`",
+ "type": "string"
},
- "supportedGenerationMethods": {
+ "customMetadata": {
+ "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.",
"items": {
- "type": "string"
+ "$ref": "CustomMetadata"
},
- "type": "array",
- "description": "The model's supported generation methods. The method names are defined as Pascal case strings, such as `generateMessage` which correspond to API methods."
+ "type": "array"
},
- "topK": {
- "description": "For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter.",
- "format": "int32",
- "type": "integer"
+ "displayName": {
+ "description": "Optional. The human-readable display name for the `Document`. The display name must be no more than 512 characters in length, including spaces. Example: \"Semantic Retriever Documentation\"",
+ "type": "string"
},
- "description": {
+ "updateTime": {
"type": "string",
- "description": "A short description of the model."
- },
- "temperature": {
- "description": "Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.",
- "format": "float",
- "type": "number"
+ "readOnly": true,
+ "description": "Output only. The Timestamp of when the `Document` was last updated.",
+ "format": "google-datetime"
}
- },
- "type": "object",
- "id": "Model",
- "description": "Information about a Generative Language Model."
+ }
},
- "MetadataFilter": {
+ "ListPermissionsResponse": {
+ "type": "object",
"properties": {
- "conditions": {
+ "nextPageToken": {
+ "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.",
+ "type": "string"
+ },
+ "permissions": {
"items": {
- "$ref": "Condition"
+ "$ref": "Permission"
},
- "description": "Required. The `Condition`s for the given key that will trigger this filter. Multiple `Condition`s are joined by logical ORs.",
- "type": "array"
- },
- "key": {
- "description": "Required. The key of the metadata to filter on.",
- "type": "string"
+ "type": "array",
+ "description": "Returned permissions."
}
},
- "id": "MetadataFilter",
- "description": "User provided filter to limit retrieval based on `Chunk` or `Document` level metadata values. Example (genre = drama OR genre = action): key = \"document.custom_metadata.genre\" conditions = [{string_value = \"drama\", operation = EQUAL}, {string_value = \"action\", operation = EQUAL}]",
- "type": "object"
+ "description": "Response from `ListPermissions` containing a paginated list of permissions.",
+ "id": "ListPermissionsResponse"
},
"GroundingPassageId": {
+ "description": "Identifier for a part within a `GroundingPassage`.",
+ "id": "GroundingPassageId",
"properties": {
"passageId": {
- "type": "string",
"readOnly": true,
+ "type": "string",
"description": "Output only. ID of the passage matching the `GenerateAnswerRequest`'s `GroundingPassage.id`."
},
"partIndex": {
- "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.",
- "type": "integer",
"format": "int32",
- "readOnly": true
+ "description": "Output only. Index of the part within the `GenerateAnswerRequest`'s `GroundingPassage.content`.",
+ "readOnly": true,
+ "type": "integer"
}
},
- "description": "Identifier for a part within a `GroundingPassage`.",
- "id": "GroundingPassageId",
"type": "object"
- }
- },
- "parameters": {
- "quotaUser": {
- "type": "string",
- "location": "query",
- "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters."
- },
- "$.xgafv": {
- "type": "string",
- "enum": [
- "1",
- "2"
- ],
- "enumDescriptions": [
- "v1 error format",
- "v2 error format"
- ],
- "description": "V1 error format.",
- "location": "query"
- },
- "fields": {
- "type": "string",
- "location": "query",
- "description": "Selector specifying which fields to include in a partial response."
- },
- "upload_protocol": {
- "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
- "type": "string",
- "location": "query"
- },
- "oauth_token": {
- "type": "string",
- "description": "OAuth 2.0 token for the current user.",
- "location": "query"
- },
- "prettyPrint": {
- "location": "query",
- "default": "true",
- "type": "boolean",
- "description": "Returns response with indentations and line breaks."
- },
- "callback": {
- "description": "JSONP",
- "location": "query",
- "type": "string"
- },
- "access_token": {
- "location": "query",
- "type": "string",
- "description": "OAuth access token."
},
- "key": {
- "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
- "location": "query",
- "type": "string"
- },
- "uploadType": {
- "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
- "location": "query",
- "type": "string"
- },
- "alt": {
- "enumDescriptions": [
- "Responses with Content-Type of application/json",
- "Media download with context-dependent Content-Type",
- "Responses with Content-Type of application/x-protobuf"
- ],
- "default": "json",
- "description": "Data format for response.",
- "location": "query",
- "enum": [
- "json",
- "media",
- "proto"
- ],
- "type": "string"
- }
- },
- "servicePath": "",
- "id": "generativelanguage:v1beta",
- "revision": "20240524",
- "documentationLink": "https://developers.generativeai.google/api",
- "fullyEncodeReservedExpansion": true,
- "rootUrl": "https://generativelanguage.googleapis.com/",
- "batchPath": "batch",
- "canonicalName": "Generative Language",
- "ownerDomain": "google.com",
- "baseUrl": "https://generativelanguage.googleapis.com/",
- "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/",
- "resources": {
- "tunedModels": {
- "methods": {
- "get": {
- "id": "generativelanguage.tunedModels.get",
- "parameterOrder": [
- "name"
- ],
- "description": "Gets information about a specific TunedModel.",
- "parameters": {
- "name": {
- "required": true,
- "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`",
- "pattern": "^tunedModels/[^/]+$",
- "type": "string",
- "location": "path"
- }
- },
- "flatPath": "v1beta/tunedModels/{tunedModelsId}",
- "response": {
- "$ref": "TunedModel"
- },
- "path": "v1beta/{+name}",
- "httpMethod": "GET"
- },
- "transferOwnership": {
- "path": "v1beta/{+name}:transferOwnership",
- "flatPath": "v1beta/tunedModels/{tunedModelsId}:transferOwnership",
- "request": {
- "$ref": "TransferOwnershipRequest"
- },
- "response": {
- "$ref": "TransferOwnershipResponse"
- },
- "parameterOrder": [
- "name"
- ],
- "description": "Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.",
- "id": "generativelanguage.tunedModels.transferOwnership",
- "parameters": {
- "name": {
- "description": "Required. The resource name of the tuned model to transfer ownership. Format: `tunedModels/my-model-id`",
- "location": "path",
- "required": true,
- "type": "string",
- "pattern": "^tunedModels/[^/]+$"
- }
- },
- "httpMethod": "POST"
- },
- "create": {
- "flatPath": "v1beta/tunedModels",
- "response": {
- "$ref": "Operation"
- },
- "parameterOrder": [],
- "id": "generativelanguage.tunedModels.create",
- "request": {
- "$ref": "TunedModel"
- },
- "parameters": {
- "tunedModelId": {
- "type": "string",
- "location": "query",
- "description": "Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?."
- }
- },
- "path": "v1beta/tunedModels",
- "description": "Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222",
- "httpMethod": "POST"
- },
- "list": {
- "id": "generativelanguage.tunedModels.list",
- "description": "Lists tuned models owned by the user.",
- "response": {
- "$ref": "ListTunedModelsResponse"
- },
- "httpMethod": "GET",
- "parameters": {
- "pageToken": {
- "type": "string",
- "description": "Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.",
- "location": "query"
- },
- "pageSize": {
- "format": "int32",
- "description": "Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.",
- "type": "integer",
- "location": "query"
- },
- "filter": {
- "type": "string",
- "location": "query",
- "description": "Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: \"owner:me\" returns all tuned models to which caller has owner role \"readers:me\" returns all tuned models to which caller has reader role \"readers:everyone\" returns all tuned models that are shared with everyone"
- }
- },
- "flatPath": "v1beta/tunedModels",
- "parameterOrder": [],
- "path": "v1beta/tunedModels"
- },
- "patch": {
- "httpMethod": "PATCH",
- "response": {
- "$ref": "TunedModel"
- },
- "path": "v1beta/{+name}",
- "parameters": {
- "updateMask": {
- "description": "Required. The list of fields to update.",
- "location": "query",
- "format": "google-fieldmask",
- "type": "string"
- },
- "name": {
- "description": "Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: display_name = \"Sentence Translator\" name = \"tunedModels/sentence-translator-u3b7m\"",
- "required": true,
- "location": "path",
- "type": "string",
- "pattern": "^tunedModels/[^/]+$"
- }
- },
- "description": "Updates a tuned model.",
- "flatPath": "v1beta/tunedModels/{tunedModelsId}",
- "parameterOrder": [
- "name"
- ],
- "id": "generativelanguage.tunedModels.patch",
- "request": {
- "$ref": "TunedModel"
- }
- },
- "generateContent": {
- "httpMethod": "POST",
- "response": {
- "$ref": "GenerateContentResponse"
- },
- "request": {
- "$ref": "GenerateContentRequest"
- },
- "parameters": {
- "model": {
- "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.",
- "location": "path",
- "required": true,
- "pattern": "^tunedModels/[^/]+$",
- "type": "string"
- }
- },
- "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateContent",
- "description": "Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.",
- "parameterOrder": [
- "model"
- ],
- "path": "v1beta/{+model}:generateContent",
- "id": "generativelanguage.tunedModels.generateContent"
- },
- "delete": {
- "flatPath": "v1beta/tunedModels/{tunedModelsId}",
- "id": "generativelanguage.tunedModels.delete",
- "response": {
- "$ref": "Empty"
- },
- "description": "Deletes a tuned model.",
- "httpMethod": "DELETE",
- "path": "v1beta/{+name}",
- "parameters": {
- "name": {
- "pattern": "^tunedModels/[^/]+$",
- "type": "string",
- "description": "Required. The resource name of the model. Format: `tunedModels/my-model-id`",
- "location": "path",
- "required": true
- }
- },
- "parameterOrder": [
- "name"
- ]
+ "AttributionSourceId": {
+ "properties": {
+ "groundingPassage": {
+ "$ref": "GroundingPassageId",
+ "description": "Identifier for an inline passage."
},
- "generateText": {
- "path": "v1beta/{+model}:generateText",
- "parameters": {
- "model": {
- "type": "string",
- "location": "path",
- "pattern": "^tunedModels/[^/]+$",
- "required": true,
- "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m"
- }
- },
- "httpMethod": "POST",
- "response": {
- "$ref": "GenerateTextResponse"
- },
- "request": {
- "$ref": "GenerateTextRequest"
- },
- "id": "generativelanguage.tunedModels.generateText",
- "parameterOrder": [
- "model"
- ],
- "description": "Generates a response from the model given an input message.",
- "flatPath": "v1beta/tunedModels/{tunedModelsId}:generateText"
+ "semanticRetrieverChunk": {
+ "description": "Identifier for a `Chunk` fetched via Semantic Retriever.",
+ "$ref": "SemanticRetrieverChunk"
}
},
- "resources": {
- "permissions": {
- "methods": {
- "patch": {
- "description": "Updates the permission.",
- "httpMethod": "PATCH",
- "id": "generativelanguage.tunedModels.permissions.patch",
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "updateMask": {
- "format": "google-fieldmask",
- "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)",
- "location": "query",
- "type": "string"
- },
- "name": {
- "location": "path",
- "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.",
- "required": true,
- "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
- "type": "string"
- }
- },
- "request": {
- "$ref": "Permission"
- },
- "response": {
- "$ref": "Permission"
- },
- "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}",
- "path": "v1beta/{+name}"
- },
- "delete": {
- "parameterOrder": [
- "name"
- ],
- "description": "Deletes the permission.",
- "response": {
- "$ref": "Empty"
- },
- "parameters": {
- "name": {
- "required": true,
- "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
- "type": "string",
- "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
- "location": "path"
- }
- },
- "path": "v1beta/{+name}",
- "id": "generativelanguage.tunedModels.permissions.delete",
- "httpMethod": "DELETE",
- "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}"
- },
- "list": {
- "description": "Lists permissions for the specific resource.",
- "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions",
- "parameters": {
- "pageSize": {
- "type": "integer",
- "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.",
- "format": "int32",
- "location": "query"
- },
- "pageToken": {
- "type": "string",
- "location": "query",
- "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token."
- },
- "parent": {
- "pattern": "^tunedModels/[^/]+$",
- "required": true,
- "type": "string",
- "location": "path",
- "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`"
- }
- },
- "parameterOrder": [
- "parent"
- ],
- "response": {
- "$ref": "ListPermissionsResponse"
- },
- "path": "v1beta/{+parent}/permissions",
- "id": "generativelanguage.tunedModels.permissions.list",
- "httpMethod": "GET"
- },
- "get": {
- "response": {
- "$ref": "Permission"
- },
- "parameters": {
- "name": {
- "pattern": "^tunedModels/[^/]+/permissions/[^/]+$",
- "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
- "type": "string",
- "required": true,
- "location": "path"
- }
- },
- "path": "v1beta/{+name}",
- "httpMethod": "GET",
- "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions/{permissionsId}",
- "parameterOrder": [
- "name"
- ],
- "id": "generativelanguage.tunedModels.permissions.get",
- "description": "Gets information about a specific Permission."
- },
- "create": {
- "request": {
- "$ref": "Permission"
- },
- "response": {
- "$ref": "Permission"
- },
- "flatPath": "v1beta/tunedModels/{tunedModelsId}/permissions",
- "description": "Create a permission to a specific resource.",
- "id": "generativelanguage.tunedModels.permissions.create",
- "path": "v1beta/{+parent}/permissions",
- "httpMethod": "POST",
- "parameters": {
- "parent": {
- "required": true,
- "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
- "type": "string",
- "location": "path",
- "pattern": "^tunedModels/[^/]+$"
- }
- },
- "parameterOrder": [
- "parent"
- ]
- }
- }
- }
- }
+ "description": "Identifier for the source contributing to this attribution.",
+ "id": "AttributionSourceId",
+ "type": "object"
},
- "corpora": {
- "resources": {
- "documents": {
- "resources": {
- "chunks": {
- "methods": {
- "batchCreate": {
- "id": "generativelanguage.corpora.documents.chunks.batchCreate",
- "request": {
- "$ref": "BatchCreateChunksRequest"
- },
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchCreate",
- "httpMethod": "POST",
- "response": {
- "$ref": "BatchCreateChunksResponse"
- },
- "parameters": {
- "parent": {
- "required": true,
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "location": "path",
- "type": "string",
- "description": "Optional. The name of the `Document` where this batch of `Chunk`s will be created. The parent field in every `CreateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`"
- }
- },
- "path": "v1beta/{+parent}/chunks:batchCreate",
- "description": "Batch create `Chunk`s.",
- "parameterOrder": [
- "parent"
- ]
- },
- "delete": {
- "description": "Deletes a `Chunk`.",
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}",
- "httpMethod": "DELETE",
- "id": "generativelanguage.corpora.documents.chunks.delete",
- "response": {
- "$ref": "Empty"
- },
- "parameterOrder": [
- "name"
- ],
- "parameters": {
- "name": {
- "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$",
- "required": true,
- "type": "string",
- "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`",
- "location": "path"
- }
- },
- "path": "v1beta/{+name}"
- },
- "patch": {
- "parameterOrder": [
- "name"
- ],
- "description": "Updates a `Chunk`.",
- "parameters": {
- "name": {
- "required": true,
- "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$",
- "description": "Immutable. Identifier. The `Chunk` resource name. The ID (name excluding the \"corpora/*/documents/*/chunks/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a random 12-character unique ID will be generated. Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c`",
- "location": "path",
- "type": "string"
- },
- "updateMask": {
- "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.",
- "format": "google-fieldmask",
- "type": "string",
- "location": "query"
- }
- },
- "response": {
- "$ref": "Chunk"
- },
- "id": "generativelanguage.corpora.documents.chunks.patch",
- "path": "v1beta/{+name}",
- "httpMethod": "PATCH",
- "request": {
- "$ref": "Chunk"
- },
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}"
- },
- "create": {
- "description": "Creates a `Chunk`.",
- "httpMethod": "POST",
- "path": "v1beta/{+parent}/chunks",
- "parameterOrder": [
- "parent"
- ],
- "response": {
- "$ref": "Chunk"
- },
- "parameters": {
- "parent": {
- "required": true,
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "location": "path",
- "type": "string",
- "description": "Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`"
- }
- },
- "id": "generativelanguage.corpora.documents.chunks.create",
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks",
- "request": {
- "$ref": "Chunk"
- }
- },
- "list": {
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks",
- "description": "Lists all `Chunk`s in a `Document`.",
- "parameters": {
- "pageToken": {
- "location": "query",
- "type": "string",
- "description": "Optional. A page token, received from a previous `ListChunks` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListChunks` must match the call that provided the page token."
- },
- "parent": {
- "location": "path",
- "description": "Required. The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
- "type": "string",
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "required": true
- },
- "pageSize": {
- "type": "integer",
- "format": "int32",
- "location": "query",
- "description": "Optional. The maximum number of `Chunk`s to return (per page). The service may return fewer `Chunk`s. If unspecified, at most 10 `Chunk`s will be returned. The maximum size limit is 100 `Chunk`s per page."
- }
- },
- "httpMethod": "GET",
- "path": "v1beta/{+parent}/chunks",
- "id": "generativelanguage.corpora.documents.chunks.list",
- "parameterOrder": [
- "parent"
- ],
- "response": {
- "$ref": "ListChunksResponse"
- }
- },
- "batchUpdate": {
- "id": "generativelanguage.corpora.documents.chunks.batchUpdate",
- "path": "v1beta/{+parent}/chunks:batchUpdate",
- "description": "Batch update `Chunk`s.",
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchUpdate",
- "request": {
- "$ref": "BatchUpdateChunksRequest"
- },
- "parameterOrder": [
- "parent"
- ],
- "response": {
- "$ref": "BatchUpdateChunksResponse"
- },
- "httpMethod": "POST",
- "parameters": {
- "parent": {
- "description": "Optional. The name of the `Document` containing the `Chunk`s to update. The parent field in every `UpdateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "location": "path",
- "required": true,
- "type": "string"
- }
- }
- },
- "get": {
- "description": "Gets information about a specific `Chunk`.",
- "parameters": {
- "name": {
- "pattern": "^corpora/[^/]+/documents/[^/]+/chunks/[^/]+$",
- "required": true,
- "type": "string",
- "location": "path",
- "description": "Required. The name of the `Chunk` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`"
- }
- },
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks/{chunksId}",
- "parameterOrder": [
- "name"
- ],
- "response": {
- "$ref": "Chunk"
- },
- "id": "generativelanguage.corpora.documents.chunks.get",
- "httpMethod": "GET",
- "path": "v1beta/{+name}"
- },
- "batchDelete": {
- "parameterOrder": [
- "parent"
- ],
- "description": "Batch delete `Chunk`s.",
- "httpMethod": "POST",
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}/chunks:batchDelete",
- "parameters": {
- "parent": {
- "location": "path",
- "description": "Optional. The name of the `Document` containing the `Chunk`s to delete. The parent field in every `DeleteChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
- "required": true,
- "type": "string",
- "pattern": "^corpora/[^/]+/documents/[^/]+$"
- }
- },
- "response": {
- "$ref": "Empty"
- },
- "id": "generativelanguage.corpora.documents.chunks.batchDelete",
- "request": {
- "$ref": "BatchDeleteChunksRequest"
- },
- "path": "v1beta/{+parent}/chunks:batchDelete"
- }
- }
- }
- },
- "methods": {
- "delete": {
- "description": "Deletes a `Document`.",
- "path": "v1beta/{+name}",
- "response": {
- "$ref": "Empty"
- },
- "id": "generativelanguage.corpora.documents.delete",
- "parameters": {
- "force": {
- "location": "query",
- "description": "Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.",
- "type": "boolean"
- },
- "name": {
- "description": "Required. The resource name of the `Document` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
- "location": "path",
- "required": true,
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "type": "string"
- }
- },
- "parameterOrder": [
- "name"
- ],
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}",
- "httpMethod": "DELETE"
- },
- "create": {
- "flatPath": "v1beta/corpora/{corporaId}/documents",
- "parameters": {
- "parent": {
- "pattern": "^corpora/[^/]+$",
- "type": "string",
- "location": "path",
- "description": "Required. The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`",
- "required": true
- }
- },
- "response": {
- "$ref": "Document"
- },
- "id": "generativelanguage.corpora.documents.create",
- "path": "v1beta/{+parent}/documents",
- "parameterOrder": [
- "parent"
- ],
- "description": "Creates an empty `Document`.",
- "request": {
- "$ref": "Document"
- },
- "httpMethod": "POST"
- },
- "query": {
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}:query",
- "response": {
- "$ref": "QueryDocumentResponse"
- },
- "parameterOrder": [
- "name"
- ],
- "request": {
- "$ref": "QueryDocumentRequest"
- },
- "path": "v1beta/{+name}:query",
- "description": "Performs semantic search over a `Document`.",
- "id": "generativelanguage.corpora.documents.query",
- "httpMethod": "POST",
- "parameters": {
- "name": {
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "type": "string",
- "description": "Required. The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
- "required": true,
- "location": "path"
- }
- }
- },
- "patch": {
- "description": "Updates a `Document`.",
- "response": {
- "$ref": "Document"
- },
- "httpMethod": "PATCH",
- "path": "v1beta/{+name}",
- "parameters": {
- "name": {
- "required": true,
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "description": "Immutable. Identifier. The `Document` resource name. The ID (name excluding the \"corpora/*/documents/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c`",
- "type": "string",
- "location": "path"
- },
- "updateMask": {
- "type": "string",
- "location": "query",
- "format": "google-fieldmask",
- "description": "Required. The list of fields to update. Currently, this only supports updating `display_name` and `custom_metadata`."
- }
- },
- "parameterOrder": [
- "name"
- ],
- "id": "generativelanguage.corpora.documents.patch",
- "request": {
- "$ref": "Document"
- },
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}"
- },
- "list": {
- "id": "generativelanguage.corpora.documents.list",
- "parameters": {
- "pageSize": {
- "location": "query",
- "type": "integer",
- "format": "int32",
- "description": "Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s. If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page."
- },
- "parent": {
- "type": "string",
- "location": "path",
- "required": true,
- "pattern": "^corpora/[^/]+$",
- "description": "Required. The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`"
- },
- "pageToken": {
- "type": "string",
- "description": "Optional. A page token, received from a previous `ListDocuments` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.",
- "location": "query"
- }
- },
- "description": "Lists all `Document`s in a `Corpus`.",
- "response": {
- "$ref": "ListDocumentsResponse"
- },
- "path": "v1beta/{+parent}/documents",
- "httpMethod": "GET",
- "parameterOrder": [
- "parent"
- ],
- "flatPath": "v1beta/corpora/{corporaId}/documents"
- },
- "get": {
- "parameterOrder": [
- "name"
- ],
- "response": {
- "$ref": "Document"
- },
- "description": "Gets information about a specific `Document`.",
- "parameters": {
- "name": {
- "pattern": "^corpora/[^/]+/documents/[^/]+$",
- "type": "string",
- "required": true,
- "description": "Required. The name of the `Document` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc`",
- "location": "path"
- }
- },
- "id": "generativelanguage.corpora.documents.get",
- "flatPath": "v1beta/corpora/{corporaId}/documents/{documentsId}",
- "path": "v1beta/{+name}",
- "httpMethod": "GET"
- }
- }
- },
- "permissions": {
- "methods": {
- "list": {
- "httpMethod": "GET",
- "path": "v1beta/{+parent}/permissions",
- "flatPath": "v1beta/corpora/{corporaId}/permissions",
- "response": {
- "$ref": "ListPermissionsResponse"
- },
- "id": "generativelanguage.corpora.permissions.list",
- "parameterOrder": [
- "parent"
- ],
- "description": "Lists permissions for the specific resource.",
- "parameters": {
- "pageToken": {
- "location": "query",
- "description": "Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.",
- "type": "string"
- },
- "pageSize": {
- "description": "Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.",
- "format": "int32",
- "location": "query",
- "type": "integer"
- },
- "parent": {
- "description": "Required. The parent resource of the permissions. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
- "required": true,
- "location": "path",
- "pattern": "^corpora/[^/]+$",
- "type": "string"
- }
- }
- },
- "delete": {
- "path": "v1beta/{+name}",
- "parameterOrder": [
- "name"
- ],
- "httpMethod": "DELETE",
- "description": "Deletes the permission.",
- "response": {
- "$ref": "Empty"
- },
- "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}",
- "id": "generativelanguage.corpora.permissions.delete",
- "parameters": {
- "name": {
- "type": "string",
- "location": "path",
- "required": true,
- "pattern": "^corpora/[^/]+/permissions/[^/]+$",
- "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`"
- }
- }
- },
- "get": {
- "response": {
- "$ref": "Permission"
- },
- "id": "generativelanguage.corpora.permissions.get",
- "parameters": {
- "name": {
- "type": "string",
- "description": "Required. The resource name of the permission. Formats: `tunedModels/{tuned_model}/permissions/{permission}` `corpora/{corpus}/permissions/{permission}`",
- "required": true,
- "location": "path",
- "pattern": "^corpora/[^/]+/permissions/[^/]+$"
- }
- },
- "httpMethod": "GET",
- "description": "Gets information about a specific Permission.",
- "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}",
- "parameterOrder": [
- "name"
- ],
- "path": "v1beta/{+name}"
- },
- "patch": {
- "request": {
- "$ref": "Permission"
- },
- "parameterOrder": [
- "name"
- ],
- "id": "generativelanguage.corpora.permissions.patch",
- "flatPath": "v1beta/corpora/{corporaId}/permissions/{permissionsId}",
- "path": "v1beta/{+name}",
- "description": "Updates the permission.",
- "httpMethod": "PATCH",
- "response": {
- "$ref": "Permission"
- },
- "parameters": {
- "name": {
- "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.",
- "type": "string",
- "pattern": "^corpora/[^/]+/permissions/[^/]+$",
- "location": "path",
- "required": true
- },
- "updateMask": {
- "type": "string",
- "format": "google-fieldmask",
- "location": "query",
- "description": "Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)"
- }
- }
- },
- "create": {
- "httpMethod": "POST",
- "path": "v1beta/{+parent}/permissions",
- "flatPath": "v1beta/corpora/{corporaId}/permissions",
- "parameters": {
- "parent": {
- "pattern": "^corpora/[^/]+$",
- "type": "string",
- "description": "Required. The parent resource of the `Permission`. Formats: `tunedModels/{tuned_model}` `corpora/{corpus}`",
- "required": true,
- "location": "path"
- }
- },
- "id": "generativelanguage.corpora.permissions.create",
- "request": {
- "$ref": "Permission"
- },
- "response": {
- "$ref": "Permission"
- },
- "description": "Create a permission to a specific resource.",
- "parameterOrder": [
- "parent"
- ]
- }
- }
+ "DeleteChunkRequest": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`"
}
},
- "methods": {
- "create": {
- "parameterOrder": [],
- "description": "Creates an empty `Corpus`.",
- "request": {
- "$ref": "Corpus"
- },
- "httpMethod": "POST",
- "response": {
- "$ref": "Corpus"
- },
- "id": "generativelanguage.corpora.create",
- "flatPath": "v1beta/corpora",
- "path": "v1beta/corpora",
- "parameters": {}
- },
- "query": {
- "parameterOrder": [
- "name"
- ],
- "request": {
- "$ref": "QueryCorpusRequest"
- },
- "parameters": {
- "name": {
- "location": "path",
- "pattern": "^corpora/[^/]+$",
- "required": true,
- "type": "string",
- "description": "Required. The name of the `Corpus` to query. Example: `corpora/my-corpus-123`"
- }
- },
- "httpMethod": "POST",
- "response": {
- "$ref": "QueryCorpusResponse"
- },
- "flatPath": "v1beta/corpora/{corporaId}:query",
- "id": "generativelanguage.corpora.query",
- "description": "Performs semantic search over a `Corpus`.",
- "path": "v1beta/{+name}:query"
- },
- "get": {
- "flatPath": "v1beta/corpora/{corporaId}",
- "description": "Gets information about a specific `Corpus`.",
- "parameters": {
- "name": {
- "pattern": "^corpora/[^/]+$",
- "location": "path",
- "description": "Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`",
- "type": "string",
- "required": true
- }
- },
- "response": {
- "$ref": "Corpus"
- },
- "id": "generativelanguage.corpora.get",
- "path": "v1beta/{+name}",
- "parameterOrder": [
- "name"
- ],
- "httpMethod": "GET"
+ "id": "DeleteChunkRequest",
+ "description": "Request to delete a `Chunk`."
+ },
+ "Permission": {
+ "id": "Permission",
+ "properties": {
+ "name": {
+ "type": "string",
+ "readOnly": true,
+ "description": "Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only."
},
- "delete": {
- "description": "Deletes a `Corpus`.",
- "flatPath": "v1beta/corpora/{corporaId}",
- "id": "generativelanguage.corpora.delete",
- "parameterOrder": [
- "name"
+ "role": {
+ "enumDescriptions": [
+ "The default value. This value is unused.",
+ "Owner can use, update, share and delete the resource.",
+ "Writer can use, update and share the resource.",
+ "Reader can use the resource."
],
- "parameters": {
- "force": {
- "location": "query",
- "description": "Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted. If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.",
- "type": "boolean"
- },
- "name": {
- "required": true,
- "type": "string",
- "pattern": "^corpora/[^/]+$",
- "location": "path",
- "description": "Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`"
- }
- },
- "response": {
- "$ref": "Empty"
- },
- "httpMethod": "DELETE",
- "path": "v1beta/{+name}"
- },
- "patch": {
- "id": "generativelanguage.corpora.patch",
- "parameterOrder": [
- "name"
+ "description": "Required. The role granted by this permission.",
+ "enum": [
+ "ROLE_UNSPECIFIED",
+ "OWNER",
+ "WRITER",
+ "READER"
],
- "description": "Updates a `Corpus`.",
- "flatPath": "v1beta/corpora/{corporaId}",
- "parameters": {
- "updateMask": {
- "format": "google-fieldmask",
- "type": "string",
- "location": "query",
- "description": "Required. The list of fields to update. Currently, this only supports updating `display_name`."
- },
- "name": {
- "location": "path",
- "required": true,
- "type": "string",
- "pattern": "^corpora/[^/]+$",
- "description": "Immutable. Identifier. The `Corpus` resource name. The ID (name excluding the \"corpora/\" prefix) can contain up to 40 characters that are lowercase alphanumeric or dashes (-). The ID cannot start or end with a dash. If the name is empty on create, a unique name will be derived from `display_name` along with a 12 character random suffix. Example: `corpora/my-awesome-corpora-123a456b789c`"
- }
- },
- "response": {
- "$ref": "Corpus"
- },
- "httpMethod": "PATCH",
- "path": "v1beta/{+name}",
- "request": {
- "$ref": "Corpus"
- }
+ "type": "string"
},
- "list": {
- "id": "generativelanguage.corpora.list",
- "path": "v1beta/corpora",
- "flatPath": "v1beta/corpora",
- "description": "Lists all `Corpora` owned by the user.",
- "parameterOrder": [],
- "httpMethod": "GET",
- "response": {
- "$ref": "ListCorporaResponse"
- },
- "parameters": {
- "pageSize": {
- "type": "integer",
- "format": "int32",
- "description": "Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`. If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.",
- "location": "query"
- },
- "pageToken": {
- "location": "query",
- "type": "string",
- "description": "Optional. A page token, received from a previous `ListCorpora` call. Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token."
- }
- }
- }
- }
- },
- "media": {
- "methods": {
- "upload": {
- "mediaUpload": {
- "maxSize": "2147483648",
- "accept": [
- "*/*"
- ],
- "protocols": {
- "resumable": {
- "path": "/resumable/upload/v1beta/files",
- "multipart": true
- },
- "simple": {
- "path": "/upload/v1beta/files",
- "multipart": true
- }
- }
- },
- "response": {
- "$ref": "CreateFileResponse"
- },
- "flatPath": "v1beta/files",
- "id": "generativelanguage.media.upload",
- "description": "Creates a `File`.",
- "request": {
- "$ref": "CreateFileRequest"
- },
- "httpMethod": "POST",
- "supportsMediaUpload": true,
- "path": "v1beta/files",
- "parameters": {},
- "parameterOrder": []
- }
- }
- },
- "files": {
- "methods": {
- "list": {
- "flatPath": "v1beta/files",
- "parameterOrder": [],
- "httpMethod": "GET",
- "id": "generativelanguage.files.list",
- "description": "Lists the metadata for `File`s owned by the requesting project.",
- "path": "v1beta/files",
- "parameters": {
- "pageSize": {
- "format": "int32",
- "type": "integer",
- "location": "query",
- "description": "Optional. Maximum number of `File`s to return per page. If unspecified, defaults to 10. Maximum `page_size` is 100."
- },
- "pageToken": {
- "description": "Optional. A page token from a previous `ListFiles` call.",
- "type": "string",
- "location": "query"
- }
- },
- "response": {
- "$ref": "ListFilesResponse"
- }
+ "emailAddress": {
+ "type": "string",
+ "description": "Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE."
},
- "get": {
- "parameterOrder": [
- "name"
+ "granteeType": {
+ "type": "string",
+ "enum": [
+ "GRANTEE_TYPE_UNSPECIFIED",
+ "USER",
+ "GROUP",
+ "EVERYONE"
],
- "path": "v1beta/{+name}",
- "description": "Gets the metadata for the given `File`.",
- "id": "generativelanguage.files.get",
- "response": {
- "$ref": "File"
- },
- "parameters": {
- "name": {
- "required": true,
- "pattern": "^files/[^/]+$",
- "location": "path",
- "description": "Required. The name of the `File` to get. Example: `files/abc-123`",
- "type": "string"
- }
- },
- "flatPath": "v1beta/files/{filesId}",
- "httpMethod": "GET"
- },
- "delete": {
- "httpMethod": "DELETE",
- "parameterOrder": [
- "name"
+ "enumDescriptions": [
+ "The default value. This value is unused.",
+ "Represents a user. When set, you must provide email_address for the user.",
+ "Represents a group. When set, you must provide email_address for the group.",
+ "Represents access to everyone. No extra information is required."
],
- "response": {
- "$ref": "Empty"
- },
- "description": "Deletes the `File`.",
- "id": "generativelanguage.files.delete",
- "flatPath": "v1beta/files/{filesId}",
- "parameters": {
- "name": {
- "description": "Required. The name of the `File` to delete. Example: `files/abc-123`",
- "location": "path",
- "required": true,
- "pattern": "^files/[^/]+$",
- "type": "string"
- }
- },
- "path": "v1beta/{+name}"
+ "description": "Optional. Immutable. The type of the grantee."
}
- }
+ },
+ "description": "Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, corpus). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model, corpus) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete",
+ "type": "object"
},
- "models": {
- "methods": {
- "generateMessage": {
- "description": "Generates a response from the model given an input `MessagePrompt`.",
- "request": {
- "$ref": "GenerateMessageRequest"
- },
- "parameterOrder": [
- "model"
- ],
- "path": "v1beta/{+model}:generateMessage",
- "response": {
- "$ref": "GenerateMessageResponse"
- },
- "httpMethod": "POST",
- "parameters": {
- "model": {
- "type": "string",
- "pattern": "^models/[^/]+$",
- "required": true,
- "description": "Required. The name of the model to use. Format: `name=models/{model}`.",
- "location": "path"
- }
- },
- "flatPath": "v1beta/models/{modelsId}:generateMessage",
- "id": "generativelanguage.models.generateMessage"
- },
- "generateContent": {
- "id": "generativelanguage.models.generateContent",
- "path": "v1beta/{+model}:generateContent",
- "request": {
- "$ref": "GenerateContentRequest"
- },
- "flatPath": "v1beta/models/{modelsId}:generateContent",
- "description": "Generates a response from the model given an input `GenerateContentRequest`. Input capabilities differ between models, including tuned models. See the [model guide](https://ai.google.dev/models/gemini) and [tuning guide](https://ai.google.dev/docs/model_tuning_guidance) for details.",
- "parameterOrder": [
- "model"
- ],
- "response": {
- "$ref": "GenerateContentResponse"
- },
- "httpMethod": "POST",
- "parameters": {
- "model": {
- "pattern": "^models/[^/]+$",
- "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.",
- "type": "string",
- "location": "path",
- "required": true
- }
- }
- },
- "batchEmbedText": {
- "httpMethod": "POST",
- "description": "Generates multiple embeddings from the model given input text in a synchronous call.",
- "response": {
- "$ref": "BatchEmbedTextResponse"
- },
- "flatPath": "v1beta/models/{modelsId}:batchEmbedText",
- "parameterOrder": [
- "model"
- ],
- "request": {
- "$ref": "BatchEmbedTextRequest"
- },
- "path": "v1beta/{+model}:batchEmbedText",
- "id": "generativelanguage.models.batchEmbedText",
- "parameters": {
- "model": {
- "type": "string",
- "location": "path",
- "pattern": "^models/[^/]+$",
- "description": "Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001",
- "required": true
- }
- }
- },
- "get": {
- "description": "Gets information about a specific Model.",
- "parameterOrder": [
- "name"
- ],
- "path": "v1beta/{+name}",
- "flatPath": "v1beta/models/{modelsId}",
- "id": "generativelanguage.models.get",
- "response": {
- "$ref": "Model"
- },
- "httpMethod": "GET",
- "parameters": {
- "name": {
- "description": "Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
- "required": true,
- "pattern": "^models/[^/]+$",
- "type": "string",
- "location": "path"
- }
- }
- },
- "embedContent": {
- "request": {
- "$ref": "EmbedContentRequest"
- },
- "description": "Generates an embedding from the model given an input `Content`.",
- "response": {
- "$ref": "EmbedContentResponse"
- },
- "httpMethod": "POST",
- "parameterOrder": [
- "model"
- ],
- "id": "generativelanguage.models.embedContent",
- "flatPath": "v1beta/models/{modelsId}:embedContent",
- "parameters": {
- "model": {
- "pattern": "^models/[^/]+$",
- "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
- "location": "path",
- "type": "string",
- "required": true
- }
- },
- "path": "v1beta/{+model}:embedContent"
- },
- "streamGenerateContent": {
- "description": "Generates a streamed response from the model given an input `GenerateContentRequest`.",
- "parameters": {
- "model": {
- "pattern": "^models/[^/]+$",
- "description": "Required. The name of the `Model` to use for generating the completion. Format: `name=models/{model}`.",
- "type": "string",
- "required": true,
- "location": "path"
- }
- },
- "httpMethod": "POST",
- "id": "generativelanguage.models.streamGenerateContent",
- "response": {
- "$ref": "GenerateContentResponse"
- },
- "path": "v1beta/{+model}:streamGenerateContent",
- "request": {
- "$ref": "GenerateContentRequest"
- },
- "parameterOrder": [
- "model"
- ],
- "flatPath": "v1beta/models/{modelsId}:streamGenerateContent"
- },
- "embedText": {
- "response": {
- "$ref": "EmbedTextResponse"
- },
- "httpMethod": "POST",
- "parameters": {
- "model": {
- "type": "string",
- "required": true,
- "pattern": "^models/[^/]+$",
- "description": "Required. The model name to use with the format model=models/{model}.",
- "location": "path"
- }
- },
- "parameterOrder": [
- "model"
- ],
- "flatPath": "v1beta/models/{modelsId}:embedText",
- "request": {
- "$ref": "EmbedTextRequest"
- },
- "description": "Generates an embedding from the model given an input message.",
- "path": "v1beta/{+model}:embedText",
- "id": "generativelanguage.models.embedText"
- },
- "list": {
- "parameterOrder": [],
- "id": "generativelanguage.models.list",
- "flatPath": "v1beta/models",
- "response": {
- "$ref": "ListModelsResponse"
- },
- "httpMethod": "GET",
- "description": "Lists models available through the API.",
- "parameters": {
- "pageSize": {
- "location": "query",
- "format": "int32",
- "description": "The maximum number of `Models` to return (per page). The service may return fewer models. If unspecified, at most 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.",
- "type": "integer"
- },
- "pageToken": {
- "type": "string",
- "description": "A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.",
- "location": "query"
- }
- },
- "path": "v1beta/models"
- },
- "generateText": {
- "flatPath": "v1beta/models/{modelsId}:generateText",
- "request": {
- "$ref": "GenerateTextRequest"
- },
- "description": "Generates a response from the model given an input message.",
- "parameters": {
- "model": {
- "description": "Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m",
- "location": "path",
- "type": "string",
- "pattern": "^models/[^/]+$",
- "required": true
- }
- },
- "httpMethod": "POST",
- "response": {
- "$ref": "GenerateTextResponse"
- },
- "path": "v1beta/{+model}:generateText",
- "parameterOrder": [
- "model"
- ],
- "id": "generativelanguage.models.generateText"
- },
- "batchEmbedContents": {
- "id": "generativelanguage.models.batchEmbedContents",
- "parameterOrder": [
- "model"
- ],
- "path": "v1beta/{+model}:batchEmbedContents",
- "httpMethod": "POST",
- "response": {
- "$ref": "BatchEmbedContentsResponse"
- },
- "description": "Generates multiple embeddings from the model given input text in a synchronous call.",
- "flatPath": "v1beta/models/{modelsId}:batchEmbedContents",
- "parameters": {
- "model": {
- "type": "string",
- "location": "path",
- "pattern": "^models/[^/]+$",
- "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
- "required": true
- }
- },
- "request": {
- "$ref": "BatchEmbedContentsRequest"
+ "GenerateTextResponse": {
+ "description": "The response from the model, including candidate completions.",
+ "id": "GenerateTextResponse",
+ "type": "object",
+ "properties": {
+ "safetyFeedback": {
+ "description": "Returns any safety feedback related to content filtering.",
+ "type": "array",
+ "items": {
+ "$ref": "SafetyFeedback"
}
},
- "countTokens": {
- "description": "Runs a model's tokenizer on input content and returns the token count.",
- "httpMethod": "POST",
- "request": {
- "$ref": "CountTokensRequest"
- },
- "id": "generativelanguage.models.countTokens",
- "parameterOrder": [
- "model"
- ],
- "response": {
- "$ref": "CountTokensResponse"
- },
- "flatPath": "v1beta/models/{modelsId}:countTokens",
- "parameters": {
- "model": {
- "location": "path",
- "type": "string",
- "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
- "pattern": "^models/[^/]+$",
- "required": true
- }
- },
- "path": "v1beta/{+model}:countTokens"
- },
- "countMessageTokens": {
- "id": "generativelanguage.models.countMessageTokens",
- "httpMethod": "POST",
- "parameterOrder": [
- "model"
- ],
- "request": {
- "$ref": "CountMessageTokensRequest"
- },
- "description": "Runs a model's tokenizer on a string and returns the token count.",
- "path": "v1beta/{+model}:countMessageTokens",
- "response": {
- "$ref": "CountMessageTokensResponse"
- },
- "parameters": {
- "model": {
- "location": "path",
- "type": "string",
- "pattern": "^models/[^/]+$",
- "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
- "required": true
- }
- },
- "flatPath": "v1beta/models/{modelsId}:countMessageTokens"
- },
- "countTextTokens": {
- "flatPath": "v1beta/models/{modelsId}:countTextTokens",
- "description": "Runs a model's tokenizer on a text and returns the token count.",
- "request": {
- "$ref": "CountTextTokensRequest"
- },
- "parameters": {
- "model": {
- "type": "string",
- "pattern": "^models/[^/]+$",
- "required": true,
- "description": "Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`",
- "location": "path"
- }
- },
- "parameterOrder": [
- "model"
- ],
- "path": "v1beta/{+model}:countTextTokens",
- "httpMethod": "POST",
- "response": {
- "$ref": "CountTextTokensResponse"
+ "candidates": {
+ "items": {
+ "$ref": "TextCompletion"
},
- "id": "generativelanguage.models.countTextTokens"
+ "description": "Candidate responses from the model.",
+ "type": "array"
},
- "generateAnswer": {
- "response": {
- "$ref": "GenerateAnswerResponse"
- },
- "id": "generativelanguage.models.generateAnswer",
- "request": {
- "$ref": "GenerateAnswerRequest"
+ "filters": {
+ "type": "array",
+ "items": {
+ "$ref": "ContentFilter"
},
- "parameterOrder": [
- "model"
- ],
- "description": "Generates a grounded answer from the model given an input `GenerateAnswerRequest`.",
- "httpMethod": "POST",
- "flatPath": "v1beta/models/{modelsId}:generateAnswer",
- "path": "v1beta/{+model}:generateAnswer",
- "parameters": {
- "model": {
- "location": "path",
- "pattern": "^models/[^/]+$",
- "type": "string",
- "description": "Required. The name of the `Model` to use for generating the grounded response. Format: `model=models/{model}`.",
- "required": true
- }
- }
+ "description": "A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API)."
}
}
}
},
- "basePath": ""
+ "basePath": "",
+ "batchPath": "batch",
+ "version_module": true,
+ "protocol": "rest",
+ "icons": {
+ "x32": "http://www.google.com/images/icons/product/search-32.gif",
+ "x16": "http://www.google.com/images/icons/product/search-16.gif"
+ },
+ "canonicalName": "Generative Language",
+ "baseUrl": "https://generativelanguage.googleapis.com/",
+ "description": "The Gemini API allows developers to build generative AI applications using Gemini models. Gemini is our most capable model, built from the ground up to be multimodal. It can generalize and seamlessly understand, operate across, and combine different types of information including language, images, audio, video, and code. You can use the Gemini API for use cases like reasoning across text and images, content generation, dialogue agents, summarization and classification systems, and more.",
+ "version": "v1beta",
+ "mtlsRootUrl": "https://generativelanguage.mtls.googleapis.com/",
+ "id": "generativelanguage:v1beta",
+ "ownerName": "Google"
}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go
index 46501dd38..1163d73f0 100644
--- a/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go
@@ -123,6 +123,7 @@ func New(client *http.Client) (*Service, error) {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
+ s.CachedContents = NewCachedContentsService(s)
s.Corpora = NewCorporaService(s)
s.Files = NewFilesService(s)
s.Media = NewMediaService(s)
@@ -136,6 +137,8 @@ type Service struct {
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
+ CachedContents *CachedContentsService
+
Corpora *CorporaService
Files *FilesService
@@ -154,6 +157,15 @@ func (s *Service) userAgent() string {
return googleapi.UserAgent + " " + s.UserAgent
}
+func NewCachedContentsService(s *Service) *CachedContentsService {
+ rs := &CachedContentsService{s: s}
+ return rs
+}
+
+type CachedContentsService struct {
+ s *Service
+}
+
func NewCorporaService(s *Service) *CorporaService {
rs := &CorporaService{s: s}
rs.Documents = NewCorporaDocumentsService(s)
@@ -268,9 +280,9 @@ type AttributionSourceId struct {
NullFields []string `json:"-"`
}
-func (s *AttributionSourceId) MarshalJSON() ([]byte, error) {
+func (s AttributionSourceId) MarshalJSON() ([]byte, error) {
type NoMethod AttributionSourceId
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchCreateChunksRequest: Request to batch create `Chunk`s.
@@ -291,9 +303,9 @@ type BatchCreateChunksRequest struct {
NullFields []string `json:"-"`
}
-func (s *BatchCreateChunksRequest) MarshalJSON() ([]byte, error) {
+func (s BatchCreateChunksRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateChunksRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchCreateChunksResponse: Response from `BatchCreateChunks` containing a
@@ -317,9 +329,9 @@ type BatchCreateChunksResponse struct {
NullFields []string `json:"-"`
}
-func (s *BatchCreateChunksResponse) MarshalJSON() ([]byte, error) {
+func (s BatchCreateChunksResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateChunksResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchDeleteChunksRequest: Request to batch delete `Chunk`s.
@@ -339,9 +351,9 @@ type BatchDeleteChunksRequest struct {
NullFields []string `json:"-"`
}
-func (s *BatchDeleteChunksRequest) MarshalJSON() ([]byte, error) {
+func (s BatchDeleteChunksRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchDeleteChunksRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchEmbedContentsRequest: Batch request to get embeddings from the model
@@ -363,9 +375,9 @@ type BatchEmbedContentsRequest struct {
NullFields []string `json:"-"`
}
-func (s *BatchEmbedContentsRequest) MarshalJSON() ([]byte, error) {
+func (s BatchEmbedContentsRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchEmbedContentsRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchEmbedContentsResponse: The response to a `BatchEmbedContentsRequest`.
@@ -389,9 +401,9 @@ type BatchEmbedContentsResponse struct {
NullFields []string `json:"-"`
}
-func (s *BatchEmbedContentsResponse) MarshalJSON() ([]byte, error) {
+func (s BatchEmbedContentsResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchEmbedContentsResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchEmbedTextRequest: Batch request to get a text embedding from the model.
@@ -416,9 +428,9 @@ type BatchEmbedTextRequest struct {
NullFields []string `json:"-"`
}
-func (s *BatchEmbedTextRequest) MarshalJSON() ([]byte, error) {
+func (s BatchEmbedTextRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchEmbedTextRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchEmbedTextResponse: The response to a EmbedTextRequest.
@@ -441,9 +453,9 @@ type BatchEmbedTextResponse struct {
NullFields []string `json:"-"`
}
-func (s *BatchEmbedTextResponse) MarshalJSON() ([]byte, error) {
+func (s BatchEmbedTextResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchEmbedTextResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchUpdateChunksRequest: Request to batch update `Chunk`s.
@@ -464,9 +476,9 @@ type BatchUpdateChunksRequest struct {
NullFields []string `json:"-"`
}
-func (s *BatchUpdateChunksRequest) MarshalJSON() ([]byte, error) {
+func (s BatchUpdateChunksRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchUpdateChunksRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// BatchUpdateChunksResponse: Response from `BatchUpdateChunks` containing a
@@ -490,9 +502,9 @@ type BatchUpdateChunksResponse struct {
NullFields []string `json:"-"`
}
-func (s *BatchUpdateChunksResponse) MarshalJSON() ([]byte, error) {
+func (s BatchUpdateChunksResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchUpdateChunksResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Blob: Raw media bytes. Text should not be sent as raw bytes, use the 'text'
@@ -519,9 +531,87 @@ type Blob struct {
NullFields []string `json:"-"`
}
-func (s *Blob) MarshalJSON() ([]byte, error) {
+func (s Blob) MarshalJSON() ([]byte, error) {
type NoMethod Blob
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// CachedContent: Content that has been preprocessed and can be used in
+// subsequent request to GenerativeService. Cached content can be only used
+// with model it was created for.
+type CachedContent struct {
+ // Contents: Optional. Input only. Immutable. The content to cache.
+ Contents []*Content `json:"contents,omitempty"`
+ // CreateTime: Output only. Creation time of the cache entry.
+ CreateTime string `json:"createTime,omitempty"`
+ // DisplayName: Optional. Immutable. The user-generated meaningful display name
+ // of the cached content. Maximum 128 Unicode characters.
+ DisplayName string `json:"displayName,omitempty"`
+ // ExpireTime: Timestamp in UTC of when this resource is considered expired.
+ // This is *always* provided on output, regardless of what was sent on input.
+ ExpireTime string `json:"expireTime,omitempty"`
+ // Model: Required. Immutable. The name of the `Model` to use for cached
+ // content Format: `models/{model}`
+ Model string `json:"model,omitempty"`
+ // Name: Optional. Identifier. The resource name referring to the cached
+ // content. Format: `cachedContents/{id}`
+ Name string `json:"name,omitempty"`
+ // SystemInstruction: Optional. Input only. Immutable. Developer set system
+ // instruction. Currently text only.
+ SystemInstruction *Content `json:"systemInstruction,omitempty"`
+ // ToolConfig: Optional. Input only. Immutable. Tool config. This config is
+ // shared for all tools.
+ ToolConfig *ToolConfig `json:"toolConfig,omitempty"`
+ // Tools: Optional. Input only. Immutable. A list of `Tools` the model may use
+ // to generate the next response
+ Tools []*Tool `json:"tools,omitempty"`
+ // Ttl: Input only. New TTL for this resource, input only.
+ Ttl string `json:"ttl,omitempty"`
+ // UpdateTime: Output only. When the cache entry was last updated in UTC time.
+ UpdateTime string `json:"updateTime,omitempty"`
+ // UsageMetadata: Output only. Metadata on the usage of the cached content.
+ UsageMetadata *CachedContentUsageMetadata `json:"usageMetadata,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Contents") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Contents") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s CachedContent) MarshalJSON() ([]byte, error) {
+ type NoMethod CachedContent
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// CachedContentUsageMetadata: Metadata on the usage of the cached content.
+type CachedContentUsageMetadata struct {
+ // TotalTokenCount: Total number of tokens that the cached content consumes.
+ TotalTokenCount int64 `json:"totalTokenCount,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "TotalTokenCount") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "TotalTokenCount") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s CachedContentUsageMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod CachedContentUsageMetadata
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Candidate: A response candidate generated from the model.
@@ -544,6 +634,8 @@ type Candidate struct {
// was reached.
// "SAFETY" - The candidate content was flagged for safety reasons.
// "RECITATION" - The candidate content was flagged for recitation reasons.
+ // "LANGUAGE" - The candidate content was flagged for using an unsupported
+ // language.
// "OTHER" - Unknown reason.
FinishReason string `json:"finishReason,omitempty"`
// GroundingAttributions: Output only. Attribution information for sources that
@@ -570,9 +662,9 @@ type Candidate struct {
NullFields []string `json:"-"`
}
-func (s *Candidate) MarshalJSON() ([]byte, error) {
+func (s Candidate) MarshalJSON() ([]byte, error) {
type NoMethod Candidate
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Chunk: A `Chunk` is a subpart of a `Document` that is treated as an
@@ -622,9 +714,9 @@ type Chunk struct {
NullFields []string `json:"-"`
}
-func (s *Chunk) MarshalJSON() ([]byte, error) {
+func (s Chunk) MarshalJSON() ([]byte, error) {
type NoMethod Chunk
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ChunkData: Extracted data that represents the `Chunk` content.
@@ -645,9 +737,9 @@ type ChunkData struct {
NullFields []string `json:"-"`
}
-func (s *ChunkData) MarshalJSON() ([]byte, error) {
+func (s ChunkData) MarshalJSON() ([]byte, error) {
type NoMethod ChunkData
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CitationMetadata: A collection of source attributions for a piece of
@@ -668,9 +760,9 @@ type CitationMetadata struct {
NullFields []string `json:"-"`
}
-func (s *CitationMetadata) MarshalJSON() ([]byte, error) {
+func (s CitationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod CitationMetadata
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CitationSource: A citation to a source for a portion of a specific response.
@@ -698,9 +790,50 @@ type CitationSource struct {
NullFields []string `json:"-"`
}
-func (s *CitationSource) MarshalJSON() ([]byte, error) {
+func (s CitationSource) MarshalJSON() ([]byte, error) {
type NoMethod CitationSource
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// CodeExecution: Tool that executes code generated by the model, and
+// automatically returns the result to the model. See also `ExecutableCode` and
+// `CodeExecutionResult` which are only generated when using this tool.
+type CodeExecution struct {
+}
+
+// CodeExecutionResult: Result of executing the `ExecutableCode`. Only
+// generated when using the `CodeExecution`, and always follows a `part`
+// containing the `ExecutableCode`.
+type CodeExecutionResult struct {
+ // Outcome: Required. Outcome of the code execution.
+ //
+ // Possible values:
+ // "OUTCOME_UNSPECIFIED" - Unspecified status. This value should not be used.
+ // "OUTCOME_OK" - Code execution completed successfully.
+ // "OUTCOME_FAILED" - Code execution finished but with a failure. `stderr`
+ // should contain the reason.
+ // "OUTCOME_DEADLINE_EXCEEDED" - Code execution ran for too long, and was
+ // cancelled. There may or may not be a partial output present.
+ Outcome string `json:"outcome,omitempty"`
+ // Output: Optional. Contains stdout when code execution is successful, stderr
+ // or other description otherwise.
+ Output string `json:"output,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Outcome") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Outcome") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s CodeExecutionResult) MarshalJSON() ([]byte, error) {
+ type NoMethod CodeExecutionResult
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Condition: Filter condition applicable to a single key.
@@ -738,9 +871,9 @@ type Condition struct {
NullFields []string `json:"-"`
}
-func (s *Condition) MarshalJSON() ([]byte, error) {
+func (s Condition) MarshalJSON() ([]byte, error) {
type NoMethod Condition
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *Condition) UnmarshalJSON(data []byte) error {
@@ -782,9 +915,9 @@ type Content struct {
NullFields []string `json:"-"`
}
-func (s *Content) MarshalJSON() ([]byte, error) {
+func (s Content) MarshalJSON() ([]byte, error) {
type NoMethod Content
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ContentEmbedding: A list of floats representing an embedding.
@@ -804,9 +937,9 @@ type ContentEmbedding struct {
NullFields []string `json:"-"`
}
-func (s *ContentEmbedding) MarshalJSON() ([]byte, error) {
+func (s ContentEmbedding) MarshalJSON() ([]byte, error) {
type NoMethod ContentEmbedding
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *ContentEmbedding) UnmarshalJSON(data []byte) error {
@@ -852,9 +985,9 @@ type ContentFilter struct {
NullFields []string `json:"-"`
}
-func (s *ContentFilter) MarshalJSON() ([]byte, error) {
+func (s ContentFilter) MarshalJSON() ([]byte, error) {
type NoMethod ContentFilter
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Corpus: A `Corpus` is a collection of `Document`s. A project can create up
@@ -892,9 +1025,9 @@ type Corpus struct {
NullFields []string `json:"-"`
}
-func (s *Corpus) MarshalJSON() ([]byte, error) {
+func (s Corpus) MarshalJSON() ([]byte, error) {
type NoMethod Corpus
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CountMessageTokensRequest: Counts the number of tokens in the `prompt` sent
@@ -916,9 +1049,9 @@ type CountMessageTokensRequest struct {
NullFields []string `json:"-"`
}
-func (s *CountMessageTokensRequest) MarshalJSON() ([]byte, error) {
+func (s CountMessageTokensRequest) MarshalJSON() ([]byte, error) {
type NoMethod CountMessageTokensRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CountMessageTokensResponse: A response from `CountMessageTokens`. It returns
@@ -943,9 +1076,9 @@ type CountMessageTokensResponse struct {
NullFields []string `json:"-"`
}
-func (s *CountMessageTokensResponse) MarshalJSON() ([]byte, error) {
+func (s CountMessageTokensResponse) MarshalJSON() ([]byte, error) {
type NoMethod CountMessageTokensResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CountTextTokensRequest: Counts the number of tokens in the `prompt` sent to
@@ -967,9 +1100,9 @@ type CountTextTokensRequest struct {
NullFields []string `json:"-"`
}
-func (s *CountTextTokensRequest) MarshalJSON() ([]byte, error) {
+func (s CountTextTokensRequest) MarshalJSON() ([]byte, error) {
type NoMethod CountTextTokensRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CountTextTokensResponse: A response from `CountTextTokens`. It returns the
@@ -994,9 +1127,9 @@ type CountTextTokensResponse struct {
NullFields []string `json:"-"`
}
-func (s *CountTextTokensResponse) MarshalJSON() ([]byte, error) {
+func (s CountTextTokensResponse) MarshalJSON() ([]byte, error) {
type NoMethod CountTextTokensResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CountTokensRequest: Counts the number of tokens in the `prompt` sent to a
@@ -1022,16 +1155,18 @@ type CountTokensRequest struct {
NullFields []string `json:"-"`
}
-func (s *CountTokensRequest) MarshalJSON() ([]byte, error) {
+func (s CountTokensRequest) MarshalJSON() ([]byte, error) {
type NoMethod CountTokensRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CountTokensResponse: A response from `CountTokens`. It returns the model's
// `token_count` for the `prompt`.
type CountTokensResponse struct {
// TotalTokens: The number of tokens that the `model` tokenizes the `prompt`
- // into. Always non-negative.
+ // into. Always non-negative. When cached_content is set, this is still the
+ // total effective prompt size. I.e. this includes the number of tokens in the
+ // cached content.
TotalTokens int64 `json:"totalTokens,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
@@ -1049,9 +1184,9 @@ type CountTokensResponse struct {
NullFields []string `json:"-"`
}
-func (s *CountTokensResponse) MarshalJSON() ([]byte, error) {
+func (s CountTokensResponse) MarshalJSON() ([]byte, error) {
type NoMethod CountTokensResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CreateChunkRequest: Request to create a `Chunk`.
@@ -1074,9 +1209,9 @@ type CreateChunkRequest struct {
NullFields []string `json:"-"`
}
-func (s *CreateChunkRequest) MarshalJSON() ([]byte, error) {
+func (s CreateChunkRequest) MarshalJSON() ([]byte, error) {
type NoMethod CreateChunkRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CreateFileRequest: Request for `CreateFile`.
@@ -1096,9 +1231,9 @@ type CreateFileRequest struct {
NullFields []string `json:"-"`
}
-func (s *CreateFileRequest) MarshalJSON() ([]byte, error) {
+func (s CreateFileRequest) MarshalJSON() ([]byte, error) {
type NoMethod CreateFileRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CreateFileResponse: Response for `CreateFile`.
@@ -1121,9 +1256,9 @@ type CreateFileResponse struct {
NullFields []string `json:"-"`
}
-func (s *CreateFileResponse) MarshalJSON() ([]byte, error) {
+func (s CreateFileResponse) MarshalJSON() ([]byte, error) {
type NoMethod CreateFileResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CustomMetadata: User provided metadata stored as key-value pairs.
@@ -1149,9 +1284,9 @@ type CustomMetadata struct {
NullFields []string `json:"-"`
}
-func (s *CustomMetadata) MarshalJSON() ([]byte, error) {
+func (s CustomMetadata) MarshalJSON() ([]byte, error) {
type NoMethod CustomMetadata
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *CustomMetadata) UnmarshalJSON(data []byte) error {
@@ -1185,9 +1320,9 @@ type Dataset struct {
NullFields []string `json:"-"`
}
-func (s *Dataset) MarshalJSON() ([]byte, error) {
+func (s Dataset) MarshalJSON() ([]byte, error) {
type NoMethod Dataset
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DeleteChunkRequest: Request to delete a `Chunk`.
@@ -1208,9 +1343,9 @@ type DeleteChunkRequest struct {
NullFields []string `json:"-"`
}
-func (s *DeleteChunkRequest) MarshalJSON() ([]byte, error) {
+func (s DeleteChunkRequest) MarshalJSON() ([]byte, error) {
type NoMethod DeleteChunkRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Document: A `Document` is a collection of `Chunk`s. A `Corpus` can have a
@@ -1252,9 +1387,9 @@ type Document struct {
NullFields []string `json:"-"`
}
-func (s *Document) MarshalJSON() ([]byte, error) {
+func (s Document) MarshalJSON() ([]byte, error) {
type NoMethod Document
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// EmbedContentRequest: Request containing the `Content` for the model to
@@ -1307,9 +1442,9 @@ type EmbedContentRequest struct {
NullFields []string `json:"-"`
}
-func (s *EmbedContentRequest) MarshalJSON() ([]byte, error) {
+func (s EmbedContentRequest) MarshalJSON() ([]byte, error) {
type NoMethod EmbedContentRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// EmbedContentResponse: The response to an `EmbedContentRequest`.
@@ -1332,9 +1467,9 @@ type EmbedContentResponse struct {
NullFields []string `json:"-"`
}
-func (s *EmbedContentResponse) MarshalJSON() ([]byte, error) {
+func (s EmbedContentResponse) MarshalJSON() ([]byte, error) {
type NoMethod EmbedContentResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// EmbedTextRequest: Request to get a text embedding from the model.
@@ -1357,9 +1492,9 @@ type EmbedTextRequest struct {
NullFields []string `json:"-"`
}
-func (s *EmbedTextRequest) MarshalJSON() ([]byte, error) {
+func (s EmbedTextRequest) MarshalJSON() ([]byte, error) {
type NoMethod EmbedTextRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// EmbedTextResponse: The response to a EmbedTextRequest.
@@ -1382,9 +1517,9 @@ type EmbedTextResponse struct {
NullFields []string `json:"-"`
}
-func (s *EmbedTextResponse) MarshalJSON() ([]byte, error) {
+func (s EmbedTextResponse) MarshalJSON() ([]byte, error) {
type NoMethod EmbedTextResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Embedding: A list of floats representing the embedding.
@@ -1404,9 +1539,9 @@ type Embedding struct {
NullFields []string `json:"-"`
}
-func (s *Embedding) MarshalJSON() ([]byte, error) {
+func (s Embedding) MarshalJSON() ([]byte, error) {
type NoMethod Embedding
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *Embedding) UnmarshalJSON(data []byte) error {
@@ -1456,9 +1591,41 @@ type Example struct {
NullFields []string `json:"-"`
}
-func (s *Example) MarshalJSON() ([]byte, error) {
+func (s Example) MarshalJSON() ([]byte, error) {
type NoMethod Example
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// ExecutableCode: Code generated by the model that is meant to be executed,
+// and the result returned to the model. Only generated when using the
+// `CodeExecution` tool, in which the code will be automatically executed, and
+// a corresponding `CodeExecutionResult` will also be generated.
+type ExecutableCode struct {
+ // Code: Required. The code to be executed.
+ Code string `json:"code,omitempty"`
+ // Language: Required. Programming language of the `code`.
+ //
+ // Possible values:
+ // "LANGUAGE_UNSPECIFIED" - Unspecified language. This value should not be
+ // used.
+ // "PYTHON" - Python >= 3.10, with numpy and simpy available.
+ Language string `json:"language,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
+ // include in API requests. By default, fields with empty or default values are
+ // omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "Code") to include in API requests
+ // with the JSON null value. By default, fields with empty values are omitted
+ // from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s ExecutableCode) MarshalJSON() ([]byte, error) {
+ type NoMethod ExecutableCode
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// File: A file uploaded to the API.
@@ -1518,9 +1685,9 @@ type File struct {
NullFields []string `json:"-"`
}
-func (s *File) MarshalJSON() ([]byte, error) {
+func (s File) MarshalJSON() ([]byte, error) {
type NoMethod File
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FileData: URI based data.
@@ -1542,9 +1709,9 @@ type FileData struct {
NullFields []string `json:"-"`
}
-func (s *FileData) MarshalJSON() ([]byte, error) {
+func (s FileData) MarshalJSON() ([]byte, error) {
type NoMethod FileData
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FunctionCall: A predicted `FunctionCall` returned from the model that
@@ -1569,9 +1736,9 @@ type FunctionCall struct {
NullFields []string `json:"-"`
}
-func (s *FunctionCall) MarshalJSON() ([]byte, error) {
+func (s FunctionCall) MarshalJSON() ([]byte, error) {
type NoMethod FunctionCall
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FunctionCallingConfig: Configuration for specifying function calling
@@ -1590,7 +1757,7 @@ type FunctionCallingConfig struct {
// "MODE_UNSPECIFIED" - Unspecified function calling mode. This value should
// not be used.
// "AUTO" - Default model behavior, model decides to predict either a
- // function call or a natural language repspose.
+ // function call or a natural language response.
// "ANY" - Model is constrained to always predicting a function call only. If
// "allowed_function_names" are set, the predicted function call will be
// limited to any one of "allowed_function_names", else the predicted function
@@ -1611,9 +1778,9 @@ type FunctionCallingConfig struct {
NullFields []string `json:"-"`
}
-func (s *FunctionCallingConfig) MarshalJSON() ([]byte, error) {
+func (s FunctionCallingConfig) MarshalJSON() ([]byte, error) {
type NoMethod FunctionCallingConfig
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FunctionDeclaration: Structured representation of a function declaration as
@@ -1646,9 +1813,9 @@ type FunctionDeclaration struct {
NullFields []string `json:"-"`
}
-func (s *FunctionDeclaration) MarshalJSON() ([]byte, error) {
+func (s FunctionDeclaration) MarshalJSON() ([]byte, error) {
type NoMethod FunctionDeclaration
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// FunctionResponse: The result output from a `FunctionCall` that contains a
@@ -1675,9 +1842,9 @@ type FunctionResponse struct {
NullFields []string `json:"-"`
}
-func (s *FunctionResponse) MarshalJSON() ([]byte, error) {
+func (s FunctionResponse) MarshalJSON() ([]byte, error) {
type NoMethod FunctionResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GenerateAnswerRequest: Request to generate a grounded answer from the model.
@@ -1735,9 +1902,9 @@ type GenerateAnswerRequest struct {
NullFields []string `json:"-"`
}
-func (s *GenerateAnswerRequest) MarshalJSON() ([]byte, error) {
+func (s GenerateAnswerRequest) MarshalJSON() ([]byte, error) {
type NoMethod GenerateAnswerRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GenerateAnswerRequest) UnmarshalJSON(data []byte) error {
@@ -1795,9 +1962,9 @@ type GenerateAnswerResponse struct {
NullFields []string `json:"-"`
}
-func (s *GenerateAnswerResponse) MarshalJSON() ([]byte, error) {
+func (s GenerateAnswerResponse) MarshalJSON() ([]byte, error) {
type NoMethod GenerateAnswerResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GenerateAnswerResponse) UnmarshalJSON(data []byte) error {
@@ -1816,6 +1983,11 @@ func (s *GenerateAnswerResponse) UnmarshalJSON(data []byte) error {
// GenerateContentRequest: Request to generate a completion from the model.
type GenerateContentRequest struct {
+ // CachedContent: Optional. The name of the cached content used as context to
+ // serve the prediction. Note: only used in explicit caching, where users can
+ // have control over caching (e.g. what content to cache) and enjoy guaranteed
+ // cost savings. Format: `cachedContents/{cachedContent}`
+ CachedContent string `json:"cachedContent,omitempty"`
// Contents: Required. The content of the current conversation with the model.
// For single-turn queries, this is a single instance. For multi-turn queries,
// this is a repeated field that contains conversation history + latest
@@ -1851,22 +2023,22 @@ type GenerateContentRequest struct {
// knowledge and scope of the model. The only supported tool is currently
// `Function`.
Tools []*Tool `json:"tools,omitempty"`
- // ForceSendFields is a list of field names (e.g. "Contents") to
+ // ForceSendFields is a list of field names (e.g. "CachedContent") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
- // NullFields is a list of field names (e.g. "Contents") to include in API
+ // NullFields is a list of field names (e.g. "CachedContent") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *GenerateContentRequest) MarshalJSON() ([]byte, error) {
+func (s GenerateContentRequest) MarshalJSON() ([]byte, error) {
type NoMethod GenerateContentRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GenerateContentResponse: Response from the model supporting multiple
@@ -1902,9 +2074,9 @@ type GenerateContentResponse struct {
NullFields []string `json:"-"`
}
-func (s *GenerateContentResponse) MarshalJSON() ([]byte, error) {
+func (s GenerateContentResponse) MarshalJSON() ([]byte, error) {
type NoMethod GenerateContentResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GenerateMessageRequest: Request to generate a message response from the
@@ -1945,9 +2117,9 @@ type GenerateMessageRequest struct {
NullFields []string `json:"-"`
}
-func (s *GenerateMessageRequest) MarshalJSON() ([]byte, error) {
+func (s GenerateMessageRequest) MarshalJSON() ([]byte, error) {
type NoMethod GenerateMessageRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GenerateMessageRequest) UnmarshalJSON(data []byte) error {
@@ -1995,9 +2167,9 @@ type GenerateMessageResponse struct {
NullFields []string `json:"-"`
}
-func (s *GenerateMessageResponse) MarshalJSON() ([]byte, error) {
+func (s GenerateMessageResponse) MarshalJSON() ([]byte, error) {
type NoMethod GenerateMessageResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GenerateTextRequest: Request to generate a text completion response from the
@@ -2067,9 +2239,9 @@ type GenerateTextRequest struct {
NullFields []string `json:"-"`
}
-func (s *GenerateTextRequest) MarshalJSON() ([]byte, error) {
+func (s GenerateTextRequest) MarshalJSON() ([]byte, error) {
type NoMethod GenerateTextRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GenerateTextRequest) UnmarshalJSON(data []byte) error {
@@ -2119,9 +2291,9 @@ type GenerateTextResponse struct {
NullFields []string `json:"-"`
}
-func (s *GenerateTextResponse) MarshalJSON() ([]byte, error) {
+func (s GenerateTextResponse) MarshalJSON() ([]byte, error) {
type NoMethod GenerateTextResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GenerationConfig: Configuration options for model generation and outputs.
@@ -2188,9 +2360,9 @@ type GenerationConfig struct {
NullFields []string `json:"-"`
}
-func (s *GenerationConfig) MarshalJSON() ([]byte, error) {
+func (s GenerationConfig) MarshalJSON() ([]byte, error) {
type NoMethod GenerationConfig
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GenerationConfig) UnmarshalJSON(data []byte) error {
@@ -2230,9 +2402,9 @@ type GroundingAttribution struct {
NullFields []string `json:"-"`
}
-func (s *GroundingAttribution) MarshalJSON() ([]byte, error) {
+func (s GroundingAttribution) MarshalJSON() ([]byte, error) {
type NoMethod GroundingAttribution
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GroundingPassage: Passage included inline with a grounding configuration.
@@ -2255,9 +2427,9 @@ type GroundingPassage struct {
NullFields []string `json:"-"`
}
-func (s *GroundingPassage) MarshalJSON() ([]byte, error) {
+func (s GroundingPassage) MarshalJSON() ([]byte, error) {
type NoMethod GroundingPassage
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GroundingPassageId: Identifier for a part within a `GroundingPassage`.
@@ -2281,9 +2453,9 @@ type GroundingPassageId struct {
NullFields []string `json:"-"`
}
-func (s *GroundingPassageId) MarshalJSON() ([]byte, error) {
+func (s GroundingPassageId) MarshalJSON() ([]byte, error) {
type NoMethod GroundingPassageId
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GroundingPassages: A repeated list of passages.
@@ -2303,9 +2475,9 @@ type GroundingPassages struct {
NullFields []string `json:"-"`
}
-func (s *GroundingPassages) MarshalJSON() ([]byte, error) {
+func (s GroundingPassages) MarshalJSON() ([]byte, error) {
type NoMethod GroundingPassages
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Hyperparameters: Hyperparameters controlling the tuning process. Read more
@@ -2340,9 +2512,9 @@ type Hyperparameters struct {
NullFields []string `json:"-"`
}
-func (s *Hyperparameters) MarshalJSON() ([]byte, error) {
+func (s Hyperparameters) MarshalJSON() ([]byte, error) {
type NoMethod Hyperparameters
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *Hyperparameters) UnmarshalJSON(data []byte) error {
@@ -2389,9 +2561,37 @@ type InputFeedback struct {
NullFields []string `json:"-"`
}
-func (s *InputFeedback) MarshalJSON() ([]byte, error) {
+func (s InputFeedback) MarshalJSON() ([]byte, error) {
type NoMethod InputFeedback
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+// ListCachedContentsResponse: Response with CachedContents list.
+type ListCachedContentsResponse struct {
+ // CachedContents: List of cached contents.
+ CachedContents []*CachedContent `json:"cachedContents,omitempty"`
+ // NextPageToken: A token, which can be sent as `page_token` to retrieve the
+ // next page. If this field is omitted, there are no subsequent pages.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CachedContents") to
+ // unconditionally include in API requests. By default, fields with empty or
+ // default values are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
+ // details.
+ ForceSendFields []string `json:"-"`
+ // NullFields is a list of field names (e.g. "CachedContents") to include in
+ // API requests with the JSON null value. By default, fields with empty values
+ // are omitted from API requests. See
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s ListCachedContentsResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListCachedContentsResponse
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ListChunksResponse: Response from `ListChunks` containing a paginated list
@@ -2418,9 +2618,9 @@ type ListChunksResponse struct {
NullFields []string `json:"-"`
}
-func (s *ListChunksResponse) MarshalJSON() ([]byte, error) {
+func (s ListChunksResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListChunksResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ListCorporaResponse: Response from `ListCorpora` containing a paginated list
@@ -2447,9 +2647,9 @@ type ListCorporaResponse struct {
NullFields []string `json:"-"`
}
-func (s *ListCorporaResponse) MarshalJSON() ([]byte, error) {
+func (s ListCorporaResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListCorporaResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ListDocumentsResponse: Response from `ListDocuments` containing a paginated
@@ -2477,9 +2677,9 @@ type ListDocumentsResponse struct {
NullFields []string `json:"-"`
}
-func (s *ListDocumentsResponse) MarshalJSON() ([]byte, error) {
+func (s ListDocumentsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListDocumentsResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ListFilesResponse: Response for `ListFiles`.
@@ -2505,9 +2705,9 @@ type ListFilesResponse struct {
NullFields []string `json:"-"`
}
-func (s *ListFilesResponse) MarshalJSON() ([]byte, error) {
+func (s ListFilesResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListFilesResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ListModelsResponse: Response from `ListModel` containing a paginated list of
@@ -2534,9 +2734,9 @@ type ListModelsResponse struct {
NullFields []string `json:"-"`
}
-func (s *ListModelsResponse) MarshalJSON() ([]byte, error) {
+func (s ListModelsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListModelsResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ListPermissionsResponse: Response from `ListPermissions` containing a
@@ -2563,9 +2763,9 @@ type ListPermissionsResponse struct {
NullFields []string `json:"-"`
}
-func (s *ListPermissionsResponse) MarshalJSON() ([]byte, error) {
+func (s ListPermissionsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListPermissionsResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ListTunedModelsResponse: Response from `ListTunedModels` containing a
@@ -2592,9 +2792,9 @@ type ListTunedModelsResponse struct {
NullFields []string `json:"-"`
}
-func (s *ListTunedModelsResponse) MarshalJSON() ([]byte, error) {
+func (s ListTunedModelsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListTunedModelsResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Message: The base unit of structured text. A `Message` includes an `author`
@@ -2625,9 +2825,9 @@ type Message struct {
NullFields []string `json:"-"`
}
-func (s *Message) MarshalJSON() ([]byte, error) {
+func (s Message) MarshalJSON() ([]byte, error) {
type NoMethod Message
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MessagePrompt: All of the structured input text passed to the model as a
@@ -2673,9 +2873,9 @@ type MessagePrompt struct {
NullFields []string `json:"-"`
}
-func (s *MessagePrompt) MarshalJSON() ([]byte, error) {
+func (s MessagePrompt) MarshalJSON() ([]byte, error) {
type NoMethod MessagePrompt
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// MetadataFilter: User provided filter to limit retrieval based on `Chunk` or
@@ -2701,9 +2901,9 @@ type MetadataFilter struct {
NullFields []string `json:"-"`
}
-func (s *MetadataFilter) MarshalJSON() ([]byte, error) {
+func (s MetadataFilter) MarshalJSON() ([]byte, error) {
type NoMethod MetadataFilter
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Model: Information about a Generative Language Model.
@@ -2719,6 +2919,8 @@ type Model struct {
DisplayName string `json:"displayName,omitempty"`
// InputTokenLimit: Maximum number of input tokens allowed for this model.
InputTokenLimit int64 `json:"inputTokenLimit,omitempty"`
+ // MaxTemperature: The maximum temperature this model can use.
+ MaxTemperature float64 `json:"maxTemperature,omitempty"`
// Name: Required. The resource name of the `Model`. Format: `models/{model}`
// with a `{model}` naming convention of: * "{base_model_id}-{version}"
// Examples: * `models/chat-bison-001`
@@ -2730,10 +2932,10 @@ type Model struct {
// which correspond to API methods.
SupportedGenerationMethods []string `json:"supportedGenerationMethods,omitempty"`
// Temperature: Controls the randomness of the output. Values can range over
- // `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that
- // are more varied, while a value closer to `0.0` will typically result in less
- // surprising responses from the model. This value specifies default to be used
- // by the backend while making the call to the model.
+ // `[0.0,max_temperature]`, inclusive. A higher value will produce responses
+ // that are more varied, while a value closer to `0.0` will typically result in
+ // less surprising responses from the model. This value specifies default to be
+ // used by the backend while making the call to the model.
Temperature float64 `json:"temperature,omitempty"`
// TopK: For Top-k sampling. Top-k sampling considers the set of `top_k` most
// probable tokens. This value specifies default to be used by the backend
@@ -2763,22 +2965,24 @@ type Model struct {
NullFields []string `json:"-"`
}
-func (s *Model) MarshalJSON() ([]byte, error) {
+func (s Model) MarshalJSON() ([]byte, error) {
type NoMethod Model
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *Model) UnmarshalJSON(data []byte) error {
type NoMethod Model
var s1 struct {
- Temperature gensupport.JSONFloat64 `json:"temperature"`
- TopP gensupport.JSONFloat64 `json:"topP"`
+ MaxTemperature gensupport.JSONFloat64 `json:"maxTemperature"`
+ Temperature gensupport.JSONFloat64 `json:"temperature"`
+ TopP gensupport.JSONFloat64 `json:"topP"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
+ s.MaxTemperature = float64(s1.MaxTemperature)
s.Temperature = float64(s1.Temperature)
s.TopP = float64(s1.TopP)
return nil
@@ -2826,9 +3030,9 @@ type Operation struct {
NullFields []string `json:"-"`
}
-func (s *Operation) MarshalJSON() ([]byte, error) {
+func (s Operation) MarshalJSON() ([]byte, error) {
type NoMethod Operation
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Part: A datatype containing media that is part of a multi-part `Content`
@@ -2837,6 +3041,10 @@ func (s *Operation) MarshalJSON() ([]byte, error) {
// must have a fixed IANA MIME type identifying the type and subtype of the
// media if the `inline_data` field is filled with raw bytes.
type Part struct {
+ // CodeExecutionResult: Result of executing the `ExecutableCode`.
+ CodeExecutionResult *CodeExecutionResult `json:"codeExecutionResult,omitempty"`
+ // ExecutableCode: Code generated by the model that is meant to be executed.
+ ExecutableCode *ExecutableCode `json:"executableCode,omitempty"`
// FileData: URI based data.
FileData *FileData `json:"fileData,omitempty"`
// FunctionCall: A predicted `FunctionCall` returned from the model that
@@ -2852,22 +3060,22 @@ type Part struct {
InlineData *Blob `json:"inlineData,omitempty"`
// Text: Inline text.
Text string `json:"text,omitempty"`
- // ForceSendFields is a list of field names (e.g. "FileData") to
+ // ForceSendFields is a list of field names (e.g. "CodeExecutionResult") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
- // NullFields is a list of field names (e.g. "FileData") to include in API
- // requests with the JSON null value. By default, fields with empty values are
- // omitted from API requests. See
+ // NullFields is a list of field names (e.g. "CodeExecutionResult") to include
+ // in API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Part) MarshalJSON() ([]byte, error) {
+func (s Part) MarshalJSON() ([]byte, error) {
type NoMethod Part
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Permission: Permission resource grants user, group or the rest of the world
@@ -2925,9 +3133,9 @@ type Permission struct {
NullFields []string `json:"-"`
}
-func (s *Permission) MarshalJSON() ([]byte, error) {
+func (s Permission) MarshalJSON() ([]byte, error) {
type NoMethod Permission
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// PromptFeedback: A set of the feedback metadata the prompt specified in
@@ -2940,7 +3148,7 @@ type PromptFeedback struct {
// "BLOCK_REASON_UNSPECIFIED" - Default value. This value is unused.
// "SAFETY" - Prompt was blocked due to safety reasons. You can inspect
// `safety_ratings` to understand which safety category blocked it.
- // "OTHER" - Prompt was blocked due to unknown reaasons.
+ // "OTHER" - Prompt was blocked due to unknown reasons.
BlockReason string `json:"blockReason,omitempty"`
// SafetyRatings: Ratings for safety of the prompt. There is at most one rating
// per category.
@@ -2958,9 +3166,9 @@ type PromptFeedback struct {
NullFields []string `json:"-"`
}
-func (s *PromptFeedback) MarshalJSON() ([]byte, error) {
+func (s PromptFeedback) MarshalJSON() ([]byte, error) {
type NoMethod PromptFeedback
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// QueryCorpusRequest: Request for querying a `Corpus`.
@@ -3003,9 +3211,9 @@ type QueryCorpusRequest struct {
NullFields []string `json:"-"`
}
-func (s *QueryCorpusRequest) MarshalJSON() ([]byte, error) {
+func (s QueryCorpusRequest) MarshalJSON() ([]byte, error) {
type NoMethod QueryCorpusRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// QueryCorpusResponse: Response from `QueryCorpus` containing a list of
@@ -3029,9 +3237,9 @@ type QueryCorpusResponse struct {
NullFields []string `json:"-"`
}
-func (s *QueryCorpusResponse) MarshalJSON() ([]byte, error) {
+func (s QueryCorpusResponse) MarshalJSON() ([]byte, error) {
type NoMethod QueryCorpusResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// QueryDocumentRequest: Request for querying a `Document`.
@@ -3073,9 +3281,9 @@ type QueryDocumentRequest struct {
NullFields []string `json:"-"`
}
-func (s *QueryDocumentRequest) MarshalJSON() ([]byte, error) {
+func (s QueryDocumentRequest) MarshalJSON() ([]byte, error) {
type NoMethod QueryDocumentRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// QueryDocumentResponse: Response from `QueryDocument` containing a list of
@@ -3099,9 +3307,9 @@ type QueryDocumentResponse struct {
NullFields []string `json:"-"`
}
-func (s *QueryDocumentResponse) MarshalJSON() ([]byte, error) {
+func (s QueryDocumentResponse) MarshalJSON() ([]byte, error) {
type NoMethod QueryDocumentResponse
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// RelevantChunk: The information for a chunk relevant to a query.
@@ -3123,9 +3331,9 @@ type RelevantChunk struct {
NullFields []string `json:"-"`
}
-func (s *RelevantChunk) MarshalJSON() ([]byte, error) {
+func (s RelevantChunk) MarshalJSON() ([]byte, error) {
type NoMethod RelevantChunk
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *RelevantChunk) UnmarshalJSON(data []byte) error {
@@ -3166,9 +3374,9 @@ type SafetyFeedback struct {
NullFields []string `json:"-"`
}
-func (s *SafetyFeedback) MarshalJSON() ([]byte, error) {
+func (s SafetyFeedback) MarshalJSON() ([]byte, error) {
type NoMethod SafetyFeedback
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SafetyRating: Safety rating for a piece of content. The safety rating
@@ -3221,9 +3429,9 @@ type SafetyRating struct {
NullFields []string `json:"-"`
}
-func (s *SafetyRating) MarshalJSON() ([]byte, error) {
+func (s SafetyRating) MarshalJSON() ([]byte, error) {
type NoMethod SafetyRating
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SafetySetting: Safety setting, affecting the safety-blocking behavior.
@@ -3275,9 +3483,9 @@ type SafetySetting struct {
NullFields []string `json:"-"`
}
-func (s *SafetySetting) MarshalJSON() ([]byte, error) {
+func (s SafetySetting) MarshalJSON() ([]byte, error) {
type NoMethod SafetySetting
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Schema: The `Schema` object allows the definition of input and output data
@@ -3294,7 +3502,7 @@ type Schema struct {
Enum []string `json:"enum,omitempty"`
// Format: Optional. The format of the data. This is used only for primitive
// datatypes. Supported formats: for NUMBER type: float, double for INTEGER
- // type: int32, int64
+ // type: int32, int64 for STRING type: enum
Format string `json:"format,omitempty"`
// Items: Optional. Schema of the elements of Type.ARRAY.
Items *Schema `json:"items,omitempty"`
@@ -3328,9 +3536,9 @@ type Schema struct {
NullFields []string `json:"-"`
}
-func (s *Schema) MarshalJSON() ([]byte, error) {
+func (s Schema) MarshalJSON() ([]byte, error) {
type NoMethod Schema
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SemanticRetrieverChunk: Identifier for a `Chunk` retrieved via Semantic
@@ -3357,9 +3565,9 @@ type SemanticRetrieverChunk struct {
NullFields []string `json:"-"`
}
-func (s *SemanticRetrieverChunk) MarshalJSON() ([]byte, error) {
+func (s SemanticRetrieverChunk) MarshalJSON() ([]byte, error) {
type NoMethod SemanticRetrieverChunk
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// SemanticRetrieverConfig: Configuration for retrieving grounding content from
@@ -3392,9 +3600,9 @@ type SemanticRetrieverConfig struct {
NullFields []string `json:"-"`
}
-func (s *SemanticRetrieverConfig) MarshalJSON() ([]byte, error) {
+func (s SemanticRetrieverConfig) MarshalJSON() ([]byte, error) {
type NoMethod SemanticRetrieverConfig
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *SemanticRetrieverConfig) UnmarshalJSON(data []byte) error {
@@ -3440,9 +3648,9 @@ type Status struct {
NullFields []string `json:"-"`
}
-func (s *Status) MarshalJSON() ([]byte, error) {
+func (s Status) MarshalJSON() ([]byte, error) {
type NoMethod Status
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// StringList: User provided string values assigned to a single metadata key.
@@ -3462,9 +3670,9 @@ type StringList struct {
NullFields []string `json:"-"`
}
-func (s *StringList) MarshalJSON() ([]byte, error) {
+func (s StringList) MarshalJSON() ([]byte, error) {
type NoMethod StringList
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TextCompletion: Output text returned from a model.
@@ -3491,9 +3699,9 @@ type TextCompletion struct {
NullFields []string `json:"-"`
}
-func (s *TextCompletion) MarshalJSON() ([]byte, error) {
+func (s TextCompletion) MarshalJSON() ([]byte, error) {
type NoMethod TextCompletion
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TextPrompt: Text given to the model as a prompt. The Model will use this
@@ -3514,9 +3722,9 @@ type TextPrompt struct {
NullFields []string `json:"-"`
}
-func (s *TextPrompt) MarshalJSON() ([]byte, error) {
+func (s TextPrompt) MarshalJSON() ([]byte, error) {
type NoMethod TextPrompt
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Tool: Tool details that the model may use to generate response. A `Tool` is
@@ -3524,6 +3732,9 @@ func (s *TextPrompt) MarshalJSON() ([]byte, error) {
// perform an action, or set of actions, outside of knowledge and scope of the
// model.
type Tool struct {
+ // CodeExecution: Optional. Enables the model to execute code as part of
+ // generation.
+ CodeExecution *CodeExecution `json:"codeExecution,omitempty"`
// FunctionDeclarations: Optional. A list of `FunctionDeclarations` available
// to the model that can be used for function calling. The model or system does
// not execute the function. Instead the defined function may be returned as a
@@ -3532,22 +3743,22 @@ type Tool struct {
// response. The next conversation turn may contain a FunctionResponse with the
// [content.role] "function" generation context for the next model turn.
FunctionDeclarations []*FunctionDeclaration `json:"functionDeclarations,omitempty"`
- // ForceSendFields is a list of field names (e.g. "FunctionDeclarations") to
+ // ForceSendFields is a list of field names (e.g. "CodeExecution") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
- // NullFields is a list of field names (e.g. "FunctionDeclarations") to include
- // in API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. See
+ // NullFields is a list of field names (e.g. "CodeExecution") to include in API
+ // requests with the JSON null value. By default, fields with empty values are
+ // omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *Tool) MarshalJSON() ([]byte, error) {
+func (s Tool) MarshalJSON() ([]byte, error) {
type NoMethod Tool
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ToolConfig: The Tool configuration containing parameters for specifying
@@ -3568,9 +3779,9 @@ type ToolConfig struct {
NullFields []string `json:"-"`
}
-func (s *ToolConfig) MarshalJSON() ([]byte, error) {
+func (s ToolConfig) MarshalJSON() ([]byte, error) {
type NoMethod ToolConfig
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TransferOwnershipRequest: Request to transfer the ownership of the tuned
@@ -3592,9 +3803,9 @@ type TransferOwnershipRequest struct {
NullFields []string `json:"-"`
}
-func (s *TransferOwnershipRequest) MarshalJSON() ([]byte, error) {
+func (s TransferOwnershipRequest) MarshalJSON() ([]byte, error) {
type NoMethod TransferOwnershipRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TransferOwnershipResponse: Response from `TransferOwnership`.
@@ -3669,9 +3880,9 @@ type TunedModel struct {
NullFields []string `json:"-"`
}
-func (s *TunedModel) MarshalJSON() ([]byte, error) {
+func (s TunedModel) MarshalJSON() ([]byte, error) {
type NoMethod TunedModel
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *TunedModel) UnmarshalJSON(data []byte) error {
@@ -3711,9 +3922,9 @@ type TunedModelSource struct {
NullFields []string `json:"-"`
}
-func (s *TunedModelSource) MarshalJSON() ([]byte, error) {
+func (s TunedModelSource) MarshalJSON() ([]byte, error) {
type NoMethod TunedModelSource
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TuningExample: A single example for tuning.
@@ -3735,9 +3946,9 @@ type TuningExample struct {
NullFields []string `json:"-"`
}
-func (s *TuningExample) MarshalJSON() ([]byte, error) {
+func (s TuningExample) MarshalJSON() ([]byte, error) {
type NoMethod TuningExample
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TuningExamples: A set of tuning examples. Can be training or validation
@@ -3759,9 +3970,9 @@ type TuningExamples struct {
NullFields []string `json:"-"`
}
-func (s *TuningExamples) MarshalJSON() ([]byte, error) {
+func (s TuningExamples) MarshalJSON() ([]byte, error) {
type NoMethod TuningExamples
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// TuningSnapshot: Record for a single tuning step.
@@ -3787,9 +3998,9 @@ type TuningSnapshot struct {
NullFields []string `json:"-"`
}
-func (s *TuningSnapshot) MarshalJSON() ([]byte, error) {
+func (s TuningSnapshot) MarshalJSON() ([]byte, error) {
type NoMethod TuningSnapshot
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *TuningSnapshot) UnmarshalJSON(data []byte) error {
@@ -3832,9 +4043,9 @@ type TuningTask struct {
NullFields []string `json:"-"`
}
-func (s *TuningTask) MarshalJSON() ([]byte, error) {
+func (s TuningTask) MarshalJSON() ([]byte, error) {
type NoMethod TuningTask
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UpdateChunkRequest: Request to update a `Chunk`.
@@ -3857,37 +4068,42 @@ type UpdateChunkRequest struct {
NullFields []string `json:"-"`
}
-func (s *UpdateChunkRequest) MarshalJSON() ([]byte, error) {
+func (s UpdateChunkRequest) MarshalJSON() ([]byte, error) {
type NoMethod UpdateChunkRequest
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// UsageMetadata: Metadata on the generation request's token usage.
type UsageMetadata struct {
+ // CachedContentTokenCount: Number of tokens in the cached part of the prompt,
+ // i.e. in the cached content.
+ CachedContentTokenCount int64 `json:"cachedContentTokenCount,omitempty"`
// CandidatesTokenCount: Total number of tokens across the generated
// candidates.
CandidatesTokenCount int64 `json:"candidatesTokenCount,omitempty"`
- // PromptTokenCount: Number of tokens in the prompt.
+ // PromptTokenCount: Number of tokens in the prompt. When cached_content is
+ // set, this is still the total effective prompt size. I.e. this includes the
+ // number of tokens in the cached content.
PromptTokenCount int64 `json:"promptTokenCount,omitempty"`
// TotalTokenCount: Total token count for the generation request (prompt +
// candidates).
TotalTokenCount int64 `json:"totalTokenCount,omitempty"`
- // ForceSendFields is a list of field names (e.g. "CandidatesTokenCount") to
+ // ForceSendFields is a list of field names (e.g. "CachedContentTokenCount") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
- // NullFields is a list of field names (e.g. "CandidatesTokenCount") to include
- // in API requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. See
+ // NullFields is a list of field names (e.g. "CachedContentTokenCount") to
+ // include in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
-func (s *UsageMetadata) MarshalJSON() ([]byte, error) {
+func (s UsageMetadata) MarshalJSON() ([]byte, error) {
type NoMethod UsageMetadata
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// VideoMetadata: Metadata for a video `File`.
@@ -3907,9 +4123,556 @@ type VideoMetadata struct {
NullFields []string `json:"-"`
}
-func (s *VideoMetadata) MarshalJSON() ([]byte, error) {
+func (s VideoMetadata) MarshalJSON() ([]byte, error) {
type NoMethod VideoMetadata
- return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+ return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
+}
+
+type CachedContentsCreateCall struct {
+ s *Service
+ cachedcontent *CachedContent
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: Creates CachedContent resource.
+func (r *CachedContentsService) Create(cachedcontent *CachedContent) *CachedContentsCreateCall {
+ c := &CachedContentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.cachedcontent = cachedcontent
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *CachedContentsCreateCall) Fields(s ...googleapi.Field) *CachedContentsCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CachedContentsCreateCall) Context(ctx context.Context) *CachedContentsCreateCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *CachedContentsCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CachedContentsCreateCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.cachedcontent)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/cachedContents")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.cachedContents.create" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *CachedContent.ServerResponse.Header or (if a response was returned at all)
+// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
+// whether the returned error was because http.StatusNotModified was returned.
+func (c *CachedContentsCreateCall) Do(opts ...googleapi.CallOption) (*CachedContent, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, gensupport.WrapError(&googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ })
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, gensupport.WrapError(err)
+ }
+ ret := &CachedContent{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+}
+
+type CachedContentsDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes CachedContent resource.
+//
+// - name: The resource name referring to the content cache entry Format:
+// `cachedContents/{id}`.
+func (r *CachedContentsService) Delete(name string) *CachedContentsDeleteCall {
+ c := &CachedContentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *CachedContentsDeleteCall) Fields(s ...googleapi.Field) *CachedContentsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CachedContentsDeleteCall) Context(ctx context.Context) *CachedContentsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *CachedContentsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CachedContentsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("DELETE", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "name": c.name,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.cachedContents.delete" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Empty.ServerResponse.Header or (if a response was returned at all) in
+// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
+// whether the returned error was because http.StatusNotModified was returned.
+func (c *CachedContentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, gensupport.WrapError(&googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ })
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, gensupport.WrapError(err)
+ }
+ ret := &Empty{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+}
+
+type CachedContentsGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Reads CachedContent resource.
+//
+// - name: The resource name referring to the content cache entry. Format:
+// `cachedContents/{id}`.
+func (r *CachedContentsService) Get(name string) *CachedContentsGetCall {
+ c := &CachedContentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *CachedContentsGetCall) Fields(s ...googleapi.Field) *CachedContentsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an optional parameter which makes the operation fail if the
+// object's ETag matches the given value. This is useful for getting updates
+// only after the object has changed since the last request.
+func (c *CachedContentsGetCall) IfNoneMatch(entityTag string) *CachedContentsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CachedContentsGetCall) Context(ctx context.Context) *CachedContentsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *CachedContentsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CachedContentsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "name": c.name,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.cachedContents.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *CachedContent.ServerResponse.Header or (if a response was returned at all)
+// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
+// whether the returned error was because http.StatusNotModified was returned.
+func (c *CachedContentsGetCall) Do(opts ...googleapi.CallOption) (*CachedContent, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, gensupport.WrapError(&googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ })
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, gensupport.WrapError(err)
+ }
+ ret := &CachedContent{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+}
+
+type CachedContentsListCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists CachedContents.
+func (r *CachedContentsService) List() *CachedContentsListCall {
+ c := &CachedContentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": The maximum number of
+// cached contents to return. The service may return fewer than this value. If
+// unspecified, some default (under maximum) number of items will be returned.
+// The maximum value is 1000; values above 1000 will be coerced to 1000.
+func (c *CachedContentsListCall) PageSize(pageSize int64) *CachedContentsListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": A page token, received
+// from a previous `ListCachedContents` call. Provide this to retrieve the
+// subsequent page. When paginating, all other parameters provided to
+// `ListCachedContents` must match the call that provided the page token.
+func (c *CachedContentsListCall) PageToken(pageToken string) *CachedContentsListCall {
+ c.urlParams_.Set("pageToken", pageToken)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *CachedContentsListCall) Fields(s ...googleapi.Field) *CachedContentsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets an optional parameter which makes the operation fail if the
+// object's ETag matches the given value. This is useful for getting updates
+// only after the object has changed since the last request.
+func (c *CachedContentsListCall) IfNoneMatch(entityTag string) *CachedContentsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CachedContentsListCall) Context(ctx context.Context) *CachedContentsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *CachedContentsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CachedContentsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/cachedContents")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("GET", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.cachedContents.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListCachedContentsResponse.ServerResponse.Header or (if a response was
+// returned at all) in error.(*googleapi.Error).Header. Use
+// googleapi.IsNotModified to check whether the returned error was because
+// http.StatusNotModified was returned.
+func (c *CachedContentsListCall) Do(opts ...googleapi.CallOption) (*ListCachedContentsResponse, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, gensupport.WrapError(&googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ })
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, gensupport.WrapError(err)
+ }
+ ret := &ListCachedContentsResponse{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
+}
+
+// Pages invokes f for each page of results.
+// A non-nil error returned from f will halt the iteration.
+// The provided context supersedes any context provided to the Context method.
+func (c *CachedContentsListCall) Pages(ctx context.Context, f func(*ListCachedContentsResponse) error) error {
+ c.ctx_ = ctx
+ defer c.PageToken(c.urlParams_.Get("pageToken"))
+ for {
+ x, err := c.Do()
+ if err != nil {
+ return err
+ }
+ if err := f(x); err != nil {
+ return err
+ }
+ if x.NextPageToken == "" {
+ return nil
+ }
+ c.PageToken(x.NextPageToken)
+ }
+}
+
+type CachedContentsPatchCall struct {
+ s *Service
+ name string
+ cachedcontent *CachedContent
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates CachedContent resource (only expiration is updatable).
+//
+// - name: Optional. Identifier. The resource name referring to the cached
+// content. Format: `cachedContents/{id}`.
+func (r *CachedContentsService) Patch(name string, cachedcontent *CachedContent) *CachedContentsPatchCall {
+ c := &CachedContentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.cachedcontent = cachedcontent
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": The list of fields to
+// update.
+func (c *CachedContentsPatchCall) UpdateMask(updateMask string) *CachedContentsPatchCall {
+ c.urlParams_.Set("updateMask", updateMask)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
+// details.
+func (c *CachedContentsPatchCall) Fields(s ...googleapi.Field) *CachedContentsPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CachedContentsPatchCall) Context(ctx context.Context) *CachedContentsPatchCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns a http.Header that can be modified by the caller to add
+// headers to the request.
+func (c *CachedContentsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CachedContentsPatchCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.cachedcontent)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("PATCH", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "name": c.name,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.cachedContents.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *CachedContent.ServerResponse.Header or (if a response was returned at all)
+// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
+// whether the returned error was because http.StatusNotModified was returned.
+func (c *CachedContentsPatchCall) Do(opts ...googleapi.CallOption) (*CachedContent, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, gensupport.WrapError(&googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ })
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, gensupport.WrapError(err)
+ }
+ ret := &CachedContent{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := gensupport.DecodeResponse(target, res); err != nil {
+ return nil, err
+ }
+ return ret, nil
}
type CorporaCreateCall struct {
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/version.go b/vendor/github.com/google/generative-ai-go/genai/internal/version.go
index bd549c2b6..c71bf93f9 100644
--- a/vendor/github.com/google/generative-ai-go/genai/internal/version.go
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/version.go
@@ -5,4 +5,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "0.13.0"
+const Version = "0.17.0"
diff --git a/vendor/github.com/google/generative-ai-go/genai/option.go b/vendor/github.com/google/generative-ai-go/genai/option.go
new file mode 100644
index 000000000..55278652b
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/option.go
@@ -0,0 +1,44 @@
+// Copyright 2024 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 genai
+
+import (
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+)
+
+// WithClientInfo sets request information identifying the
+// product that is calling this client.
+func WithClientInfo(key, value string) option.ClientOption {
+ return &clientInfo{key: key, value: value}
+}
+
+type clientInfo struct {
+ internaloption.EmbeddableAdapter
+ key, value string
+}
+
+// optionOfType returns the first value of opts that has type T,
+// along with true. If there is no option of that type, it returns
+// the zero value for T and false.
+func optionOfType[T option.ClientOption](opts []option.ClientOption) (T, bool) {
+ for _, opt := range opts {
+ if opt, ok := opt.(T); ok {
+ return opt, true
+ }
+ }
+ var z T
+ return z, false
+}
diff --git a/vendor/github.com/google/generative-ai-go/internal/support/support.go b/vendor/github.com/google/generative-ai-go/internal/support/support.go
deleted file mode 100644
index e9f4b4547..000000000
--- a/vendor/github.com/google/generative-ai-go/internal/support/support.go
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2024 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 support provides support functions for protoveneer.
-package support
-
-import (
- "fmt"
- "time"
-
- "cloud.google.com/go/civil"
- "google.golang.org/genproto/googleapis/type/date"
- "google.golang.org/protobuf/types/known/structpb"
- "google.golang.org/protobuf/types/known/timestamppb"
-)
-
-// TransformSlice applies f to each element of from and returns
-// a new slice with the results.
-func TransformSlice[From, To any](from []From, f func(From) To) []To {
- if from == nil {
- return nil
- }
- to := make([]To, len(from))
- for i, e := range from {
- to[i] = f(e)
- }
- return to
-}
-
-// TransformMapValues applies f to each value of from, returning a new map.
-// It does not change the keys.
-func TransformMapValues[K comparable, VFrom, VTo any](from map[K]VFrom, f func(VFrom) VTo) map[K]VTo {
- if from == nil {
- return nil
- }
- to := map[K]VTo{}
- for k, v := range from {
- to[k] = f(v)
- }
- return to
-}
-
-// AddrOrNil returns nil if x is the zero value for T,
-// or &x otherwise.
-func AddrOrNil[T comparable](x T) *T {
- var z T
- if x == z {
- return nil
- }
- return &x
-}
-
-// DerefOrZero returns the zero value for T if x is nil,
-// or *x otherwise.
-func DerefOrZero[T any](x *T) T {
- if x == nil {
- var z T
- return z
- }
- return *x
-}
-
-// CivilDateToProto converts a civil.Date to a date.Date.
-func CivilDateToProto(d civil.Date) *date.Date {
- return &date.Date{
- Year: int32(d.Year),
- Month: int32(d.Month),
- Day: int32(d.Day),
- }
-}
-
-// CivilDateFromProto converts a date.Date to a civil.Date.
-func CivilDateFromProto(p *date.Date) civil.Date {
- if p == nil {
- return civil.Date{}
- }
- return civil.Date{
- Year: int(p.Year),
- Month: time.Month(p.Month),
- Day: int(p.Day),
- }
-}
-
-// MapToStructPB converts a map into a structpb.Struct.
-func MapToStructPB(m map[string]any) *structpb.Struct {
- if m == nil {
- return nil
- }
- s, err := structpb.NewStruct(m)
- if err != nil {
- panic(fmt.Errorf("support.MapToProto: %w", err))
- }
- return s
-}
-
-// MapFromStructPB converts a structpb.Struct to a map.
-func MapFromStructPB(p *structpb.Struct) map[string]any {
- if p == nil {
- return nil
- }
- return p.AsMap()
-}
-
-// TimeFromProto converts a Timestamp into a time.Time.
-func TimeFromProto(ts *timestamppb.Timestamp) time.Time {
- if ts == nil {
- return time.Time{}
- }
- return ts.AsTime()
-}
diff --git a/vendor/github.com/google/pprof/profile/encode.go b/vendor/github.com/google/pprof/profile/encode.go
index 182c926b9..860bb304c 100644
--- a/vendor/github.com/google/pprof/profile/encode.go
+++ b/vendor/github.com/google/pprof/profile/encode.go
@@ -530,6 +530,7 @@ func (p *Line) decoder() []decoder {
func (p *Line) encode(b *buffer) {
encodeUint64Opt(b, 1, p.functionIDX)
encodeInt64Opt(b, 2, p.Line)
+ encodeInt64Opt(b, 3, p.Column)
}
var lineDecoder = []decoder{
@@ -538,6 +539,8 @@ var lineDecoder = []decoder{
func(b *buffer, m message) error { return decodeUint64(b, &m.(*Line).functionIDX) },
// optional int64 line = 2
func(b *buffer, m message) error { return decodeInt64(b, &m.(*Line).Line) },
+ // optional int64 column = 3
+ func(b *buffer, m message) error { return decodeInt64(b, &m.(*Line).Column) },
}
func (p *Function) decoder() []decoder {
diff --git a/vendor/github.com/google/pprof/profile/legacy_java_profile.go b/vendor/github.com/google/pprof/profile/legacy_java_profile.go
index 91f45e53c..4580bab18 100644
--- a/vendor/github.com/google/pprof/profile/legacy_java_profile.go
+++ b/vendor/github.com/google/pprof/profile/legacy_java_profile.go
@@ -56,7 +56,7 @@ func javaCPUProfile(b []byte, period int64, parse func(b []byte) (uint64, []byte
}
// Strip out addresses for better merge.
- if err = p.Aggregate(true, true, true, true, false); err != nil {
+ if err = p.Aggregate(true, true, true, true, false, false); err != nil {
return nil, err
}
@@ -99,7 +99,7 @@ func parseJavaProfile(b []byte) (*Profile, error) {
}
// Strip out addresses for better merge.
- if err = p.Aggregate(true, true, true, true, false); err != nil {
+ if err = p.Aggregate(true, true, true, true, false, false); err != nil {
return nil, err
}
diff --git a/vendor/github.com/google/pprof/profile/merge.go b/vendor/github.com/google/pprof/profile/merge.go
index 4b66282cb..eee0132e7 100644
--- a/vendor/github.com/google/pprof/profile/merge.go
+++ b/vendor/github.com/google/pprof/profile/merge.go
@@ -326,12 +326,13 @@ func (l *Location) key() locationKey {
key.addr -= l.Mapping.Start
key.mappingID = l.Mapping.ID
}
- lines := make([]string, len(l.Line)*2)
+ lines := make([]string, len(l.Line)*3)
for i, line := range l.Line {
if line.Function != nil {
lines[i*2] = strconv.FormatUint(line.Function.ID, 16)
}
lines[i*2+1] = strconv.FormatInt(line.Line, 16)
+ lines[i*2+2] = strconv.FormatInt(line.Column, 16)
}
key.lines = strings.Join(lines, "|")
return key
@@ -418,6 +419,7 @@ func (pm *profileMerger) mapLine(src Line) Line {
ln := Line{
Function: pm.mapFunction(src.Function),
Line: src.Line,
+ Column: src.Column,
}
return ln
}
diff --git a/vendor/github.com/google/pprof/profile/profile.go b/vendor/github.com/google/pprof/profile/profile.go
index 60ef7e926..5551eb0bf 100644
--- a/vendor/github.com/google/pprof/profile/profile.go
+++ b/vendor/github.com/google/pprof/profile/profile.go
@@ -145,6 +145,7 @@ type Location struct {
type Line struct {
Function *Function
Line int64
+ Column int64
functionIDX uint64
}
@@ -436,7 +437,7 @@ func (p *Profile) CheckValid() error {
// Aggregate merges the locations in the profile into equivalence
// classes preserving the request attributes. It also updates the
// samples to point to the merged locations.
-func (p *Profile) Aggregate(inlineFrame, function, filename, linenumber, address bool) error {
+func (p *Profile) Aggregate(inlineFrame, function, filename, linenumber, columnnumber, address bool) error {
for _, m := range p.Mapping {
m.HasInlineFrames = m.HasInlineFrames && inlineFrame
m.HasFunctions = m.HasFunctions && function
@@ -458,7 +459,7 @@ func (p *Profile) Aggregate(inlineFrame, function, filename, linenumber, address
}
// Aggregate locations
- if !inlineFrame || !address || !linenumber {
+ if !inlineFrame || !address || !linenumber || !columnnumber {
for _, l := range p.Location {
if !inlineFrame && len(l.Line) > 1 {
l.Line = l.Line[len(l.Line)-1:]
@@ -466,6 +467,12 @@ func (p *Profile) Aggregate(inlineFrame, function, filename, linenumber, address
if !linenumber {
for i := range l.Line {
l.Line[i].Line = 0
+ l.Line[i].Column = 0
+ }
+ }
+ if !columnnumber {
+ for i := range l.Line {
+ l.Line[i].Column = 0
}
}
if !address {
@@ -627,10 +634,11 @@ func (l *Location) string() string {
for li := range l.Line {
lnStr := "??"
if fn := l.Line[li].Function; fn != nil {
- lnStr = fmt.Sprintf("%s %s:%d s=%d",
+ lnStr = fmt.Sprintf("%s %s:%d:%d s=%d",
fn.Name,
fn.Filename,
l.Line[li].Line,
+ l.Line[li].Column,
fn.StartLine)
if fn.Name != fn.SystemName {
lnStr = lnStr + "(" + fn.SystemName + ")"
@@ -839,7 +847,7 @@ func (p *Profile) HasFileLines() bool {
// "[vdso]", [vsyscall]" and some others, see the code.
func (m *Mapping) Unsymbolizable() bool {
name := filepath.Base(m.File)
- return strings.HasPrefix(name, "[") || strings.HasPrefix(name, "linux-vdso") || strings.HasPrefix(m.File, "/dev/dri/")
+ return strings.HasPrefix(name, "[") || strings.HasPrefix(name, "linux-vdso") || strings.HasPrefix(m.File, "/dev/dri/") || m.File == "//anon"
}
// Copy makes a fully independent copy of a profile.
diff --git a/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go b/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go
index 16278a1d9..fcd049de9 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/common/common.proto
@@ -145,8 +145,8 @@ type Identity struct {
// *Identity_SpiffeId
// *Identity_Hostname
// *Identity_Uid
- // *Identity_MdbUsername
- // *Identity_GaiaId
+ // *Identity_Username
+ // *Identity_GcpId
IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"`
// Additional identity-specific attributes.
Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
@@ -212,16 +212,16 @@ func (x *Identity) GetUid() string {
return ""
}
-func (x *Identity) GetMdbUsername() string {
- if x, ok := x.GetIdentityOneof().(*Identity_MdbUsername); ok {
- return x.MdbUsername
+func (x *Identity) GetUsername() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Username); ok {
+ return x.Username
}
return ""
}
-func (x *Identity) GetGaiaId() string {
- if x, ok := x.GetIdentityOneof().(*Identity_GaiaId); ok {
- return x.GaiaId
+func (x *Identity) GetGcpId() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_GcpId); ok {
+ return x.GcpId
}
return ""
}
@@ -252,14 +252,14 @@ type Identity_Uid struct {
Uid string `protobuf:"bytes,4,opt,name=uid,proto3,oneof"`
}
-type Identity_MdbUsername struct {
- // The MDB username of a connection endpoint.
- MdbUsername string `protobuf:"bytes,5,opt,name=mdb_username,json=mdbUsername,proto3,oneof"`
+type Identity_Username struct {
+ // The username of a connection endpoint.
+ Username string `protobuf:"bytes,5,opt,name=username,proto3,oneof"`
}
-type Identity_GaiaId struct {
- // The Gaia ID of a connection endpoint.
- GaiaId string `protobuf:"bytes,6,opt,name=gaia_id,json=gaiaId,proto3,oneof"`
+type Identity_GcpId struct {
+ // The GCP ID of a connection endpoint.
+ GcpId string `protobuf:"bytes,6,opt,name=gcp_id,json=gcpId,proto3,oneof"`
}
func (*Identity_SpiffeId) isIdentity_IdentityOneof() {}
@@ -268,9 +268,9 @@ func (*Identity_Hostname) isIdentity_IdentityOneof() {}
func (*Identity_Uid) isIdentity_IdentityOneof() {}
-func (*Identity_MdbUsername) isIdentity_IdentityOneof() {}
+func (*Identity_Username) isIdentity_IdentityOneof() {}
-func (*Identity_GaiaId) isIdentity_IdentityOneof() {}
+func (*Identity_GcpId) isIdentity_IdentityOneof() {}
var File_internal_proto_common_common_proto protoreflect.FileDescriptor
@@ -278,38 +278,37 @@ var file_internal_proto_common_common_proto_rawDesc = []byte{
0x0a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0xb1, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09,
+ 0xa8, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09,
0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48,
0x00, 0x52, 0x08, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x68,
0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x03, 0x75, 0x69, 0x64,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x23, 0x0a,
- 0x0c, 0x6d, 0x64, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x64, 0x62, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61,
- 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x07, 0x67, 0x61, 0x69, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20,
- 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x67, 0x61, 0x69, 0x61, 0x49, 0x64, 0x12, 0x43, 0x0a,
- 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64,
- 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
- 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
- 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
- 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
- 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e,
- 0x65, 0x6f, 0x66, 0x2a, 0x5b, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69,
- 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43,
- 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45,
- 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34,
- 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50,
- 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02,
- 0x2a, 0x24, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a,
- 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x32, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c,
- 0x53, 0x31, 0x5f, 0x33, 0x10, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
- 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f,
- 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63,
- 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a,
+ 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48,
+ 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x06, 0x67,
+ 0x63, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x67,
+ 0x63, 0x70, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
+ 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
+ 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
+ 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e,
+ 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0x5b, 0x0a, 0x0b, 0x43, 0x69,
+ 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53,
+ 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10,
+ 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d,
+ 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41,
+ 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53,
+ 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, 0x2a, 0x24, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x32, 0x10,
+ 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x33, 0x10, 0x01, 0x42, 0x36, 0x5a,
+ 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -326,7 +325,7 @@ func file_internal_proto_common_common_proto_rawDescGZIP() []byte {
var file_internal_proto_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_internal_proto_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
-var file_internal_proto_common_common_proto_goTypes = []interface{}{
+var file_internal_proto_common_common_proto_goTypes = []any{
(Ciphersuite)(0), // 0: s2a.proto.Ciphersuite
(TLSVersion)(0), // 1: s2a.proto.TLSVersion
(*Identity)(nil), // 2: s2a.proto.Identity
@@ -347,7 +346,7 @@ func file_internal_proto_common_common_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_common_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Identity); i {
case 0:
return &v.state
@@ -360,12 +359,12 @@ func file_internal_proto_common_common_proto_init() {
}
}
}
- file_internal_proto_common_common_proto_msgTypes[0].OneofWrappers = []interface{}{
+ file_internal_proto_common_common_proto_msgTypes[0].OneofWrappers = []any{
(*Identity_SpiffeId)(nil),
(*Identity_Hostname)(nil),
(*Identity_Uid)(nil),
- (*Identity_MdbUsername)(nil),
- (*Identity_GaiaId)(nil),
+ (*Identity_Username)(nil),
+ (*Identity_GcpId)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
diff --git a/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go b/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go
index f4f763ae1..2af3ee3dc 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/s2a_context/s2a_context.proto
@@ -209,7 +209,7 @@ func file_internal_proto_s2a_context_s2a_context_proto_rawDescGZIP() []byte {
}
var file_internal_proto_s2a_context_s2a_context_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
-var file_internal_proto_s2a_context_s2a_context_proto_goTypes = []interface{}{
+var file_internal_proto_s2a_context_s2a_context_proto_goTypes = []any{
(*S2AContext)(nil), // 0: s2a.proto.S2AContext
(common_go_proto.TLSVersion)(0), // 1: s2a.proto.TLSVersion
(common_go_proto.Ciphersuite)(0), // 2: s2a.proto.Ciphersuite
@@ -233,7 +233,7 @@ func file_internal_proto_s2a_context_s2a_context_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*S2AContext); i {
case 0:
return &v.state
diff --git a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go
index 0a86ebee5..8919232fd 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/s2a/s2a.proto
@@ -1171,7 +1171,7 @@ func file_internal_proto_s2a_s2a_proto_rawDescGZIP() []byte {
}
var file_internal_proto_s2a_s2a_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
-var file_internal_proto_s2a_s2a_proto_goTypes = []interface{}{
+var file_internal_proto_s2a_s2a_proto_goTypes = []any{
(*AuthenticationMechanism)(nil), // 0: s2a.proto.AuthenticationMechanism
(*ClientSessionStartReq)(nil), // 1: s2a.proto.ClientSessionStartReq
(*ServerSessionStartReq)(nil), // 2: s2a.proto.ServerSessionStartReq
@@ -1226,7 +1226,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_s2a_s2a_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*AuthenticationMechanism); i {
case 0:
return &v.state
@@ -1238,7 +1238,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ClientSessionStartReq); i {
case 0:
return &v.state
@@ -1250,7 +1250,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ServerSessionStartReq); i {
case 0:
return &v.state
@@ -1262,7 +1262,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*SessionNextReq); i {
case 0:
return &v.state
@@ -1274,7 +1274,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ResumptionTicketReq); i {
case 0:
return &v.state
@@ -1286,7 +1286,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*SessionReq); i {
case 0:
return &v.state
@@ -1298,7 +1298,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*SessionState); i {
case 0:
return &v.state
@@ -1310,7 +1310,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*SessionResult); i {
case 0:
return &v.state
@@ -1322,7 +1322,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*SessionStatus); i {
case 0:
return &v.state
@@ -1334,7 +1334,7 @@ func file_internal_proto_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_s2a_s2a_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*SessionResp); i {
case 0:
return &v.state
@@ -1347,10 +1347,10 @@ func file_internal_proto_s2a_s2a_proto_init() {
}
}
}
- file_internal_proto_s2a_s2a_proto_msgTypes[0].OneofWrappers = []interface{}{
+ file_internal_proto_s2a_s2a_proto_msgTypes[0].OneofWrappers = []any{
(*AuthenticationMechanism_Token)(nil),
}
- file_internal_proto_s2a_s2a_proto_msgTypes[5].OneofWrappers = []interface{}{
+ file_internal_proto_s2a_s2a_proto_msgTypes[5].OneofWrappers = []any{
(*SessionReq_ClientStart)(nil),
(*SessionReq_ServerStart)(nil),
(*SessionReq_Next)(nil),
diff --git a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go
index 0fa582fc8..8fac3841b 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
-// - protoc-gen-go-grpc v1.3.0
+// - protoc-gen-go-grpc v1.4.0
// - protoc v3.21.12
// source: internal/proto/s2a/s2a.proto
@@ -29,8 +29,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.32.0 or later.
-const _ = grpc.SupportPackageIsVersion7
+// Requires gRPC-Go v1.62.0 or later.
+const _ = grpc.SupportPackageIsVersion8
const (
S2AService_SetUpSession_FullMethodName = "/s2a.proto.S2AService/SetUpSession"
@@ -61,11 +61,12 @@ func NewS2AServiceClient(cc grpc.ClientConnInterface) S2AServiceClient {
}
func (c *s2AServiceClient) SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) {
- stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, opts...)
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
- x := &s2AServiceSetUpSessionClient{stream}
+ x := &s2AServiceSetUpSessionClient{ClientStream: stream}
return x, nil
}
@@ -129,7 +130,7 @@ func RegisterS2AServiceServer(s grpc.ServiceRegistrar, srv S2AServiceServer) {
}
func _S2AService_SetUpSession_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{stream})
+ return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{ServerStream: stream})
}
type S2AService_SetUpSessionServer interface {
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go
index c84bed977..e9aa5d14c 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/v2/common/common.proto
@@ -256,62 +256,218 @@ func (AlpnProtocol) EnumDescriptor() ([]byte, []int) {
return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{3}
}
+type Identity struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Types that are assignable to IdentityOneof:
+ //
+ // *Identity_SpiffeId
+ // *Identity_Hostname
+ // *Identity_Uid
+ // *Identity_Username
+ // *Identity_GcpId
+ IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"`
+ // Additional identity-specific attributes.
+ Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+}
+
+func (x *Identity) Reset() {
+ *x = Identity{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_internal_proto_v2_common_common_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Identity) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Identity) ProtoMessage() {}
+
+func (x *Identity) ProtoReflect() protoreflect.Message {
+ mi := &file_internal_proto_v2_common_common_proto_msgTypes[0]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use Identity.ProtoReflect.Descriptor instead.
+func (*Identity) Descriptor() ([]byte, []int) {
+ return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{0}
+}
+
+func (m *Identity) GetIdentityOneof() isIdentity_IdentityOneof {
+ if m != nil {
+ return m.IdentityOneof
+ }
+ return nil
+}
+
+func (x *Identity) GetSpiffeId() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_SpiffeId); ok {
+ return x.SpiffeId
+ }
+ return ""
+}
+
+func (x *Identity) GetHostname() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Hostname); ok {
+ return x.Hostname
+ }
+ return ""
+}
+
+func (x *Identity) GetUid() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Uid); ok {
+ return x.Uid
+ }
+ return ""
+}
+
+func (x *Identity) GetUsername() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_Username); ok {
+ return x.Username
+ }
+ return ""
+}
+
+func (x *Identity) GetGcpId() string {
+ if x, ok := x.GetIdentityOneof().(*Identity_GcpId); ok {
+ return x.GcpId
+ }
+ return ""
+}
+
+func (x *Identity) GetAttributes() map[string]string {
+ if x != nil {
+ return x.Attributes
+ }
+ return nil
+}
+
+type isIdentity_IdentityOneof interface {
+ isIdentity_IdentityOneof()
+}
+
+type Identity_SpiffeId struct {
+ // The SPIFFE ID of a connection endpoint.
+ SpiffeId string `protobuf:"bytes,1,opt,name=spiffe_id,json=spiffeId,proto3,oneof"`
+}
+
+type Identity_Hostname struct {
+ // The hostname of a connection endpoint.
+ Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3,oneof"`
+}
+
+type Identity_Uid struct {
+ // The UID of a connection endpoint.
+ Uid string `protobuf:"bytes,4,opt,name=uid,proto3,oneof"`
+}
+
+type Identity_Username struct {
+ // The username of a connection endpoint.
+ Username string `protobuf:"bytes,5,opt,name=username,proto3,oneof"`
+}
+
+type Identity_GcpId struct {
+ // The GCP ID of a connection endpoint.
+ GcpId string `protobuf:"bytes,6,opt,name=gcp_id,json=gcpId,proto3,oneof"`
+}
+
+func (*Identity_SpiffeId) isIdentity_IdentityOneof() {}
+
+func (*Identity_Hostname) isIdentity_IdentityOneof() {}
+
+func (*Identity_Uid) isIdentity_IdentityOneof() {}
+
+func (*Identity_Username) isIdentity_IdentityOneof() {}
+
+func (*Identity_GcpId) isIdentity_IdentityOneof() {}
+
var File_internal_proto_v2_common_common_proto protoreflect.FileDescriptor
var file_internal_proto_v2_common_common_proto_rawDesc = []byte{
0x0a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2a, 0xee, 0x02, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72,
- 0x73, 0x75, 0x69, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53,
- 0x55, 0x49, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
- 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54,
- 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49,
- 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53,
- 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45,
- 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44,
- 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f,
- 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x39, 0x0a, 0x35,
- 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48,
- 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41,
- 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53,
- 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, 0x50, 0x48, 0x45,
- 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41,
- 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43,
- 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49,
+ 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x22, 0xab, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69,
+ 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49,
+ 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12,
+ 0x12, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03,
+ 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d,
+ 0x65, 0x12, 0x17, 0x0a, 0x06, 0x67, 0x63, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28,
+ 0x09, 0x48, 0x00, 0x52, 0x05, 0x67, 0x63, 0x70, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
+ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
+ 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e,
+ 0x65, 0x6f, 0x66, 0x2a, 0xee, 0x02, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75,
+ 0x69, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49,
+ 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f,
+ 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48,
+ 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41,
+ 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53,
+ 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41,
+ 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43,
+ 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x39, 0x0a, 0x35, 0x43, 0x49,
0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f,
- 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36,
- 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x37, 0x0a,
- 0x33, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44,
- 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, 0x43,
- 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48,
- 0x41, 0x32, 0x35, 0x36, 0x10, 0x06, 0x2a, 0x7d, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53,
- 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
- 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e,
- 0x5f, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45,
- 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54,
- 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x32, 0x10, 0x03,
- 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f,
- 0x31, 0x5f, 0x33, 0x10, 0x04, 0x2a, 0x69, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4e, 0x4e, 0x45,
- 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
- 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e,
- 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45,
- 0x4e, 0x54, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x49,
- 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02,
- 0x2a, 0x79, 0x0a, 0x0c, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
- 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f,
- 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x16, 0x0a, 0x12, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c,
- 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x50, 0x4e, 0x5f,
- 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x32, 0x10, 0x02,
- 0x12, 0x19, 0x0a, 0x15, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f,
- 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x31, 0x5f, 0x31, 0x10, 0x03, 0x42, 0x39, 0x5a, 0x37, 0x67,
- 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f,
- 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, 0x43, 0x48,
+ 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, 0x41,
+ 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53,
+ 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x57,
+ 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f,
+ 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, 0x50, 0x48,
+ 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x52, 0x53,
+ 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47,
+ 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x37, 0x0a, 0x33, 0x43,
+ 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45,
+ 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41,
+ 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, 0x41, 0x32,
+ 0x35, 0x36, 0x10, 0x06, 0x2a, 0x7d, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f,
+ 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
+ 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31,
+ 0x5f, 0x30, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53,
+ 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53,
+ 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x32, 0x10, 0x03, 0x12, 0x13,
+ 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f,
+ 0x33, 0x10, 0x04, 0x2a, 0x69, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54,
+ 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43,
+ 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54,
+ 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e,
+ 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, 0x2a, 0x79,
+ 0x0a, 0x0c, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1d,
+ 0x0a, 0x19, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a,
+ 0x12, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x47,
+ 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52,
+ 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x32, 0x10, 0x02, 0x12, 0x19,
+ 0x0a, 0x15, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f,
+ 0x48, 0x54, 0x54, 0x50, 0x31, 0x5f, 0x31, 0x10, 0x03, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74,
+ 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73,
+ 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -327,18 +483,22 @@ func file_internal_proto_v2_common_common_proto_rawDescGZIP() []byte {
}
var file_internal_proto_v2_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
-var file_internal_proto_v2_common_common_proto_goTypes = []interface{}{
+var file_internal_proto_v2_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_internal_proto_v2_common_common_proto_goTypes = []any{
(Ciphersuite)(0), // 0: s2a.proto.v2.Ciphersuite
(TLSVersion)(0), // 1: s2a.proto.v2.TLSVersion
(ConnectionSide)(0), // 2: s2a.proto.v2.ConnectionSide
(AlpnProtocol)(0), // 3: s2a.proto.v2.AlpnProtocol
+ (*Identity)(nil), // 4: s2a.proto.v2.Identity
+ nil, // 5: s2a.proto.v2.Identity.AttributesEntry
}
var file_internal_proto_v2_common_common_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
+ 5, // 0: s2a.proto.v2.Identity.attributes:type_name -> s2a.proto.v2.Identity.AttributesEntry
+ 1, // [1:1] is the sub-list for method output_type
+ 1, // [1:1] is the sub-list for method input_type
+ 1, // [1:1] is the sub-list for extension type_name
+ 1, // [1:1] is the sub-list for extension extendee
+ 0, // [0:1] is the sub-list for field type_name
}
func init() { file_internal_proto_v2_common_common_proto_init() }
@@ -346,19 +506,41 @@ func file_internal_proto_v2_common_common_proto_init() {
if File_internal_proto_v2_common_common_proto != nil {
return
}
+ if !protoimpl.UnsafeEnabled {
+ file_internal_proto_v2_common_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
+ switch v := v.(*Identity); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_internal_proto_v2_common_common_proto_msgTypes[0].OneofWrappers = []any{
+ (*Identity_SpiffeId)(nil),
+ (*Identity_Hostname)(nil),
+ (*Identity_Uid)(nil),
+ (*Identity_Username)(nil),
+ (*Identity_GcpId)(nil),
+ }
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_internal_proto_v2_common_common_proto_rawDesc,
NumEnums: 4,
- NumMessages: 0,
+ NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_internal_proto_v2_common_common_proto_goTypes,
DependencyIndexes: file_internal_proto_v2_common_common_proto_depIdxs,
EnumInfos: file_internal_proto_v2_common_common_proto_enumTypes,
+ MessageInfos: file_internal_proto_v2_common_common_proto_msgTypes,
}.Build()
File_internal_proto_v2_common_common_proto = out.File
file_internal_proto_v2_common_common_proto_rawDesc = nil
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go
index b7fd871c7..418331a4b 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go
@@ -14,14 +14,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/v2/s2a_context/s2a_context.proto
package s2a_context_go_proto
import (
- common_go_proto "github.com/google/s2a-go/internal/proto/common_go_proto"
+ common_go_proto "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -64,7 +64,7 @@ type S2AContext struct {
// certificate chain was NOT validated successfully.
PeerCertificateChainFingerprints []string `protobuf:"bytes,4,rep,name=peer_certificate_chain_fingerprints,json=peerCertificateChainFingerprints,proto3" json:"peer_certificate_chain_fingerprints,omitempty"`
// The local identity used during session setup.
- LocalIdentity *common_go_proto.Identity `protobuf:"bytes,5,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
+ LocalIdentity *common_go_proto.Identity `protobuf:"bytes,9,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
// The SHA256 hash of the DER-encoding of the local leaf certificate used in
// the handshake.
LocalLeafCertFingerprint []byte `protobuf:"bytes,6,opt,name=local_leaf_cert_fingerprint,json=localLeafCertFingerprint,proto3" json:"local_leaf_cert_fingerprint,omitempty"`
@@ -151,35 +151,36 @@ var file_internal_proto_v2_s2a_context_s2a_context_proto_rawDesc = []byte{
0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f,
0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x1a,
- 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x02, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x78, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f,
- 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x53, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49,
- 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x75,
- 0x72, 0x69, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x66, 0x43,
- 0x65, 0x72, 0x74, 0x55, 0x72, 0x69, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65, 0x61, 0x66, 0x5f,
- 0x63, 0x65, 0x72, 0x74, 0x5f, 0x64, 0x6e, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20,
- 0x03, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x44, 0x6e, 0x73,
- 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x23, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65,
- 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f,
- 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03,
- 0x28, 0x09, 0x52, 0x20, 0x70, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72,
- 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64,
- 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73,
- 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
- 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
- 0x12, 0x3d, 0x0a, 0x1b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63,
- 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18,
- 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x18, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x66,
- 0x43, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42,
- 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61,
- 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63,
- 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
+ 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x02, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x43, 0x6f,
+ 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65,
+ 0x72, 0x74, 0x5f, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x53, 0x70, 0x69, 0x66,
+ 0x66, 0x65, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72,
+ 0x74, 0x5f, 0x75, 0x72, 0x69, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x65,
+ 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x55, 0x72, 0x69, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65,
+ 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x64, 0x6e, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x73,
+ 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74,
+ 0x44, 0x6e, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x23, 0x70, 0x65, 0x65, 0x72,
+ 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61,
+ 0x69, 0x6e, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x18,
+ 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x20, 0x70, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69,
+ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65,
+ 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x16, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x49,
+ 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x3d, 0x0a, 0x1b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f,
+ 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72,
+ 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x18, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72,
+ 0x70, 0x72, 0x69, 0x6e, 0x74, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x07, 0x10,
+ 0x08, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x42, 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75,
+ 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61,
+ 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
+ 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x67,
+ 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -195,12 +196,12 @@ func file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescGZIP() []byte {
}
var file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
-var file_internal_proto_v2_s2a_context_s2a_context_proto_goTypes = []interface{}{
+var file_internal_proto_v2_s2a_context_s2a_context_proto_goTypes = []any{
(*S2AContext)(nil), // 0: s2a.proto.v2.S2AContext
- (*common_go_proto.Identity)(nil), // 1: s2a.proto.Identity
+ (*common_go_proto.Identity)(nil), // 1: s2a.proto.v2.Identity
}
var file_internal_proto_v2_s2a_context_s2a_context_proto_depIdxs = []int32{
- 1, // 0: s2a.proto.v2.S2AContext.local_identity:type_name -> s2a.proto.Identity
+ 1, // 0: s2a.proto.v2.S2AContext.local_identity:type_name -> s2a.proto.v2.Identity
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@@ -214,7 +215,7 @@ func file_internal_proto_v2_s2a_context_s2a_context_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*S2AContext); i {
case 0:
return &v.state
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go
index e843450c7..548f31da2 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go
@@ -14,14 +14,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.30.0
+// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: internal/proto/v2/s2a/s2a.proto
package s2a_go_proto
import (
- common_go_proto1 "github.com/google/s2a-go/internal/proto/common_go_proto"
common_go_proto "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2a_context_go_proto "github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -292,6 +291,12 @@ const (
// The connect-to-Google verification mode uses the trust bundle for
// connecting to Google, e.g. *.mtls.googleapis.com endpoints.
ValidatePeerCertificateChainReq_CONNECT_TO_GOOGLE ValidatePeerCertificateChainReq_VerificationMode = 2
+ // Internal use only.
+ ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_3 ValidatePeerCertificateChainReq_VerificationMode = 3
+ // Internal use only.
+ ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_4 ValidatePeerCertificateChainReq_VerificationMode = 4
+ // Internal use only.
+ ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_5 ValidatePeerCertificateChainReq_VerificationMode = 5
)
// Enum value maps for ValidatePeerCertificateChainReq_VerificationMode.
@@ -300,11 +305,17 @@ var (
0: "UNSPECIFIED",
1: "SPIFFE",
2: "CONNECT_TO_GOOGLE",
+ 3: "RESERVED_CUSTOM_VERIFICATION_MODE_3",
+ 4: "RESERVED_CUSTOM_VERIFICATION_MODE_4",
+ 5: "RESERVED_CUSTOM_VERIFICATION_MODE_5",
}
ValidatePeerCertificateChainReq_VerificationMode_value = map[string]int32{
- "UNSPECIFIED": 0,
- "SPIFFE": 1,
- "CONNECT_TO_GOOGLE": 2,
+ "UNSPECIFIED": 0,
+ "SPIFFE": 1,
+ "CONNECT_TO_GOOGLE": 2,
+ "RESERVED_CUSTOM_VERIFICATION_MODE_3": 3,
+ "RESERVED_CUSTOM_VERIFICATION_MODE_4": 4,
+ "RESERVED_CUSTOM_VERIFICATION_MODE_5": 5,
}
)
@@ -454,7 +465,7 @@ type AuthenticationMechanism struct {
// mechanism. Otherwise, S2A assumes that the authentication mechanism is
// associated with the default identity. If the default identity cannot be
// determined, the request is rejected.
- Identity *common_go_proto1.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
+ Identity *common_go_proto.Identity `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"`
// Types that are assignable to MechanismOneof:
//
// *AuthenticationMechanism_Token
@@ -493,7 +504,7 @@ func (*AuthenticationMechanism) Descriptor() ([]byte, []int) {
return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{1}
}
-func (x *AuthenticationMechanism) GetIdentity() *common_go_proto1.Identity {
+func (x *AuthenticationMechanism) GetIdentity() *common_go_proto.Identity {
if x != nil {
return x.Identity
}
@@ -1185,7 +1196,7 @@ type SessionReq struct {
// identity is not populated, S2A will try to deduce the managed identity to
// use from the SNI extension. If that also fails, S2A uses the default
// identity (if one exists).
- LocalIdentity *common_go_proto1.Identity `protobuf:"bytes,1,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
+ LocalIdentity *common_go_proto.Identity `protobuf:"bytes,7,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"`
// The authentication mechanisms that the application wishes to use to
// authenticate to S2A, ordered by preference. S2A will always use the first
// authentication mechanism that matches the managed identity.
@@ -1231,7 +1242,7 @@ func (*SessionReq) Descriptor() ([]byte, []int) {
return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{11}
}
-func (x *SessionReq) GetLocalIdentity() *common_go_proto1.Identity {
+func (x *SessionReq) GetLocalIdentity() *common_go_proto.Identity {
if x != nil {
return x.LocalIdentity
}
@@ -1790,358 +1801,365 @@ var file_internal_proto_v2_s2a_s2a_proto_rawDesc = []byte{
0x0a, 0x1f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x1a,
- 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f,
- 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65,
- 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32,
- 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f,
- 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x0a,
- 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x36, 0x0a, 0x17, 0x65, 0x6e,
- 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x65, 0x6e, 0x61,
- 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x70, 0x6e, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0e, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x32, 0x61,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72,
- 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x0d, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74,
- 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x22, 0x75, 0x0a, 0x17, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d,
- 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49,
- 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74,
- 0x79, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
- 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x6d, 0x65, 0x63,
- 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x36, 0x0a, 0x06,
- 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65,
- 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74,
- 0x61, 0x69, 0x6c, 0x73, 0x22, 0x71, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x45,
- 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x64,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x53, 0x69, 0x64, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x6e, 0x69, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x03, 0x73, 0x6e, 0x69, 0x22, 0xf1, 0x0b, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x54,
- 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6c,
- 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x78, 0x0a,
- 0x18, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
- 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52,
- 0x16, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xcf, 0x02, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65,
+ 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f,
+ 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
+ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x0a, 0x41, 0x6c, 0x70, 0x6e,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x36, 0x0a, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65,
+ 0x5f, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41,
+ 0x6c, 0x70, 0x6e, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41,
+ 0x0a, 0x0e, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73,
+ 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63,
+ 0x6f, 0x6c, 0x52, 0x0d, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
+ 0x73, 0x22, 0x7e, 0x0a, 0x17, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x12, 0x32, 0x0a, 0x08,
+ 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
+ 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48,
+ 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x6d, 0x65, 0x63, 0x68,
+ 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x4a, 0x04, 0x08, 0x01, 0x10,
+ 0x02, 0x22, 0x36, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63,
+ 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12,
+ 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x71, 0x0a, 0x16, 0x47, 0x65, 0x74,
+ 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x71, 0x12, 0x45, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x5f, 0x73, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x73,
+ 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x64, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x6e,
+ 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x6e, 0x69, 0x22, 0xf1, 0x0b, 0x0a,
+ 0x17, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x73, 0x32, 0x61,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73,
+ 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+ 0x70, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
- 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63,
- 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12,
- 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69,
- 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73,
- 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74,
- 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x52, 0x0a, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4a, 0x04, 0x08,
- 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0xfa, 0x06, 0x0a, 0x16, 0x53, 0x65,
- 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
- 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69,
- 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73,
- 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73,
- 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56,
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65,
- 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73,
- 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x32,
- 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65,
- 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75,
- 0x69, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x74, 0x6c, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x75,
- 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x74, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x93, 0x01, 0x0a, 0x1a, 0x72,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x65,
- 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x55, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
- 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69,
- 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
- 0x12, 0x3c, 0x0a, 0x1b, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64,
- 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x61, 0x65, 0x61, 0x64, 0x18,
- 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x6d, 0x61, 0x78, 0x4f, 0x76, 0x65, 0x72, 0x68, 0x65,
- 0x61, 0x64, 0x4f, 0x66, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x65, 0x61, 0x64, 0x12, 0x39,
- 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0b, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, 0x61,
- 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x9e, 0x02, 0x0a, 0x18, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69,
- 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
- 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x4f, 0x4e, 0x54, 0x5f,
- 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43,
- 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x2e, 0x0a, 0x2a,
- 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43,
- 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44,
- 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x02, 0x12, 0x29, 0x0a, 0x25,
- 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43,
- 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x56,
- 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x03, 0x12, 0x3a, 0x0a, 0x36, 0x52, 0x45, 0x51, 0x55, 0x45,
- 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f, 0x43,
- 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54,
- 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46,
- 0x59, 0x10, 0x04, 0x12, 0x35, 0x0a, 0x31, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x41,
- 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e,
- 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x4e,
- 0x44, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05,
- 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x42, 0x13, 0x0a, 0x11, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb0, 0x03, 0x0a, 0x1d,
- 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65,
- 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x5d, 0x0a,
- 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e,
- 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65,
- 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x72,
+ 0x6f, 0x6e, 0x12, 0x78, 0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x6c, 0x73,
+ 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76,
+ 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x16, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xcf, 0x02, 0x0a,
+ 0x16, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69,
+ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03,
+ 0x28, 0x09, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43,
+ 0x68, 0x61, 0x69, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f,
+ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53,
+ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56,
+ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c,
+ 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54,
+ 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c,
+ 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68,
+ 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69,
+ 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65,
+ 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f,
+ 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73,
+ 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0xfa,
+ 0x06, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72,
+ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01,
+ 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+ 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c,
+ 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54,
+ 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c,
+ 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f,
+ 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32,
+ 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78,
+ 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69,
+ 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0e,
+ 0x32, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e,
+ 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70,
+ 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x74, 0x6c, 0x73,
+ 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x74, 0x6c, 0x73, 0x52, 0x65,
+ 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12,
+ 0x93, 0x01, 0x0a, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x07,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x55, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76,
+ 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x18, 0x72, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
+ 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x1b, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x76, 0x65,
+ 0x72, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f,
+ 0x61, 0x65, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x6d, 0x61, 0x78, 0x4f,
+ 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x4f, 0x66, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x41,
+ 0x65, 0x61, 0x64, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x52, 0x0a, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x9e,
+ 0x02, 0x0a, 0x18, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f,
+ 0x44, 0x4f, 0x4e, 0x54, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49,
+ 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10,
+ 0x01, 0x12, 0x2e, 0x0a, 0x2a, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49,
+ 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f,
+ 0x42, 0x55, 0x54, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10,
+ 0x02, 0x12, 0x29, 0x0a, 0x25, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49,
+ 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f,
+ 0x41, 0x4e, 0x44, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x03, 0x12, 0x3a, 0x0a, 0x36,
+ 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55,
+ 0x49, 0x52, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49,
+ 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x5f,
+ 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x04, 0x12, 0x35, 0x0a, 0x31, 0x52, 0x45, 0x51, 0x55,
+ 0x45, 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f,
+ 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41,
+ 0x54, 0x45, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x05, 0x4a,
+ 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x42, 0x13, 0x0a, 0x11, 0x74,
+ 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x22, 0xb0, 0x03, 0x0a, 0x1d, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76,
+ 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x71, 0x12, 0x5d, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76,
+ 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x71, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x51, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61,
+ 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20,
+ 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69,
+ 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d,
+ 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72,
+ 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65,
+ 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79,
+ 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x64, 0x69,
+ 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68,
+ 0x61, 0x32, 0x35, 0x36, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68,
+ 0x61, 0x33, 0x38, 0x34, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28,
+ 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x44, 0x69, 0x67, 0x65, 0x73,
+ 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x5f, 0x64, 0x69, 0x67, 0x65,
+ 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x35,
+ 0x31, 0x32, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76,
+ 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12,
+ 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x08, 0x0a, 0x04, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45,
+ 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x02, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79,
+ 0x74, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x1e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72,
0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x13,
- 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69,
- 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x32, 0x61, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
- 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x12, 0x73, 0x69, 0x67,
- 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12,
- 0x1d, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x25,
- 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x44,
- 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x5f,
- 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c,
- 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d,
- 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20,
- 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x44, 0x69, 0x67,
- 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65,
- 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e,
- 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53,
- 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54,
- 0x10, 0x02, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x3d,
- 0x0a, 0x1e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65,
- 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
- 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe7, 0x01,
- 0x0a, 0x20, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x71, 0x12, 0x63, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75,
- 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e,
- 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70,
- 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79,
- 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74,
- 0x65, 0x73, 0x22, 0x43, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e,
- 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b,
- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a,
- 0x07, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45,
- 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x02, 0x22, 0x40, 0x0a, 0x21, 0x4f, 0x66, 0x66, 0x6c, 0x6f,
- 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f,
- 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x09,
- 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52,
- 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xf8, 0x04, 0x0a, 0x1f, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66,
- 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x52, 0x0a,
- 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x73, 0x32,
+ 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74,
+ 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74,
+ 0x65, 0x73, 0x22, 0xe7, 0x01, 0x0a, 0x20, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65,
+ 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x63, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x73, 0x32, 0x61,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61,
+ 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08,
+ 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07,
+ 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x75, 0x6d,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
+ 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x01, 0x12,
+ 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x02, 0x22, 0x40, 0x0a, 0x21,
+ 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f,
+ 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+ 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xf4,
+ 0x05, 0x0a, 0x1f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43,
+ 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52,
+ 0x65, 0x71, 0x12, 0x52, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
+ 0x32, 0x3e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74,
+ 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e,
+ 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65,
+ 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32,
0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
- 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66,
- 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64,
- 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x65, 0x72,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65,
- 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61,
- 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72,
- 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x5b,
- 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43,
- 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52,
- 0x65, 0x71, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x48, 0x00, 0x52,
- 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0a, 0x43,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72,
- 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01,
- 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
- 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x1a, 0xb5, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65,
- 0x72, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c,
- 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61,
- 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73,
- 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x72,
- 0x76, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x25, 0x73,
- 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x73, 0x74,
- 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x22, 0x73, 0x65, 0x72, 0x69,
- 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74,
- 0x65, 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x46,
- 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f,
- 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
- 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, 0x10, 0x01, 0x12,
- 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x47, 0x4f,
- 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x0c, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6f,
- 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xb2, 0x02, 0x0a, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
- 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
- 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, 0x11, 0x76, 0x61, 0x6c,
- 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72,
- 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e,
- 0x52, 0x65, 0x73, 0x70, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44,
- 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78,
- 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78,
- 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3d, 0x0a, 0x10, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0f,
- 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07,
- 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x22, 0x97, 0x05, 0x0a, 0x0a, 0x53, 0x65,
- 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61,
- 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65,
- 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e,
- 0x74, 0x69, 0x74, 0x79, 0x12, 0x62, 0x0a, 0x19, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d,
- 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x52, 0x18,
- 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65,
- 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x12, 0x61, 0x0a, 0x19, 0x67, 0x65, 0x74, 0x5f,
- 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x32,
- 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c,
- 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
- 0x71, 0x48, 0x00, 0x52, 0x16, 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x77, 0x0a, 0x21, 0x6f,
- 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b,
- 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69,
- 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1d, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72,
- 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
- 0x6e, 0x52, 0x65, 0x71, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64,
- 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f,
- 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x20, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65,
+ 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e,
+ 0x74, 0x50, 0x65, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50,
+ 0x65, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x65,
+ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
+ 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43,
+ 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65,
+ 0x65, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72,
+ 0x1a, 0x39, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b,
+ 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68,
+ 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69,
+ 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x1a, 0xb5, 0x01, 0x0a, 0x0a,
+ 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65,
+ 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18,
+ 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65,
+ 0x72, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65,
+ 0x12, 0x51, 0x0a, 0x25, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75,
+ 0x6e, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52,
+ 0x22, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x73,
+ 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c,
+ 0x69, 0x63, 0x79, 0x22, 0xc1, 0x01, 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x50, 0x49,
+ 0x46, 0x46, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54,
+ 0x5f, 0x54, 0x4f, 0x5f, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x27, 0x0a, 0x23,
+ 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x44, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f,
+ 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44,
+ 0x45, 0x5f, 0x33, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45,
+ 0x44, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43,
+ 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x34, 0x10, 0x04, 0x12, 0x27,
+ 0x0a, 0x23, 0x52, 0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x44, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f,
+ 0x4d, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d,
+ 0x4f, 0x44, 0x45, 0x5f, 0x35, 0x10, 0x05, 0x42, 0x0c, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f,
+ 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xb2, 0x02, 0x0a, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
+ 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+ 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, 0x11, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65,
+ 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69,
+ 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+ 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65,
+ 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3d, 0x0a, 0x10, 0x56,
+ 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
+ 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a,
+ 0x07, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x22, 0xa0, 0x05, 0x0a, 0x0a, 0x53,
+ 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x0e, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32,
+ 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x62, 0x0a, 0x19, 0x61, 0x75, 0x74, 0x68,
+ 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61,
+ 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32,
+ 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65,
+ 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69,
+ 0x73, 0x6d, 0x52, 0x18, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x12, 0x61, 0x0a, 0x19,
+ 0x67, 0x65, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x24, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
+ 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x16, 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12,
+ 0x77, 0x0a, 0x21, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61,
+ 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x5f, 0x72, 0x65, 0x71, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x73, 0x32, 0x61,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61,
+ 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1d, 0x6f, 0x66, 0x66, 0x6c, 0x6f,
+ 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x6f, 0x66, 0x66,
+ 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
+ 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65,
+ 0x71, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65,
0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x7d, 0x0a, 0x23, 0x76, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72,
- 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e,
- 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50,
- 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68,
- 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x5f, 0x6f, 0x6e,
- 0x65, 0x6f, 0x66, 0x22, 0xb4, 0x04, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x12, 0x64, 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x17,
- 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x7a, 0x0a, 0x22, 0x6f, 0x66, 0x66, 0x6c, 0x6f,
- 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f,
- 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74,
- 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
- 0x70, 0x48, 0x00, 0x52, 0x1e, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76,
- 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x65, 0x73, 0x70, 0x12, 0x83, 0x01, 0x0a, 0x25, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f,
- 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f,
- 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x21, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52,
- 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72,
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x76, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74,
- 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65,
- 0x73, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x20, 0x6f, 0x66, 0x66, 0x6c, 0x6f,
+ 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f,
+ 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x7d, 0x0a, 0x23, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72,
+ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72,
+ 0x65, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43,
- 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x20, 0x76, 0x61, 0x6c, 0x69,
- 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0c, 0x0a, 0x0a,
- 0x72, 0x65, 0x73, 0x70, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0xa2, 0x03, 0x0a, 0x12, 0x53,
- 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68,
- 0x6d, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47,
- 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
+ 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1f, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65,
+ 0x71, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xb4, 0x04,
+ 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a,
+ 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x64, 0x0a, 0x1a, 0x67,
+ 0x65, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47,
+ 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x17, 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73,
+ 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+ 0x70, 0x12, 0x7a, 0x0a, 0x22, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69,
+ 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66,
+ 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x1e, 0x6f,
+ 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79,
+ 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x83, 0x01,
+ 0x0a, 0x25, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e,
+ 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66,
+ 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65,
+ 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00,
+ 0x52, 0x21, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x73, 0x70, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
+ 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74,
+ 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76,
+ 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65,
+ 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65,
+ 0x73, 0x70, 0x48, 0x00, 0x52, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65,
+ 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61,
+ 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0c, 0x0a, 0x0a, 0x72, 0x65, 0x73, 0x70, 0x5f, 0x6f,
+ 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0xa2, 0x03, 0x0a, 0x12, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1c, 0x0a, 0x18, 0x53,
+ 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41,
+ 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b,
+ 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d,
+ 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41,
+ 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12,
0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f,
- 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36,
- 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49,
- 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41,
- 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c,
- 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f,
- 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f,
- 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53,
- 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10,
- 0x04, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47,
- 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x33, 0x38, 0x34, 0x52,
- 0x31, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32,
- 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41,
- 0x5f, 0x53, 0x45, 0x43, 0x50, 0x35, 0x32, 0x31, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31,
- 0x32, 0x10, 0x06, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53,
+ 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32,
+ 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49,
+ 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35, 0x36,
+ 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x53,
+ 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53,
+ 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x33, 0x38, 0x34, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x33,
+ 0x38, 0x34, 0x10, 0x05, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f,
+ 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x35,
+ 0x32, 0x31, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x06, 0x12, 0x24, 0x0a,
+ 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53,
+ 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35,
+ 0x36, 0x10, 0x07, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53,
0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45,
- 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x07, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41,
+ 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x08, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41,
0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53,
- 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x08, 0x12,
- 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f,
- 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41,
- 0x35, 0x31, 0x32, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c,
- 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x0a, 0x32,
- 0x57, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a,
- 0x0c, 0x53, 0x65, 0x74, 0x55, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e,
- 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x73,
- 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
+ 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x09, 0x12,
+ 0x18, 0x0a, 0x14, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f,
+ 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x0a, 0x32, 0x57, 0x0a, 0x0a, 0x53, 0x32, 0x41,
+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x55, 0x70,
+ 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
- 0x73, 0x70, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,
- 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32,
- 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32,
+ 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x28, 0x01,
+ 0x30, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32,
+ 0x61, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x33,
}
var (
@@ -2158,7 +2176,7 @@ func file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP() []byte {
var file_internal_proto_v2_s2a_s2a_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
var file_internal_proto_v2_s2a_s2a_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
-var file_internal_proto_v2_s2a_s2a_proto_goTypes = []interface{}{
+var file_internal_proto_v2_s2a_s2a_proto_goTypes = []any{
(SignatureAlgorithm)(0), // 0: s2a.proto.v2.SignatureAlgorithm
(GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate)(0), // 1: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.RequestClientCertificate
(OffloadPrivateKeyOperationReq_PrivateKeyOperation)(0), // 2: s2a.proto.v2.OffloadPrivateKeyOperationReq.PrivateKeyOperation
@@ -2183,7 +2201,7 @@ var file_internal_proto_v2_s2a_s2a_proto_goTypes = []interface{}{
(*ValidatePeerCertificateChainReq_ClientPeer)(nil), // 21: s2a.proto.v2.ValidatePeerCertificateChainReq.ClientPeer
(*ValidatePeerCertificateChainReq_ServerPeer)(nil), // 22: s2a.proto.v2.ValidatePeerCertificateChainReq.ServerPeer
(common_go_proto.AlpnProtocol)(0), // 23: s2a.proto.v2.AlpnProtocol
- (*common_go_proto1.Identity)(nil), // 24: s2a.proto.Identity
+ (*common_go_proto.Identity)(nil), // 24: s2a.proto.v2.Identity
(common_go_proto.ConnectionSide)(0), // 25: s2a.proto.v2.ConnectionSide
(*s2a_context_go_proto.S2AContext)(nil), // 26: s2a.proto.v2.S2AContext
(common_go_proto.TLSVersion)(0), // 27: s2a.proto.v2.TLSVersion
@@ -2191,7 +2209,7 @@ var file_internal_proto_v2_s2a_s2a_proto_goTypes = []interface{}{
}
var file_internal_proto_v2_s2a_s2a_proto_depIdxs = []int32{
23, // 0: s2a.proto.v2.AlpnPolicy.alpn_protocols:type_name -> s2a.proto.v2.AlpnProtocol
- 24, // 1: s2a.proto.v2.AuthenticationMechanism.identity:type_name -> s2a.proto.Identity
+ 24, // 1: s2a.proto.v2.AuthenticationMechanism.identity:type_name -> s2a.proto.v2.Identity
25, // 2: s2a.proto.v2.GetTlsConfigurationReq.connection_side:type_name -> s2a.proto.v2.ConnectionSide
19, // 3: s2a.proto.v2.GetTlsConfigurationResp.client_tls_configuration:type_name -> s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration
20, // 4: s2a.proto.v2.GetTlsConfigurationResp.server_tls_configuration:type_name -> s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration
@@ -2203,7 +2221,7 @@ var file_internal_proto_v2_s2a_s2a_proto_depIdxs = []int32{
22, // 10: s2a.proto.v2.ValidatePeerCertificateChainReq.server_peer:type_name -> s2a.proto.v2.ValidatePeerCertificateChainReq.ServerPeer
5, // 11: s2a.proto.v2.ValidatePeerCertificateChainResp.validation_result:type_name -> s2a.proto.v2.ValidatePeerCertificateChainResp.ValidationResult
26, // 12: s2a.proto.v2.ValidatePeerCertificateChainResp.context:type_name -> s2a.proto.v2.S2AContext
- 24, // 13: s2a.proto.v2.SessionReq.local_identity:type_name -> s2a.proto.Identity
+ 24, // 13: s2a.proto.v2.SessionReq.local_identity:type_name -> s2a.proto.v2.Identity
7, // 14: s2a.proto.v2.SessionReq.authentication_mechanisms:type_name -> s2a.proto.v2.AuthenticationMechanism
9, // 15: s2a.proto.v2.SessionReq.get_tls_configuration_req:type_name -> s2a.proto.v2.GetTlsConfigurationReq
11, // 16: s2a.proto.v2.SessionReq.offload_private_key_operation_req:type_name -> s2a.proto.v2.OffloadPrivateKeyOperationReq
@@ -2238,7 +2256,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*AlpnPolicy); i {
case 0:
return &v.state
@@ -2250,7 +2268,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*AuthenticationMechanism); i {
case 0:
return &v.state
@@ -2262,7 +2280,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*Status); i {
case 0:
return &v.state
@@ -2274,7 +2292,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationReq); i {
case 0:
return &v.state
@@ -2286,7 +2304,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationResp); i {
case 0:
return &v.state
@@ -2298,7 +2316,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*OffloadPrivateKeyOperationReq); i {
case 0:
return &v.state
@@ -2310,7 +2328,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*OffloadPrivateKeyOperationResp); i {
case 0:
return &v.state
@@ -2322,7 +2340,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*OffloadResumptionKeyOperationReq); i {
case 0:
return &v.state
@@ -2334,7 +2352,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*OffloadResumptionKeyOperationResp); i {
case 0:
return &v.state
@@ -2346,7 +2364,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainReq); i {
case 0:
return &v.state
@@ -2358,7 +2376,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainResp); i {
case 0:
return &v.state
@@ -2370,7 +2388,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*SessionReq); i {
case 0:
return &v.state
@@ -2382,7 +2400,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*SessionResp); i {
case 0:
return &v.state
@@ -2394,7 +2412,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationResp_ClientTlsConfiguration); i {
case 0:
return &v.state
@@ -2406,7 +2424,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*GetTlsConfigurationResp_ServerTlsConfiguration); i {
case 0:
return &v.state
@@ -2418,7 +2436,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[15].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainReq_ClientPeer); i {
case 0:
return &v.state
@@ -2430,7 +2448,7 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
return nil
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[16].Exporter = func(v any, i int) any {
switch v := v.(*ValidatePeerCertificateChainReq_ServerPeer); i {
case 0:
return &v.state
@@ -2443,30 +2461,30 @@ func file_internal_proto_v2_s2a_s2a_proto_init() {
}
}
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].OneofWrappers = []any{
(*AuthenticationMechanism_Token)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].OneofWrappers = []any{
(*GetTlsConfigurationResp_ClientTlsConfiguration_)(nil),
(*GetTlsConfigurationResp_ServerTlsConfiguration_)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].OneofWrappers = []any{
(*OffloadPrivateKeyOperationReq_RawBytes)(nil),
(*OffloadPrivateKeyOperationReq_Sha256Digest)(nil),
(*OffloadPrivateKeyOperationReq_Sha384Digest)(nil),
(*OffloadPrivateKeyOperationReq_Sha512Digest)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].OneofWrappers = []any{
(*ValidatePeerCertificateChainReq_ClientPeer_)(nil),
(*ValidatePeerCertificateChainReq_ServerPeer_)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].OneofWrappers = []any{
(*SessionReq_GetTlsConfigurationReq)(nil),
(*SessionReq_OffloadPrivateKeyOperationReq)(nil),
(*SessionReq_OffloadResumptionKeyOperationReq)(nil),
(*SessionReq_ValidatePeerCertificateChainReq)(nil),
}
- file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].OneofWrappers = []interface{}{
+ file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].OneofWrappers = []any{
(*SessionResp_GetTlsConfigurationResp)(nil),
(*SessionResp_OffloadPrivateKeyOperationResp)(nil),
(*SessionResp_OffloadResumptionKeyOperationResp)(nil),
diff --git a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go
index 2566df6c3..c93f75a78 100644
--- a/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go
+++ b/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
-// - protoc-gen-go-grpc v1.3.0
+// - protoc-gen-go-grpc v1.4.0
// - protoc v3.21.12
// source: internal/proto/v2/s2a/s2a.proto
@@ -29,8 +29,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
-// Requires gRPC-Go v1.32.0 or later.
-const _ = grpc.SupportPackageIsVersion7
+// Requires gRPC-Go v1.62.0 or later.
+const _ = grpc.SupportPackageIsVersion8
const (
S2AService_SetUpSession_FullMethodName = "/s2a.proto.v2.S2AService/SetUpSession"
@@ -54,11 +54,12 @@ func NewS2AServiceClient(cc grpc.ClientConnInterface) S2AServiceClient {
}
func (c *s2AServiceClient) SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) {
- stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, opts...)
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
- x := &s2AServiceSetUpSessionClient{stream}
+ x := &s2AServiceSetUpSessionClient{ClientStream: stream}
return x, nil
}
@@ -115,7 +116,7 @@ func RegisterS2AServiceServer(s grpc.ServiceRegistrar, srv S2AServiceServer) {
}
func _S2AService_SetUpSession_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{stream})
+ return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{ServerStream: stream})
}
type S2AService_SetUpSessionServer interface {
diff --git a/vendor/github.com/google/s2a-go/internal/record/record.go b/vendor/github.com/google/s2a-go/internal/record/record.go
index c60515510..e76509ef0 100644
--- a/vendor/github.com/google/s2a-go/internal/record/record.go
+++ b/vendor/github.com/google/s2a-go/internal/record/record.go
@@ -378,11 +378,6 @@ func (p *conn) Read(b []byte) (n int, err error) {
if len(p.handshakeBuf) > 0 {
return 0, errors.New("application data received while processing fragmented handshake messages")
}
- if p.ticketState == receivingTickets {
- p.ticketState = notReceivingTickets
- grpclog.Infof("Sending session tickets to S2A.")
- p.ticketSender.sendTicketsToS2A(p.sessionTickets, p.callComplete)
- }
case alert:
return 0, p.handleAlertMessage()
case handshake:
@@ -500,17 +495,7 @@ func (p *conn) buildRecord(plaintext []byte, recordType byte, recordStartIndex i
}
func (p *conn) Close() error {
- p.readMutex.Lock()
- defer p.readMutex.Unlock()
- p.writeMutex.Lock()
- defer p.writeMutex.Unlock()
- // If p.ticketState is equal to notReceivingTickets, then S2A has
- // been sent a flight of session tickets, and we must wait for the
- // call to S2A to complete before closing the record protocol.
- if p.ticketState == notReceivingTickets {
- <-p.callComplete
- grpclog.Infof("Safe to close the connection because sending tickets to S2A is (already) complete.")
- }
+ // Close the connection immediately.
return p.Conn.Close()
}
@@ -663,7 +648,7 @@ func (p *conn) handleHandshakeMessage() error {
// Several handshake messages may be coalesced into a single record.
// Continue reading them until the handshake buffer is empty.
for len(p.handshakeBuf) > 0 {
- handshakeMsgType, msgLen, msg, rawMsg, ok := p.parseHandshakeMsg()
+ handshakeMsgType, msgLen, msg, _, ok := p.parseHandshakeMsg()
if !ok {
// The handshake could not be fully parsed, so read in another
// record and try again later.
@@ -681,20 +666,7 @@ func (p *conn) handleHandshakeMessage() error {
return err
}
case tlsHandshakeNewSessionTicketType:
- // Ignore tickets that are received after a batch of tickets has
- // been sent to S2A.
- if p.ticketState == notReceivingTickets {
- continue
- }
- if p.ticketState == ticketsNotYetReceived {
- p.ticketState = receivingTickets
- }
- p.sessionTickets = append(p.sessionTickets, rawMsg)
- if len(p.sessionTickets) == maxAllowedTickets {
- p.ticketState = notReceivingTickets
- grpclog.Infof("Sending session tickets to S2A.")
- p.ticketSender.sendTicketsToS2A(p.sessionTickets, p.callComplete)
- }
+ // Do nothing for session ticket.
default:
return errors.New("unknown handshake message type")
}
diff --git a/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go b/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go
index ec96ba3b6..4057e70c8 100644
--- a/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go
+++ b/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go
@@ -23,7 +23,8 @@ import (
"fmt"
"os"
- commonpb "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
)
const (
@@ -37,7 +38,7 @@ type AccessTokenManager interface {
DefaultToken() (token string, err error)
// Token returns a token that an application with local identity equal to
// identity must use to authenticate to S2A.
- Token(identity *commonpb.Identity) (token string, err error)
+ Token(identity interface{}) (token string, err error)
}
type singleTokenAccessTokenManager struct {
@@ -65,6 +66,14 @@ func (m *singleTokenAccessTokenManager) DefaultToken() (string, error) {
}
// Token always returns the token managed by the singleTokenAccessTokenManager.
-func (m *singleTokenAccessTokenManager) Token(*commonpb.Identity) (string, error) {
+func (m *singleTokenAccessTokenManager) Token(identity interface{}) (string, error) {
+ switch v := identity.(type) {
+ case *commonpbv1.Identity:
+ // valid type.
+ case *commonpb.Identity:
+ // valid type.
+ default:
+ return "", fmt.Errorf("Incorrect identity type: %v", v)
+ }
return m.token, nil
}
diff --git a/vendor/github.com/google/s2a-go/internal/v2/s2av2.go b/vendor/github.com/google/s2a-go/internal/v2/s2av2.go
index 85a8379d8..a6402ee48 100644
--- a/vendor/github.com/google/s2a-go/internal/v2/s2av2.go
+++ b/vendor/github.com/google/s2a-go/internal/v2/s2av2.go
@@ -28,7 +28,6 @@ import (
"os"
"time"
- "github.com/golang/protobuf/proto"
"github.com/google/s2a-go/fallback"
"github.com/google/s2a-go/internal/handshaker/service"
"github.com/google/s2a-go/internal/tokenmanager"
@@ -38,8 +37,9 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
+ "google.golang.org/protobuf/proto"
- commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto"
)
@@ -59,9 +59,9 @@ type s2av2TransportCreds struct {
transportCreds credentials.TransportCredentials
tokenManager *tokenmanager.AccessTokenManager
// localIdentity should only be used by the client.
- localIdentity *commonpbv1.Identity
+ localIdentity *commonpb.Identity
// localIdentities should only be used by the server.
- localIdentities []*commonpbv1.Identity
+ localIdentities []*commonpb.Identity
verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode
fallbackClientHandshake fallback.ClientHandshake
getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)
@@ -70,7 +70,7 @@ type s2av2TransportCreds struct {
// NewClientCreds returns a client-side transport credentials object that uses
// the S2Av2 to establish a secure connection with a server.
-func NewClientCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentity *commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, fallbackClientHandshakeFunc fallback.ClientHandshake, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error), serverAuthorizationPolicy []byte) (credentials.TransportCredentials, error) {
+func NewClientCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentity *commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, fallbackClientHandshakeFunc fallback.ClientHandshake, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error), serverAuthorizationPolicy []byte) (credentials.TransportCredentials, error) {
// Create an AccessTokenManager instance to use to authenticate to S2Av2.
accessTokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager()
@@ -101,7 +101,7 @@ func NewClientCreds(s2av2Address string, transportCreds credentials.TransportCre
// NewServerCreds returns a server-side transport credentials object that uses
// the S2Av2 to establish a secure connection with a client.
-func NewServerCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)) (credentials.TransportCredentials, error) {
+func NewServerCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentities []*commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)) (credentials.TransportCredentials, error) {
// Create an AccessTokenManager instance to use to authenticate to S2Av2.
accessTokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager()
creds := &s2av2TransportCreds{
@@ -183,13 +183,7 @@ func (c *s2av2TransportCreds) ClientHandshake(ctx context.Context, serverAuthori
}
creds := credentials.NewTLS(config)
- var conn net.Conn
- var authInfo credentials.AuthInfo
- retry.Run(timeoutCtx,
- func() error {
- conn, authInfo, err = creds.ClientHandshake(timeoutCtx, serverName, rawConn)
- return err
- })
+ conn, authInfo, err := creds.ClientHandshake(timeoutCtx, serverName, rawConn)
if err != nil {
grpclog.Infof("Failed to do client handshake using S2Av2: %v", err)
if c.fallbackClientHandshake != nil {
@@ -197,7 +191,7 @@ func (c *s2av2TransportCreds) ClientHandshake(ctx context.Context, serverAuthori
}
return nil, nil, err
}
- grpclog.Infof("Successfully done client handshake using S2Av2 to: %s", serverName)
+ grpclog.Infof("client-side handshake is done using S2Av2 to: %s", serverName)
return conn, authInfo, err
}
@@ -247,13 +241,7 @@ func (c *s2av2TransportCreds) ServerHandshake(rawConn net.Conn) (net.Conn, crede
}
creds := credentials.NewTLS(config)
- var conn net.Conn
- var authInfo credentials.AuthInfo
- retry.Run(ctx,
- func() error {
- conn, authInfo, err = creds.ServerHandshake(rawConn)
- return err
- })
+ conn, authInfo, err := creds.ServerHandshake(rawConn)
if err != nil {
grpclog.Infof("Failed to do server handshake using S2Av2: %v", err)
return nil, nil, err
@@ -280,15 +268,15 @@ func (c *s2av2TransportCreds) Clone() credentials.TransportCredentials {
tokenManager = *c.tokenManager
}
verificationMode := c.verificationMode
- var localIdentity *commonpbv1.Identity
+ var localIdentity *commonpb.Identity
if c.localIdentity != nil {
- localIdentity = proto.Clone(c.localIdentity).(*commonpbv1.Identity)
+ localIdentity = proto.Clone(c.localIdentity).(*commonpb.Identity)
}
- var localIdentities []*commonpbv1.Identity
+ var localIdentities []*commonpb.Identity
if c.localIdentities != nil {
- localIdentities = make([]*commonpbv1.Identity, len(c.localIdentities))
+ localIdentities = make([]*commonpb.Identity, len(c.localIdentities))
for i, localIdentity := range c.localIdentities {
- localIdentities[i] = proto.Clone(localIdentity).(*commonpbv1.Identity)
+ localIdentities[i] = proto.Clone(localIdentity).(*commonpb.Identity)
}
}
creds := &s2av2TransportCreds{
diff --git a/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go b/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go
index 4d9191322..fa0002e36 100644
--- a/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go
+++ b/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go
@@ -33,7 +33,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
- commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto"
)
@@ -44,8 +43,8 @@ const (
)
// GetTLSConfigurationForClient returns a tls.Config instance for use by a client application.
-func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentity *commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, serverAuthorizationPolicy []byte) (*tls.Config, error) {
- authMechanisms := getAuthMechanisms(tokenManager, []*commonpbv1.Identity{localIdentity})
+func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentity *commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, serverAuthorizationPolicy []byte) (*tls.Config, error) {
+ authMechanisms := getAuthMechanisms(tokenManager, []*commonpb.Identity{localIdentity})
if grpclog.V(1) {
grpclog.Infof("Sending request to S2Av2 for client TLS config.")
@@ -126,7 +125,7 @@ func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStr
}
// GetTLSConfigurationForServer returns a tls.Config instance for use by a server application.
-func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode) (*tls.Config, error) {
+func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode) (*tls.Config, error) {
return &tls.Config{
GetConfigForClient: ClientConfig(tokenManager, localIdentities, verificationMode, s2AStream),
}, nil
@@ -136,7 +135,7 @@ func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager token
// connection with a client, based on SNI communicated during ClientHello.
// Ensures that server presents the correct certificate to establish a TLS
// connection.
-func ClientConfig(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream) func(chi *tls.ClientHelloInfo) (*tls.Config, error) {
+func ClientConfig(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream) func(chi *tls.ClientHelloInfo) (*tls.Config, error) {
return func(chi *tls.ClientHelloInfo) (*tls.Config, error) {
tlsConfig, err := getServerConfigFromS2Av2(tokenManager, localIdentities, chi.ServerName, s2AStream)
if err != nil {
@@ -219,9 +218,9 @@ func getTLSCipherSuite(tlsCipherSuite commonpb.Ciphersuite) uint16 {
}
}
-func getServerConfigFromS2Av2(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, sni string, s2AStream stream.S2AStream) (*s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration, error) {
+func getServerConfigFromS2Av2(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity, sni string, s2AStream stream.S2AStream) (*s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration, error) {
authMechanisms := getAuthMechanisms(tokenManager, localIdentities)
- var locID *commonpbv1.Identity
+ var locID *commonpb.Identity
if localIdentities != nil {
locID = localIdentities[0]
}
@@ -283,7 +282,7 @@ func getTLSClientAuthType(tlsConfig *s2av2pb.GetTlsConfigurationResp_ServerTlsCo
return clientAuth
}
-func getAuthMechanisms(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity) []*s2av2pb.AuthenticationMechanism {
+func getAuthMechanisms(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpb.Identity) []*s2av2pb.AuthenticationMechanism {
if tokenManager == nil {
return nil
}
diff --git a/vendor/github.com/google/s2a-go/s2a.go b/vendor/github.com/google/s2a-go/s2a.go
index 5ecb06f93..cc79bd09a 100644
--- a/vendor/github.com/google/s2a-go/s2a.go
+++ b/vendor/github.com/google/s2a-go/s2a.go
@@ -29,7 +29,6 @@ import (
"sync"
"time"
- "github.com/golang/protobuf/proto"
"github.com/google/s2a-go/fallback"
"github.com/google/s2a-go/internal/handshaker"
"github.com/google/s2a-go/internal/handshaker/service"
@@ -38,8 +37,10 @@ import (
"github.com/google/s2a-go/retry"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
+ "google.golang.org/protobuf/proto"
- commonpb "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto"
)
@@ -54,17 +55,17 @@ const (
// credentials.TransportCredentials interface.
type s2aTransportCreds struct {
info *credentials.ProtocolInfo
- minTLSVersion commonpb.TLSVersion
- maxTLSVersion commonpb.TLSVersion
+ minTLSVersion commonpbv1.TLSVersion
+ maxTLSVersion commonpbv1.TLSVersion
// tlsCiphersuites contains the ciphersuites used in the S2A connection.
// Note that these are currently unconfigurable.
- tlsCiphersuites []commonpb.Ciphersuite
+ tlsCiphersuites []commonpbv1.Ciphersuite
// localIdentity should only be used by the client.
- localIdentity *commonpb.Identity
+ localIdentity *commonpbv1.Identity
// localIdentities should only be used by the server.
- localIdentities []*commonpb.Identity
+ localIdentities []*commonpbv1.Identity
// targetIdentities should only be used by the client.
- targetIdentities []*commonpb.Identity
+ targetIdentities []*commonpbv1.Identity
isClient bool
s2aAddr string
ensureProcessSessionTickets *sync.WaitGroup
@@ -76,7 +77,7 @@ func NewClientCreds(opts *ClientOptions) (credentials.TransportCredentials, erro
if opts == nil {
return nil, errors.New("nil client options")
}
- var targetIdentities []*commonpb.Identity
+ var targetIdentities []*commonpbv1.Identity
for _, targetIdentity := range opts.TargetIdentities {
protoTargetIdentity, err := toProtoIdentity(targetIdentity)
if err != nil {
@@ -93,12 +94,12 @@ func NewClientCreds(opts *ClientOptions) (credentials.TransportCredentials, erro
info: &credentials.ProtocolInfo{
SecurityProtocol: s2aSecurityProtocol,
},
- minTLSVersion: commonpb.TLSVersion_TLS1_3,
- maxTLSVersion: commonpb.TLSVersion_TLS1_3,
- tlsCiphersuites: []commonpb.Ciphersuite{
- commonpb.Ciphersuite_AES_128_GCM_SHA256,
- commonpb.Ciphersuite_AES_256_GCM_SHA384,
- commonpb.Ciphersuite_CHACHA20_POLY1305_SHA256,
+ minTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ maxTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ tlsCiphersuites: []commonpbv1.Ciphersuite{
+ commonpbv1.Ciphersuite_AES_128_GCM_SHA256,
+ commonpbv1.Ciphersuite_AES_256_GCM_SHA384,
+ commonpbv1.Ciphersuite_CHACHA20_POLY1305_SHA256,
},
localIdentity: localIdentity,
targetIdentities: targetIdentities,
@@ -112,7 +113,11 @@ func NewClientCreds(opts *ClientOptions) (credentials.TransportCredentials, erro
if opts.FallbackOpts != nil && opts.FallbackOpts.FallbackClientHandshakeFunc != nil {
fallbackFunc = opts.FallbackOpts.FallbackClientHandshakeFunc
}
- return v2.NewClientCreds(opts.S2AAddress, opts.TransportCreds, localIdentity, verificationMode, fallbackFunc, opts.getS2AStream, opts.serverAuthorizationPolicy)
+ v2LocalIdentity, err := toV2ProtoIdentity(opts.LocalIdentity)
+ if err != nil {
+ return nil, err
+ }
+ return v2.NewClientCreds(opts.S2AAddress, opts.TransportCreds, v2LocalIdentity, verificationMode, fallbackFunc, opts.getS2AStream, opts.serverAuthorizationPolicy)
}
// NewServerCreds returns a server-side transport credentials object that uses
@@ -121,7 +126,7 @@ func NewServerCreds(opts *ServerOptions) (credentials.TransportCredentials, erro
if opts == nil {
return nil, errors.New("nil server options")
}
- var localIdentities []*commonpb.Identity
+ var localIdentities []*commonpbv1.Identity
for _, localIdentity := range opts.LocalIdentities {
protoLocalIdentity, err := toProtoIdentity(localIdentity)
if err != nil {
@@ -134,12 +139,12 @@ func NewServerCreds(opts *ServerOptions) (credentials.TransportCredentials, erro
info: &credentials.ProtocolInfo{
SecurityProtocol: s2aSecurityProtocol,
},
- minTLSVersion: commonpb.TLSVersion_TLS1_3,
- maxTLSVersion: commonpb.TLSVersion_TLS1_3,
- tlsCiphersuites: []commonpb.Ciphersuite{
- commonpb.Ciphersuite_AES_128_GCM_SHA256,
- commonpb.Ciphersuite_AES_256_GCM_SHA384,
- commonpb.Ciphersuite_CHACHA20_POLY1305_SHA256,
+ minTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ maxTLSVersion: commonpbv1.TLSVersion_TLS1_3,
+ tlsCiphersuites: []commonpbv1.Ciphersuite{
+ commonpbv1.Ciphersuite_AES_128_GCM_SHA256,
+ commonpbv1.Ciphersuite_AES_256_GCM_SHA384,
+ commonpbv1.Ciphersuite_CHACHA20_POLY1305_SHA256,
},
localIdentities: localIdentities,
isClient: false,
@@ -147,7 +152,15 @@ func NewServerCreds(opts *ServerOptions) (credentials.TransportCredentials, erro
}, nil
}
verificationMode := getVerificationMode(opts.VerificationMode)
- return v2.NewServerCreds(opts.S2AAddress, opts.TransportCreds, localIdentities, verificationMode, opts.getS2AStream)
+ var v2LocalIdentities []*commonpb.Identity
+ for _, localIdentity := range opts.LocalIdentities {
+ protoLocalIdentity, err := toV2ProtoIdentity(localIdentity)
+ if err != nil {
+ return nil, err
+ }
+ v2LocalIdentities = append(v2LocalIdentities, protoLocalIdentity)
+ }
+ return v2.NewServerCreds(opts.S2AAddress, opts.TransportCreds, v2LocalIdentities, verificationMode, opts.getS2AStream)
}
// ClientHandshake initiates a client-side TLS handshake using the S2A.
@@ -248,22 +261,22 @@ func (c *s2aTransportCreds) Info() credentials.ProtocolInfo {
func (c *s2aTransportCreds) Clone() credentials.TransportCredentials {
info := *c.info
- var localIdentity *commonpb.Identity
+ var localIdentity *commonpbv1.Identity
if c.localIdentity != nil {
- localIdentity = proto.Clone(c.localIdentity).(*commonpb.Identity)
+ localIdentity = proto.Clone(c.localIdentity).(*commonpbv1.Identity)
}
- var localIdentities []*commonpb.Identity
+ var localIdentities []*commonpbv1.Identity
if c.localIdentities != nil {
- localIdentities = make([]*commonpb.Identity, len(c.localIdentities))
+ localIdentities = make([]*commonpbv1.Identity, len(c.localIdentities))
for i, localIdentity := range c.localIdentities {
- localIdentities[i] = proto.Clone(localIdentity).(*commonpb.Identity)
+ localIdentities[i] = proto.Clone(localIdentity).(*commonpbv1.Identity)
}
}
- var targetIdentities []*commonpb.Identity
+ var targetIdentities []*commonpbv1.Identity
if c.targetIdentities != nil {
- targetIdentities = make([]*commonpb.Identity, len(c.targetIdentities))
+ targetIdentities = make([]*commonpbv1.Identity, len(c.targetIdentities))
for i, targetIdentity := range c.targetIdentities {
- targetIdentities[i] = proto.Clone(targetIdentity).(*commonpb.Identity)
+ targetIdentities[i] = proto.Clone(targetIdentity).(*commonpbv1.Identity)
}
}
return &s2aTransportCreds{
@@ -351,6 +364,12 @@ func getVerificationMode(verificationMode VerificationModeType) s2av2pb.Validate
return s2av2pb.ValidatePeerCertificateChainReq_CONNECT_TO_GOOGLE
case Spiffe:
return s2av2pb.ValidatePeerCertificateChainReq_SPIFFE
+ case ReservedCustomVerificationMode3:
+ return s2av2pb.ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_3
+ case ReservedCustomVerificationMode4:
+ return s2av2pb.ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_4
+ case ReservedCustomVerificationMode5:
+ return s2av2pb.ValidatePeerCertificateChainReq_RESERVED_CUSTOM_VERIFICATION_MODE_5
default:
return s2av2pb.ValidatePeerCertificateChainReq_UNSPECIFIED
}
@@ -396,24 +415,20 @@ func NewS2ADialTLSContextFunc(opts *ClientOptions) func(ctx context.Context, net
defer cancel()
var s2aTLSConfig *tls.Config
+ var c net.Conn
retry.Run(timeoutCtx,
func() error {
s2aTLSConfig, err = factory.Build(timeoutCtx, &TLSClientConfigOptions{
ServerName: serverName,
})
- return err
- })
- if err != nil {
- grpclog.Infof("error building S2A TLS config: %v", err)
- return fallback(err)
- }
+ if err != nil {
+ grpclog.Infof("error building S2A TLS config: %v", err)
+ return err
+ }
- s2aDialer := &tls.Dialer{
- Config: s2aTLSConfig,
- }
- var c net.Conn
- retry.Run(timeoutCtx,
- func() error {
+ s2aDialer := &tls.Dialer{
+ Config: s2aTLSConfig,
+ }
c, err = s2aDialer.DialContext(timeoutCtx, network, addr)
return err
})
diff --git a/vendor/github.com/google/s2a-go/s2a_options.go b/vendor/github.com/google/s2a-go/s2a_options.go
index fcdbc1621..5bbf31bf4 100644
--- a/vendor/github.com/google/s2a-go/s2a_options.go
+++ b/vendor/github.com/google/s2a-go/s2a_options.go
@@ -28,7 +28,8 @@ import (
"github.com/google/s2a-go/stream"
"google.golang.org/grpc/credentials"
- s2apb "github.com/google/s2a-go/internal/proto/common_go_proto"
+ s2apbv1 "github.com/google/s2a-go/internal/proto/common_go_proto"
+ s2apb "github.com/google/s2a-go/internal/proto/v2/common_go_proto"
)
// Identity is the interface for S2A identities.
@@ -76,9 +77,12 @@ type VerificationModeType int
// Three types of verification modes.
const (
- Unspecified = iota
- ConnectToGoogle
+ Unspecified VerificationModeType = iota
Spiffe
+ ConnectToGoogle
+ ReservedCustomVerificationMode3
+ ReservedCustomVerificationMode4
+ ReservedCustomVerificationMode5
)
// ClientOptions contains the client-side options used to establish a secure
@@ -198,7 +202,23 @@ func DefaultServerOptions(s2aAddress string) *ServerOptions {
}
}
-func toProtoIdentity(identity Identity) (*s2apb.Identity, error) {
+func toProtoIdentity(identity Identity) (*s2apbv1.Identity, error) {
+ if identity == nil {
+ return nil, nil
+ }
+ switch id := identity.(type) {
+ case *spiffeID:
+ return &s2apbv1.Identity{IdentityOneof: &s2apbv1.Identity_SpiffeId{SpiffeId: id.Name()}}, nil
+ case *hostname:
+ return &s2apbv1.Identity{IdentityOneof: &s2apbv1.Identity_Hostname{Hostname: id.Name()}}, nil
+ case *uid:
+ return &s2apbv1.Identity{IdentityOneof: &s2apbv1.Identity_Uid{Uid: id.Name()}}, nil
+ default:
+ return nil, errors.New("unrecognized identity type")
+ }
+}
+
+func toV2ProtoIdentity(identity Identity) (*s2apb.Identity, error) {
if identity == nil {
return nil, nil
}