aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--go.mod12
-rw-r--r--go.sum24
-rw-r--r--vendor/cloud.google.com/go/ai/LICENSE202
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/auxiliary.go420
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/discuss_client.go490
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/doc.go129
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/file_client.go633
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/gapic_metadata.json597
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generative_client.go999
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/citation.pb.go290
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/content.pb.go1537
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/discuss_service.pb.go1038
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file.pb.go369
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file_service.pb.go805
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/generative_service.pb.go3323
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model.pb.go334
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model_service.pb.go1435
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission.pb.go385
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission_service.pb.go1162
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever.pb.go1193
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever_service.pb.go3589
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/safety.pb.go792
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/text_service.pb.go1455
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/tuned_model.pb.go1196
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/info.go25
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/model_client.go1200
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/permission_client.go948
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/retriever_client.go2504
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/text_client.go720
-rw-r--r--vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/version.go23
-rw-r--r--vendor/cloud.google.com/go/ai/internal/version.go20
-rw-r--r--vendor/cloud.google.com/go/civil/civil.go350
-rw-r--r--vendor/github.com/google/generative-ai-go/LICENSE201
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/chat.go71
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/client.go401
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/config.yaml186
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/content.go145
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/doc.go32
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/embed.go125
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/files.go123
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/generativelanguagepb_veneer.gen.go1369
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-api.json4052
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go10168
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/README12
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go79
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go10
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go24
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go236
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go47
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go310
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go77
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go267
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go121
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go16
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go206
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go53
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/internal/version.go8
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/license.txt14
-rw-r--r--vendor/github.com/google/generative-ai-go/genai/list_models.go50
-rw-r--r--vendor/github.com/google/generative-ai-go/internal/support/support.go121
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go21
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go15
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go64
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go69
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go49
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go75
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go12
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go13
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go15
-rw-r--r--vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/CHANGELOG.md78
-rw-r--r--vendor/go.opentelemetry.io/otel/CONTRIBUTING.md10
-rw-r--r--vendor/go.opentelemetry.io/otel/Makefile62
-rw-r--r--vendor/go.opentelemetry.io/otel/README.md7
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/encoder.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/filter.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/iterator.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/key.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/kv.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/set.go139
-rw-r--r--vendor/go.opentelemetry.io/otel/attribute/value.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/baggage/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/baggage/baggage.go236
-rw-r--r--vendor/go.opentelemetry.io/otel/baggage/context.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/baggage/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/codes/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/codes/codes.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/codes/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/error_handler.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/get_main_pkgs.sh13
-rw-r--r--vendor/go.opentelemetry.io/otel/handler.go25
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/baggage/context.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/gen.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/global/handler.go84
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/global/instruments.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go39
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/global/meter.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/global/propagator.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/global/state.go67
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/global/trace.go16
-rw-r--r--vendor/go.opentelemetry.io/otel/internal/rawhelpers.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/internal_logging.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/asyncint64.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/config.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/embedded/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/instrument.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/meter.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/noop/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/noop/noop.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/syncfloat64.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/metric/syncint64.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/propagation.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/propagation/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/propagation/baggage.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/propagation/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/propagation/propagation.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/propagation/trace_context.go15
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/trace.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/config.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/context.go17
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/doc.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/embedded/README.md3
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/nonrecording.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/noop.go20
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/trace.go19
-rw-r--r--vendor/go.opentelemetry.io/otel/trace/tracestate.go13
-rw-r--r--vendor/go.opentelemetry.io/otel/verify_examples.sh13
-rw-r--r--vendor/go.opentelemetry.io/otel/verify_readmes.sh21
-rw-r--r--vendor/go.opentelemetry.io/otel/version.go15
-rw-r--r--vendor/go.opentelemetry.io/otel/versions.yaml24
-rw-r--r--vendor/modules.txt34
174 files changed, 47575 insertions, 1417 deletions
diff --git a/go.mod b/go.mod
index 94c7a52b9..820e651f2 100644
--- a/go.mod
+++ b/go.mod
@@ -12,6 +12,7 @@ require (
github.com/dvyukov/go-fuzz v0.0.0-20220726122315-1d375ef9f9f6
github.com/golangci/golangci-lint v1.57.2
github.com/google/flatbuffers v24.3.25+incompatible
+ github.com/google/generative-ai-go v0.13.0
github.com/google/go-cmp v0.6.0
github.com/gorilla/handlers v1.5.2
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab
@@ -36,6 +37,7 @@ require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
4d63.com/gochecknoglobals v0.2.1 // indirect
cloud.google.com/go v0.114.0 // indirect
+ cloud.google.com/go/ai v0.5.0 // indirect
cloud.google.com/go/auth v0.4.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
@@ -209,11 +211,11 @@ require (
go-simpler.org/musttag v0.9.0 // indirect
go-simpler.org/sloglint v0.5.0 // indirect
go.opencensus.io v0.24.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
- go.opentelemetry.io/otel v1.24.0 // indirect
- go.opentelemetry.io/otel/metric v1.24.0 // indirect
- go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
+ go.opentelemetry.io/otel v1.26.0 // indirect
+ go.opentelemetry.io/otel/metric v1.26.0 // indirect
+ go.opentelemetry.io/otel/trace v1.26.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.9.0 // indirect
diff --git a/go.sum b/go.sum
index 9d7da482f..b29a998c2 100644
--- a/go.sum
+++ b/go.sum
@@ -20,6 +20,8 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY=
cloud.google.com/go v0.114.0/go.mod h1:ZV9La5YYxctro1HTPug5lXH/GefROyW8PPD4T8n9J8E=
+cloud.google.com/go/ai v0.5.0 h1:x8s4rDn5t9OVZvBCgtr5bZTH5X0O7JdE6zYo+O+MpRw=
+cloud.google.com/go/ai v0.5.0/go.mod h1:96VBphk70e0zdXZrbtgPuKYRZsQ3UktSUXhuojwiKA8=
cloud.google.com/go/auth v0.4.2 h1:sb0eyLkhRtpq5jA+a8KWw0W70YcdVca7KJ8TM0AFYDg=
cloud.google.com/go/auth v0.4.2/go.mod h1:Kqvlz1cf1sNA0D+sYJnkPQOP+JMHkuHeIgVmCRtZOLc=
cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4=
@@ -306,6 +308,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI=
github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
+github.com/google/generative-ai-go v0.13.0 h1:/c2kleSHeAdv5f2t9sSlxTwDpXBVhr9wqL3Tfg/rVqQ=
+github.com/google/generative-ai-go v0.13.0/go.mod h1:Pmy+JWGfZt1kjjKPpufz2uunTIOy+dhWA3aOIC7ub3Q=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -689,18 +693,18 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
-go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
-go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
-go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
-go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc=
+go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs=
+go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4=
+go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30=
+go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4=
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
-go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
-go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA=
+go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0=
go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
diff --git a/vendor/cloud.google.com/go/ai/LICENSE b/vendor/cloud.google.com/go/ai/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/auxiliary.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/auxiliary.go
new file mode 100644
index 000000000..34f5bbd34
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/auxiliary.go
@@ -0,0 +1,420 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "context"
+ "time"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ "cloud.google.com/go/longrunning"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/iterator"
+)
+
+// CreateTunedModelOperation manages a long-running operation from CreateTunedModel.
+type CreateTunedModelOperation struct {
+ lro *longrunning.Operation
+ pollPath string
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *CreateTunedModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
+ var resp generativelanguagepb.TunedModel
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// Poll fetches the latest state of the long-running operation.
+//
+// Poll also fetches the latest metadata, which can be retrieved by Metadata.
+//
+// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
+// the operation has completed with failure, the error is returned and op.Done will return true.
+// If Poll succeeds and the operation has completed successfully,
+// op.Done will return true, and the response of the operation is returned.
+// If Poll succeeds and the operation has not completed, the returned response and error are both nil.
+func (op *CreateTunedModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
+ var resp generativelanguagepb.TunedModel
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// Metadata returns metadata associated with the long-running operation.
+// Metadata itself does not contact the server, but Poll does.
+// To get the latest metadata, call this method after a successful call to Poll.
+// If the metadata is not available, the returned metadata and error are both nil.
+func (op *CreateTunedModelOperation) Metadata() (*generativelanguagepb.CreateTunedModelMetadata, error) {
+ var meta generativelanguagepb.CreateTunedModelMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *CreateTunedModelOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// Name returns the name of the long-running operation.
+// The name is assigned by the server and is unique within the service from which the operation is created.
+func (op *CreateTunedModelOperation) Name() string {
+ return op.lro.Name()
+}
+
+// ChunkIterator manages a stream of *generativelanguagepb.Chunk.
+type ChunkIterator struct {
+ items []*generativelanguagepb.Chunk
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*generativelanguagepb.Chunk, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ChunkIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 *ChunkIterator) Next() (*generativelanguagepb.Chunk, error) {
+ var item *generativelanguagepb.Chunk
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *ChunkIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *ChunkIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// CorpusIterator manages a stream of *generativelanguagepb.Corpus.
+type CorpusIterator struct {
+ items []*generativelanguagepb.Corpus
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*generativelanguagepb.Corpus, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *CorpusIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 *CorpusIterator) Next() (*generativelanguagepb.Corpus, error) {
+ var item *generativelanguagepb.Corpus
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *CorpusIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *CorpusIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// DocumentIterator manages a stream of *generativelanguagepb.Document.
+type DocumentIterator struct {
+ items []*generativelanguagepb.Document
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*generativelanguagepb.Document, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *DocumentIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 *DocumentIterator) Next() (*generativelanguagepb.Document, error) {
+ var item *generativelanguagepb.Document
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *DocumentIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *DocumentIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// FileIterator manages a stream of *generativelanguagepb.File.
+type FileIterator struct {
+ items []*generativelanguagepb.File
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*generativelanguagepb.File, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *FileIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 *FileIterator) Next() (*generativelanguagepb.File, error) {
+ var item *generativelanguagepb.File
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *FileIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *FileIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// ModelIterator manages a stream of *generativelanguagepb.Model.
+type ModelIterator struct {
+ items []*generativelanguagepb.Model
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*generativelanguagepb.Model, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ModelIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 *ModelIterator) Next() (*generativelanguagepb.Model, error) {
+ var item *generativelanguagepb.Model
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *ModelIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *ModelIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// PermissionIterator manages a stream of *generativelanguagepb.Permission.
+type PermissionIterator struct {
+ items []*generativelanguagepb.Permission
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*generativelanguagepb.Permission, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *PermissionIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 *PermissionIterator) Next() (*generativelanguagepb.Permission, error) {
+ var item *generativelanguagepb.Permission
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *PermissionIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *PermissionIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
+
+// TunedModelIterator manages a stream of *generativelanguagepb.TunedModel.
+type TunedModelIterator struct {
+ items []*generativelanguagepb.TunedModel
+ pageInfo *iterator.PageInfo
+ nextFunc func() error
+
+ // Response is the raw response for the current page.
+ // It must be cast to the RPC response type.
+ // Calling Next() or InternalFetch() updates this value.
+ Response interface{}
+
+ // InternalFetch is for use by the Google Cloud Libraries only.
+ // It is not part of the stable interface of this package.
+ //
+ // InternalFetch returns results from a single call to the underlying RPC.
+ // The number of results is no greater than pageSize.
+ // If there are no more results, nextPageToken is empty and err is nil.
+ InternalFetch func(pageSize int, pageToken string) (results []*generativelanguagepb.TunedModel, nextPageToken string, err error)
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *TunedModelIterator) PageInfo() *iterator.PageInfo {
+ return it.pageInfo
+}
+
+// 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 *TunedModelIterator) Next() (*generativelanguagepb.TunedModel, error) {
+ var item *generativelanguagepb.TunedModel
+ if err := it.nextFunc(); err != nil {
+ return item, err
+ }
+ item = it.items[0]
+ it.items = it.items[1:]
+ return item, nil
+}
+
+func (it *TunedModelIterator) bufLen() int {
+ return len(it.items)
+}
+
+func (it *TunedModelIterator) takeBuf() interface{} {
+ b := it.items
+ it.items = nil
+ return b
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/discuss_client.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/discuss_client.go
new file mode 100644
index 000000000..673cd575c
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/discuss_client.go
@@ -0,0 +1,490 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "math"
+ "net/http"
+ "net/url"
+ "time"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ httptransport "google.golang.org/api/transport/http"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/protobuf/encoding/protojson"
+)
+
+var newDiscussClientHook clientHook
+
+// DiscussCallOptions contains the retry settings for each method of DiscussClient.
+type DiscussCallOptions struct {
+ GenerateMessage []gax.CallOption
+ CountMessageTokens []gax.CallOption
+}
+
+func defaultDiscussGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("generativelanguage.googleapis.com:443"),
+ internaloption.WithDefaultEndpointTemplate("generativelanguage.UNIVERSE_DOMAIN:443"),
+ internaloption.WithDefaultMTLSEndpoint("generativelanguage.mtls.googleapis.com:443"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultDiscussCallOptions() *DiscussCallOptions {
+ return &DiscussCallOptions{
+ GenerateMessage: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CountMessageTokens: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ }
+}
+
+func defaultDiscussRESTCallOptions() *DiscussCallOptions {
+ return &DiscussCallOptions{
+ GenerateMessage: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ CountMessageTokens: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ }
+}
+
+// internalDiscussClient is an interface that defines the methods available from Generative Language API.
+type internalDiscussClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ GenerateMessage(context.Context, *generativelanguagepb.GenerateMessageRequest, ...gax.CallOption) (*generativelanguagepb.GenerateMessageResponse, error)
+ CountMessageTokens(context.Context, *generativelanguagepb.CountMessageTokensRequest, ...gax.CallOption) (*generativelanguagepb.CountMessageTokensResponse, error)
+}
+
+// DiscussClient is a client for interacting with Generative Language API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// An API for using Generative Language Models (GLMs) in dialog applications.
+//
+// Also known as large language models (LLMs), this API provides models that
+// are trained for multi-turn dialog.
+type DiscussClient struct {
+ // The internal transport-dependent client.
+ internalClient internalDiscussClient
+
+ // The call options for this service.
+ CallOptions *DiscussCallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *DiscussClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *DiscussClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *DiscussClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// GenerateMessage generates a response from the model given an input MessagePrompt.
+func (c *DiscussClient) GenerateMessage(ctx context.Context, req *generativelanguagepb.GenerateMessageRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateMessageResponse, error) {
+ return c.internalClient.GenerateMessage(ctx, req, opts...)
+}
+
+// CountMessageTokens runs a model’s tokenizer on a string and returns the token count.
+func (c *DiscussClient) CountMessageTokens(ctx context.Context, req *generativelanguagepb.CountMessageTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountMessageTokensResponse, error) {
+ return c.internalClient.CountMessageTokens(ctx, req, opts...)
+}
+
+// discussGRPCClient is a client for interacting with Generative Language API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type discussGRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // Points back to the CallOptions field of the containing DiscussClient
+ CallOptions **DiscussCallOptions
+
+ // The gRPC API client.
+ discussClient generativelanguagepb.DiscussServiceClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogHeaders []string
+}
+
+// NewDiscussClient creates a new discuss service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// An API for using Generative Language Models (GLMs) in dialog applications.
+//
+// Also known as large language models (LLMs), this API provides models that
+// are trained for multi-turn dialog.
+func NewDiscussClient(ctx context.Context, opts ...option.ClientOption) (*DiscussClient, error) {
+ clientOpts := defaultDiscussGRPCClientOptions()
+ if newDiscussClientHook != nil {
+ hookOpts, err := newDiscussClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := DiscussClient{CallOptions: defaultDiscussCallOptions()}
+
+ c := &discussGRPCClient{
+ connPool: connPool,
+ discussClient: generativelanguagepb.NewDiscussServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *discussGRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *discussGRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *discussGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type discussRESTClient struct {
+ // The http endpoint to connect to.
+ endpoint string
+
+ // The http client.
+ httpClient *http.Client
+
+ // The x-goog-* headers to be sent with each request.
+ xGoogHeaders []string
+
+ // Points back to the CallOptions field of the containing DiscussClient
+ CallOptions **DiscussCallOptions
+}
+
+// NewDiscussRESTClient creates a new discuss service rest client.
+//
+// An API for using Generative Language Models (GLMs) in dialog applications.
+//
+// Also known as large language models (LLMs), this API provides models that
+// are trained for multi-turn dialog.
+func NewDiscussRESTClient(ctx context.Context, opts ...option.ClientOption) (*DiscussClient, error) {
+ clientOpts := append(defaultDiscussRESTClientOptions(), opts...)
+ httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
+ if err != nil {
+ return nil, err
+ }
+
+ callOpts := defaultDiscussRESTCallOptions()
+ c := &discussRESTClient{
+ endpoint: endpoint,
+ httpClient: httpClient,
+ CallOptions: &callOpts,
+ }
+ c.setGoogleClientInfo()
+
+ return &DiscussClient{internalClient: c, CallOptions: callOpts}, nil
+}
+
+func defaultDiscussRESTClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("https://generativelanguage.googleapis.com"),
+ internaloption.WithDefaultEndpointTemplate("https://generativelanguage.UNIVERSE_DOMAIN"),
+ internaloption.WithDefaultMTLSEndpoint("https://generativelanguage.mtls.googleapis.com"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ }
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *discussRESTClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *discussRESTClient) Close() error {
+ // Replace httpClient with nil to force cleanup.
+ c.httpClient = nil
+ return nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: This method always returns nil.
+func (c *discussRESTClient) Connection() *grpc.ClientConn {
+ return nil
+}
+func (c *discussGRPCClient) GenerateMessage(ctx context.Context, req *generativelanguagepb.GenerateMessageRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateMessageResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateMessage[0:len((*c.CallOptions).GenerateMessage):len((*c.CallOptions).GenerateMessage)], opts...)
+ var resp *generativelanguagepb.GenerateMessageResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.discussClient.GenerateMessage(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *discussGRPCClient) CountMessageTokens(ctx context.Context, req *generativelanguagepb.CountMessageTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountMessageTokensResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).CountMessageTokens[0:len((*c.CallOptions).CountMessageTokens):len((*c.CallOptions).CountMessageTokens)], opts...)
+ var resp *generativelanguagepb.CountMessageTokensResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.discussClient.CountMessageTokens(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GenerateMessage generates a response from the model given an input MessagePrompt.
+func (c *discussRESTClient) GenerateMessage(ctx context.Context, req *generativelanguagepb.GenerateMessageRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateMessageResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:generateMessage", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateMessage[0:len((*c.CallOptions).GenerateMessage):len((*c.CallOptions).GenerateMessage)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.GenerateMessageResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// CountMessageTokens runs a model’s tokenizer on a string and returns the token count.
+func (c *discussRESTClient) CountMessageTokens(ctx context.Context, req *generativelanguagepb.CountMessageTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountMessageTokensResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:countMessageTokens", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CountMessageTokens[0:len((*c.CallOptions).CountMessageTokens):len((*c.CallOptions).CountMessageTokens)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.CountMessageTokensResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/doc.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/doc.go
new file mode 100644
index 000000000..3bcdb2c11
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/doc.go
@@ -0,0 +1,129 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+// Package generativelanguage is an auto-generated package for the
+// Generative Language API.
+//
+// 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.
+//
+// NOTE: This package is in beta. It is not stable, and may be subject to changes.
+//
+// # General documentation
+//
+// For information that is relevant for all client libraries please reference
+// https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this
+// page includes:
+//
+// - [Authentication and Authorization]
+// - [Timeouts and Cancellation]
+// - [Testing against Client Libraries]
+// - [Debugging Client Libraries]
+// - [Inspecting errors]
+//
+// # Example usage
+//
+// To get started with this package, create a client.
+//
+// ctx := context.Background()
+// // This snippet has been automatically generated and should be regarded as a code template only.
+// // It will require modifications to work:
+// // - It may require correct/in-range values for request initialization.
+// // - It may require specifying regional endpoints when creating the service client as shown in:
+// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
+// c, err := generativelanguage.NewDiscussClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// The client will use your default application credentials. Clients should be reused instead of created as needed.
+// The methods of Client are safe for concurrent use by multiple goroutines.
+// The returned client must be Closed when it is done being used.
+//
+// # Using the Client
+//
+// The following is an example of making an API call with the newly created client.
+//
+// ctx := context.Background()
+// // This snippet has been automatically generated and should be regarded as a code template only.
+// // It will require modifications to work:
+// // - It may require correct/in-range values for request initialization.
+// // - It may require specifying regional endpoints when creating the service client as shown in:
+// // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
+// c, err := generativelanguage.NewDiscussClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// req := &generativelanguagepb.CountMessageTokensRequest{
+// // TODO: Fill request struct fields.
+// // See https://pkg.go.dev/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb#CountMessageTokensRequest.
+// }
+// resp, err := c.CountMessageTokens(ctx, req)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// // TODO: Use resp.
+// _ = resp
+//
+// # Use of Context
+//
+// The ctx passed to NewDiscussClient is used for authentication requests and
+// for creating the underlying connection, but is not used for subsequent calls.
+// Individual methods on the client use the ctx given to them.
+//
+// To close the open connection, use the Close() method.
+//
+// [Authentication and Authorization]: https://pkg.go.dev/cloud.google.com/go#hdr-Authentication_and_Authorization
+// [Timeouts and Cancellation]: https://pkg.go.dev/cloud.google.com/go#hdr-Timeouts_and_Cancellation
+// [Testing against Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Testing
+// [Debugging Client Libraries]: https://pkg.go.dev/cloud.google.com/go#hdr-Debugging
+// [Inspecting errors]: https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors
+package generativelanguage // import "cloud.google.com/go/ai/generativelanguage/apiv1beta"
+
+import (
+ "context"
+
+ "google.golang.org/api/option"
+)
+
+// For more information on implementing a client constructor hook, see
+// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors.
+type clientHookParams struct{}
+type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error)
+
+var versionClient string
+
+func getVersionClient() string {
+ if versionClient == "" {
+ return "UNKNOWN"
+ }
+ return versionClient
+}
+
+// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
+func DefaultAuthScopes() []string {
+ return []string{
+ "",
+ }
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/file_client.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/file_client.go
new file mode 100644
index 000000000..ed28fc9d7
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/file_client.go
@@ -0,0 +1,633 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "math"
+ "net/http"
+ "net/url"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ httptransport "google.golang.org/api/transport/http"
+ "google.golang.org/grpc"
+ "google.golang.org/protobuf/encoding/protojson"
+ "google.golang.org/protobuf/proto"
+)
+
+var newFileClientHook clientHook
+
+// FileCallOptions contains the retry settings for each method of FileClient.
+type FileCallOptions struct {
+ CreateFile []gax.CallOption
+ ListFiles []gax.CallOption
+ GetFile []gax.CallOption
+ DeleteFile []gax.CallOption
+}
+
+func defaultFileGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("generativelanguage.googleapis.com:443"),
+ internaloption.WithDefaultEndpointTemplate("generativelanguage.UNIVERSE_DOMAIN:443"),
+ internaloption.WithDefaultMTLSEndpoint("generativelanguage.mtls.googleapis.com:443"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultFileCallOptions() *FileCallOptions {
+ return &FileCallOptions{
+ CreateFile: []gax.CallOption{},
+ ListFiles: []gax.CallOption{},
+ GetFile: []gax.CallOption{},
+ DeleteFile: []gax.CallOption{},
+ }
+}
+
+func defaultFileRESTCallOptions() *FileCallOptions {
+ return &FileCallOptions{
+ CreateFile: []gax.CallOption{},
+ ListFiles: []gax.CallOption{},
+ GetFile: []gax.CallOption{},
+ DeleteFile: []gax.CallOption{},
+ }
+}
+
+// internalFileClient is an interface that defines the methods available from Generative Language API.
+type internalFileClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ CreateFile(context.Context, *generativelanguagepb.CreateFileRequest, ...gax.CallOption) (*generativelanguagepb.CreateFileResponse, error)
+ ListFiles(context.Context, *generativelanguagepb.ListFilesRequest, ...gax.CallOption) *FileIterator
+ GetFile(context.Context, *generativelanguagepb.GetFileRequest, ...gax.CallOption) (*generativelanguagepb.File, error)
+ DeleteFile(context.Context, *generativelanguagepb.DeleteFileRequest, ...gax.CallOption) error
+}
+
+// FileClient is a client for interacting with Generative Language API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// An API for uploading and managing files.
+type FileClient struct {
+ // The internal transport-dependent client.
+ internalClient internalFileClient
+
+ // The call options for this service.
+ CallOptions *FileCallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *FileClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *FileClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *FileClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// CreateFile creates a File.
+func (c *FileClient) CreateFile(ctx context.Context, req *generativelanguagepb.CreateFileRequest, opts ...gax.CallOption) (*generativelanguagepb.CreateFileResponse, error) {
+ return c.internalClient.CreateFile(ctx, req, opts...)
+}
+
+// ListFiles lists the metadata for Files owned by the requesting project.
+func (c *FileClient) ListFiles(ctx context.Context, req *generativelanguagepb.ListFilesRequest, opts ...gax.CallOption) *FileIterator {
+ return c.internalClient.ListFiles(ctx, req, opts...)
+}
+
+// GetFile gets the metadata for the given File.
+func (c *FileClient) GetFile(ctx context.Context, req *generativelanguagepb.GetFileRequest, opts ...gax.CallOption) (*generativelanguagepb.File, error) {
+ return c.internalClient.GetFile(ctx, req, opts...)
+}
+
+// DeleteFile deletes the File.
+func (c *FileClient) DeleteFile(ctx context.Context, req *generativelanguagepb.DeleteFileRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteFile(ctx, req, opts...)
+}
+
+// fileGRPCClient is a client for interacting with Generative Language API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type fileGRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // Points back to the CallOptions field of the containing FileClient
+ CallOptions **FileCallOptions
+
+ // The gRPC API client.
+ fileClient generativelanguagepb.FileServiceClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogHeaders []string
+}
+
+// NewFileClient creates a new file service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// An API for uploading and managing files.
+func NewFileClient(ctx context.Context, opts ...option.ClientOption) (*FileClient, error) {
+ clientOpts := defaultFileGRPCClientOptions()
+ if newFileClientHook != nil {
+ hookOpts, err := newFileClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := FileClient{CallOptions: defaultFileCallOptions()}
+
+ c := &fileGRPCClient{
+ connPool: connPool,
+ fileClient: generativelanguagepb.NewFileServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *fileGRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *fileGRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *fileGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type fileRESTClient struct {
+ // The http endpoint to connect to.
+ endpoint string
+
+ // The http client.
+ httpClient *http.Client
+
+ // The x-goog-* headers to be sent with each request.
+ xGoogHeaders []string
+
+ // Points back to the CallOptions field of the containing FileClient
+ CallOptions **FileCallOptions
+}
+
+// NewFileRESTClient creates a new file service rest client.
+//
+// An API for uploading and managing files.
+func NewFileRESTClient(ctx context.Context, opts ...option.ClientOption) (*FileClient, error) {
+ clientOpts := append(defaultFileRESTClientOptions(), opts...)
+ httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
+ if err != nil {
+ return nil, err
+ }
+
+ callOpts := defaultFileRESTCallOptions()
+ c := &fileRESTClient{
+ endpoint: endpoint,
+ httpClient: httpClient,
+ CallOptions: &callOpts,
+ }
+ c.setGoogleClientInfo()
+
+ return &FileClient{internalClient: c, CallOptions: callOpts}, nil
+}
+
+func defaultFileRESTClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("https://generativelanguage.googleapis.com"),
+ internaloption.WithDefaultEndpointTemplate("https://generativelanguage.UNIVERSE_DOMAIN"),
+ internaloption.WithDefaultMTLSEndpoint("https://generativelanguage.mtls.googleapis.com"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ }
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *fileRESTClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *fileRESTClient) Close() error {
+ // Replace httpClient with nil to force cleanup.
+ c.httpClient = nil
+ return nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: This method always returns nil.
+func (c *fileRESTClient) Connection() *grpc.ClientConn {
+ return nil
+}
+func (c *fileGRPCClient) CreateFile(ctx context.Context, req *generativelanguagepb.CreateFileRequest, opts ...gax.CallOption) (*generativelanguagepb.CreateFileResponse, error) {
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ opts = append((*c.CallOptions).CreateFile[0:len((*c.CallOptions).CreateFile):len((*c.CallOptions).CreateFile)], opts...)
+ var resp *generativelanguagepb.CreateFileResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.fileClient.CreateFile(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *fileGRPCClient) ListFiles(ctx context.Context, req *generativelanguagepb.ListFilesRequest, opts ...gax.CallOption) *FileIterator {
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ opts = append((*c.CallOptions).ListFiles[0:len((*c.CallOptions).ListFiles):len((*c.CallOptions).ListFiles)], opts...)
+ it := &FileIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListFilesRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.File, string, error) {
+ resp := &generativelanguagepb.ListFilesResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.fileClient.ListFiles(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetFiles(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *fileGRPCClient) GetFile(ctx context.Context, req *generativelanguagepb.GetFileRequest, opts ...gax.CallOption) (*generativelanguagepb.File, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GetFile[0:len((*c.CallOptions).GetFile):len((*c.CallOptions).GetFile)], opts...)
+ var resp *generativelanguagepb.File
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.fileClient.GetFile(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *fileGRPCClient) DeleteFile(ctx context.Context, req *generativelanguagepb.DeleteFileRequest, opts ...gax.CallOption) error {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).DeleteFile[0:len((*c.CallOptions).DeleteFile):len((*c.CallOptions).DeleteFile)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.fileClient.DeleteFile(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// CreateFile creates a File.
+func (c *fileRESTClient) CreateFile(ctx context.Context, req *generativelanguagepb.CreateFileRequest, opts ...gax.CallOption) (*generativelanguagepb.CreateFileResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/files")
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CreateFile[0:len((*c.CallOptions).CreateFile):len((*c.CallOptions).CreateFile)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.CreateFileResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// ListFiles lists the metadata for Files owned by the requesting project.
+func (c *fileRESTClient) ListFiles(ctx context.Context, req *generativelanguagepb.ListFilesRequest, opts ...gax.CallOption) *FileIterator {
+ it := &FileIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListFilesRequest)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.File, string, error) {
+ resp := &generativelanguagepb.ListFilesResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, "", err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/files")
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetPageSize() != 0 {
+ params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
+ }
+ if req.GetPageToken() != "" {
+ params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, "", e
+ }
+ it.Response = resp
+ return resp.GetFiles(), resp.GetNextPageToken(), nil
+ }
+
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// GetFile gets the metadata for the given File.
+func (c *fileRESTClient) GetFile(ctx context.Context, req *generativelanguagepb.GetFileRequest, opts ...gax.CallOption) (*generativelanguagepb.File, error) {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GetFile[0:len((*c.CallOptions).GetFile):len((*c.CallOptions).GetFile)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.File{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// DeleteFile deletes the File.
+func (c *fileRESTClient) DeleteFile(ctx context.Context, req *generativelanguagepb.DeleteFileRequest, opts ...gax.CallOption) error {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ // Returns nil if there is no error, otherwise wraps
+ // the response code and body into a non-nil error
+ return googleapi.CheckResponse(httpRsp)
+ }, opts...)
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/gapic_metadata.json b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/gapic_metadata.json
new file mode 100644
index 000000000..43988e389
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/gapic_metadata.json
@@ -0,0 +1,597 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
+ "language": "go",
+ "protoPackage": "google.ai.generativelanguage.v1beta",
+ "libraryPackage": "cloud.google.com/go/ai/generativelanguage/apiv1beta",
+ "services": {
+ "DiscussService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "DiscussClient",
+ "rpcs": {
+ "CountMessageTokens": {
+ "methods": [
+ "CountMessageTokens"
+ ]
+ },
+ "GenerateMessage": {
+ "methods": [
+ "GenerateMessage"
+ ]
+ }
+ }
+ },
+ "rest": {
+ "libraryClient": "DiscussClient",
+ "rpcs": {
+ "CountMessageTokens": {
+ "methods": [
+ "CountMessageTokens"
+ ]
+ },
+ "GenerateMessage": {
+ "methods": [
+ "GenerateMessage"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "FileService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "FileClient",
+ "rpcs": {
+ "CreateFile": {
+ "methods": [
+ "CreateFile"
+ ]
+ },
+ "DeleteFile": {
+ "methods": [
+ "DeleteFile"
+ ]
+ },
+ "GetFile": {
+ "methods": [
+ "GetFile"
+ ]
+ },
+ "ListFiles": {
+ "methods": [
+ "ListFiles"
+ ]
+ }
+ }
+ },
+ "rest": {
+ "libraryClient": "FileClient",
+ "rpcs": {
+ "CreateFile": {
+ "methods": [
+ "CreateFile"
+ ]
+ },
+ "DeleteFile": {
+ "methods": [
+ "DeleteFile"
+ ]
+ },
+ "GetFile": {
+ "methods": [
+ "GetFile"
+ ]
+ },
+ "ListFiles": {
+ "methods": [
+ "ListFiles"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "GenerativeService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "GenerativeClient",
+ "rpcs": {
+ "BatchEmbedContents": {
+ "methods": [
+ "BatchEmbedContents"
+ ]
+ },
+ "CountTokens": {
+ "methods": [
+ "CountTokens"
+ ]
+ },
+ "EmbedContent": {
+ "methods": [
+ "EmbedContent"
+ ]
+ },
+ "GenerateAnswer": {
+ "methods": [
+ "GenerateAnswer"
+ ]
+ },
+ "GenerateContent": {
+ "methods": [
+ "GenerateContent"
+ ]
+ },
+ "StreamGenerateContent": {
+ "methods": [
+ "StreamGenerateContent"
+ ]
+ }
+ }
+ },
+ "rest": {
+ "libraryClient": "GenerativeClient",
+ "rpcs": {
+ "BatchEmbedContents": {
+ "methods": [
+ "BatchEmbedContents"
+ ]
+ },
+ "CountTokens": {
+ "methods": [
+ "CountTokens"
+ ]
+ },
+ "EmbedContent": {
+ "methods": [
+ "EmbedContent"
+ ]
+ },
+ "GenerateAnswer": {
+ "methods": [
+ "GenerateAnswer"
+ ]
+ },
+ "GenerateContent": {
+ "methods": [
+ "GenerateContent"
+ ]
+ },
+ "StreamGenerateContent": {
+ "methods": [
+ "StreamGenerateContent"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "ModelService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "ModelClient",
+ "rpcs": {
+ "CreateTunedModel": {
+ "methods": [
+ "CreateTunedModel"
+ ]
+ },
+ "DeleteTunedModel": {
+ "methods": [
+ "DeleteTunedModel"
+ ]
+ },
+ "GetModel": {
+ "methods": [
+ "GetModel"
+ ]
+ },
+ "GetTunedModel": {
+ "methods": [
+ "GetTunedModel"
+ ]
+ },
+ "ListModels": {
+ "methods": [
+ "ListModels"
+ ]
+ },
+ "ListTunedModels": {
+ "methods": [
+ "ListTunedModels"
+ ]
+ },
+ "UpdateTunedModel": {
+ "methods": [
+ "UpdateTunedModel"
+ ]
+ }
+ }
+ },
+ "rest": {
+ "libraryClient": "ModelClient",
+ "rpcs": {
+ "CreateTunedModel": {
+ "methods": [
+ "CreateTunedModel"
+ ]
+ },
+ "DeleteTunedModel": {
+ "methods": [
+ "DeleteTunedModel"
+ ]
+ },
+ "GetModel": {
+ "methods": [
+ "GetModel"
+ ]
+ },
+ "GetTunedModel": {
+ "methods": [
+ "GetTunedModel"
+ ]
+ },
+ "ListModels": {
+ "methods": [
+ "ListModels"
+ ]
+ },
+ "ListTunedModels": {
+ "methods": [
+ "ListTunedModels"
+ ]
+ },
+ "UpdateTunedModel": {
+ "methods": [
+ "UpdateTunedModel"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "PermissionService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "PermissionClient",
+ "rpcs": {
+ "CreatePermission": {
+ "methods": [
+ "CreatePermission"
+ ]
+ },
+ "DeletePermission": {
+ "methods": [
+ "DeletePermission"
+ ]
+ },
+ "GetPermission": {
+ "methods": [
+ "GetPermission"
+ ]
+ },
+ "ListPermissions": {
+ "methods": [
+ "ListPermissions"
+ ]
+ },
+ "TransferOwnership": {
+ "methods": [
+ "TransferOwnership"
+ ]
+ },
+ "UpdatePermission": {
+ "methods": [
+ "UpdatePermission"
+ ]
+ }
+ }
+ },
+ "rest": {
+ "libraryClient": "PermissionClient",
+ "rpcs": {
+ "CreatePermission": {
+ "methods": [
+ "CreatePermission"
+ ]
+ },
+ "DeletePermission": {
+ "methods": [
+ "DeletePermission"
+ ]
+ },
+ "GetPermission": {
+ "methods": [
+ "GetPermission"
+ ]
+ },
+ "ListPermissions": {
+ "methods": [
+ "ListPermissions"
+ ]
+ },
+ "TransferOwnership": {
+ "methods": [
+ "TransferOwnership"
+ ]
+ },
+ "UpdatePermission": {
+ "methods": [
+ "UpdatePermission"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "RetrieverService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "RetrieverClient",
+ "rpcs": {
+ "BatchCreateChunks": {
+ "methods": [
+ "BatchCreateChunks"
+ ]
+ },
+ "BatchDeleteChunks": {
+ "methods": [
+ "BatchDeleteChunks"
+ ]
+ },
+ "BatchUpdateChunks": {
+ "methods": [
+ "BatchUpdateChunks"
+ ]
+ },
+ "CreateChunk": {
+ "methods": [
+ "CreateChunk"
+ ]
+ },
+ "CreateCorpus": {
+ "methods": [
+ "CreateCorpus"
+ ]
+ },
+ "CreateDocument": {
+ "methods": [
+ "CreateDocument"
+ ]
+ },
+ "DeleteChunk": {
+ "methods": [
+ "DeleteChunk"
+ ]
+ },
+ "DeleteCorpus": {
+ "methods": [
+ "DeleteCorpus"
+ ]
+ },
+ "DeleteDocument": {
+ "methods": [
+ "DeleteDocument"
+ ]
+ },
+ "GetChunk": {
+ "methods": [
+ "GetChunk"
+ ]
+ },
+ "GetCorpus": {
+ "methods": [
+ "GetCorpus"
+ ]
+ },
+ "GetDocument": {
+ "methods": [
+ "GetDocument"
+ ]
+ },
+ "ListChunks": {
+ "methods": [
+ "ListChunks"
+ ]
+ },
+ "ListCorpora": {
+ "methods": [
+ "ListCorpora"
+ ]
+ },
+ "ListDocuments": {
+ "methods": [
+ "ListDocuments"
+ ]
+ },
+ "QueryCorpus": {
+ "methods": [
+ "QueryCorpus"
+ ]
+ },
+ "QueryDocument": {
+ "methods": [
+ "QueryDocument"
+ ]
+ },
+ "UpdateChunk": {
+ "methods": [
+ "UpdateChunk"
+ ]
+ },
+ "UpdateCorpus": {
+ "methods": [
+ "UpdateCorpus"
+ ]
+ },
+ "UpdateDocument": {
+ "methods": [
+ "UpdateDocument"
+ ]
+ }
+ }
+ },
+ "rest": {
+ "libraryClient": "RetrieverClient",
+ "rpcs": {
+ "BatchCreateChunks": {
+ "methods": [
+ "BatchCreateChunks"
+ ]
+ },
+ "BatchDeleteChunks": {
+ "methods": [
+ "BatchDeleteChunks"
+ ]
+ },
+ "BatchUpdateChunks": {
+ "methods": [
+ "BatchUpdateChunks"
+ ]
+ },
+ "CreateChunk": {
+ "methods": [
+ "CreateChunk"
+ ]
+ },
+ "CreateCorpus": {
+ "methods": [
+ "CreateCorpus"
+ ]
+ },
+ "CreateDocument": {
+ "methods": [
+ "CreateDocument"
+ ]
+ },
+ "DeleteChunk": {
+ "methods": [
+ "DeleteChunk"
+ ]
+ },
+ "DeleteCorpus": {
+ "methods": [
+ "DeleteCorpus"
+ ]
+ },
+ "DeleteDocument": {
+ "methods": [
+ "DeleteDocument"
+ ]
+ },
+ "GetChunk": {
+ "methods": [
+ "GetChunk"
+ ]
+ },
+ "GetCorpus": {
+ "methods": [
+ "GetCorpus"
+ ]
+ },
+ "GetDocument": {
+ "methods": [
+ "GetDocument"
+ ]
+ },
+ "ListChunks": {
+ "methods": [
+ "ListChunks"
+ ]
+ },
+ "ListCorpora": {
+ "methods": [
+ "ListCorpora"
+ ]
+ },
+ "ListDocuments": {
+ "methods": [
+ "ListDocuments"
+ ]
+ },
+ "QueryCorpus": {
+ "methods": [
+ "QueryCorpus"
+ ]
+ },
+ "QueryDocument": {
+ "methods": [
+ "QueryDocument"
+ ]
+ },
+ "UpdateChunk": {
+ "methods": [
+ "UpdateChunk"
+ ]
+ },
+ "UpdateCorpus": {
+ "methods": [
+ "UpdateCorpus"
+ ]
+ },
+ "UpdateDocument": {
+ "methods": [
+ "UpdateDocument"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "TextService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "TextClient",
+ "rpcs": {
+ "BatchEmbedText": {
+ "methods": [
+ "BatchEmbedText"
+ ]
+ },
+ "CountTextTokens": {
+ "methods": [
+ "CountTextTokens"
+ ]
+ },
+ "EmbedText": {
+ "methods": [
+ "EmbedText"
+ ]
+ },
+ "GenerateText": {
+ "methods": [
+ "GenerateText"
+ ]
+ }
+ }
+ },
+ "rest": {
+ "libraryClient": "TextClient",
+ "rpcs": {
+ "BatchEmbedText": {
+ "methods": [
+ "BatchEmbedText"
+ ]
+ },
+ "CountTextTokens": {
+ "methods": [
+ "CountTextTokens"
+ ]
+ },
+ "EmbedText": {
+ "methods": [
+ "EmbedText"
+ ]
+ },
+ "GenerateText": {
+ "methods": [
+ "GenerateText"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generative_client.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generative_client.go
new file mode 100644
index 000000000..7d41832d9
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generative_client.go
@@ -0,0 +1,999 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "bytes"
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "net/http"
+ "net/url"
+ "time"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ httptransport "google.golang.org/api/transport/http"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/encoding/protojson"
+)
+
+var newGenerativeClientHook clientHook
+
+// GenerativeCallOptions contains the retry settings for each method of GenerativeClient.
+type GenerativeCallOptions struct {
+ GenerateContent []gax.CallOption
+ GenerateAnswer []gax.CallOption
+ StreamGenerateContent []gax.CallOption
+ EmbedContent []gax.CallOption
+ BatchEmbedContents []gax.CallOption
+ CountTokens []gax.CallOption
+}
+
+func defaultGenerativeGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("generativelanguage.googleapis.com:443"),
+ internaloption.WithDefaultEndpointTemplate("generativelanguage.UNIVERSE_DOMAIN:443"),
+ internaloption.WithDefaultMTLSEndpoint("generativelanguage.mtls.googleapis.com:443"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultGenerativeCallOptions() *GenerativeCallOptions {
+ return &GenerativeCallOptions{
+ GenerateContent: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GenerateAnswer: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ StreamGenerateContent: []gax.CallOption{
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ EmbedContent: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ BatchEmbedContents: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CountTokens: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ }
+}
+
+func defaultGenerativeRESTCallOptions() *GenerativeCallOptions {
+ return &GenerativeCallOptions{
+ GenerateContent: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ GenerateAnswer: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ StreamGenerateContent: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ EmbedContent: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ BatchEmbedContents: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ CountTokens: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ }
+}
+
+// internalGenerativeClient is an interface that defines the methods available from Generative Language API.
+type internalGenerativeClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ GenerateContent(context.Context, *generativelanguagepb.GenerateContentRequest, ...gax.CallOption) (*generativelanguagepb.GenerateContentResponse, error)
+ GenerateAnswer(context.Context, *generativelanguagepb.GenerateAnswerRequest, ...gax.CallOption) (*generativelanguagepb.GenerateAnswerResponse, error)
+ StreamGenerateContent(context.Context, *generativelanguagepb.GenerateContentRequest, ...gax.CallOption) (generativelanguagepb.GenerativeService_StreamGenerateContentClient, error)
+ EmbedContent(context.Context, *generativelanguagepb.EmbedContentRequest, ...gax.CallOption) (*generativelanguagepb.EmbedContentResponse, error)
+ BatchEmbedContents(context.Context, *generativelanguagepb.BatchEmbedContentsRequest, ...gax.CallOption) (*generativelanguagepb.BatchEmbedContentsResponse, error)
+ CountTokens(context.Context, *generativelanguagepb.CountTokensRequest, ...gax.CallOption) (*generativelanguagepb.CountTokensResponse, error)
+}
+
+// GenerativeClient is a client for interacting with Generative Language API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// API for using Large Models that generate multimodal content and have
+// additional capabilities beyond text generation.
+type GenerativeClient struct {
+ // The internal transport-dependent client.
+ internalClient internalGenerativeClient
+
+ // The call options for this service.
+ CallOptions *GenerativeCallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *GenerativeClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *GenerativeClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *GenerativeClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// GenerateContent generates a response from the model given an input
+// GenerateContentRequest.
+//
+// Input capabilities differ between models, including tuned models. See the
+// model guide (at https://ai.google.dev/models/gemini) and
+// tuning guide (at https://ai.google.dev/docs/model_tuning_guidance) for
+// details.
+func (c *GenerativeClient) GenerateContent(ctx context.Context, req *generativelanguagepb.GenerateContentRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateContentResponse, error) {
+ return c.internalClient.GenerateContent(ctx, req, opts...)
+}
+
+// GenerateAnswer generates a grounded answer from the model given an input
+// GenerateAnswerRequest.
+func (c *GenerativeClient) GenerateAnswer(ctx context.Context, req *generativelanguagepb.GenerateAnswerRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateAnswerResponse, error) {
+ return c.internalClient.GenerateAnswer(ctx, req, opts...)
+}
+
+// StreamGenerateContent generates a streamed response from the model given an input
+// GenerateContentRequest.
+func (c *GenerativeClient) StreamGenerateContent(ctx context.Context, req *generativelanguagepb.GenerateContentRequest, opts ...gax.CallOption) (generativelanguagepb.GenerativeService_StreamGenerateContentClient, error) {
+ return c.internalClient.StreamGenerateContent(ctx, req, opts...)
+}
+
+// EmbedContent generates an embedding from the model given an input Content.
+func (c *GenerativeClient) EmbedContent(ctx context.Context, req *generativelanguagepb.EmbedContentRequest, opts ...gax.CallOption) (*generativelanguagepb.EmbedContentResponse, error) {
+ return c.internalClient.EmbedContent(ctx, req, opts...)
+}
+
+// BatchEmbedContents generates multiple embeddings from the model given input text in a
+// synchronous call.
+func (c *GenerativeClient) BatchEmbedContents(ctx context.Context, req *generativelanguagepb.BatchEmbedContentsRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchEmbedContentsResponse, error) {
+ return c.internalClient.BatchEmbedContents(ctx, req, opts...)
+}
+
+// CountTokens runs a model’s tokenizer on input content and returns the token count.
+func (c *GenerativeClient) CountTokens(ctx context.Context, req *generativelanguagepb.CountTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountTokensResponse, error) {
+ return c.internalClient.CountTokens(ctx, req, opts...)
+}
+
+// generativeGRPCClient is a client for interacting with Generative Language API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type generativeGRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // Points back to the CallOptions field of the containing GenerativeClient
+ CallOptions **GenerativeCallOptions
+
+ // The gRPC API client.
+ generativeClient generativelanguagepb.GenerativeServiceClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogHeaders []string
+}
+
+// NewGenerativeClient creates a new generative service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// API for using Large Models that generate multimodal content and have
+// additional capabilities beyond text generation.
+func NewGenerativeClient(ctx context.Context, opts ...option.ClientOption) (*GenerativeClient, error) {
+ clientOpts := defaultGenerativeGRPCClientOptions()
+ if newGenerativeClientHook != nil {
+ hookOpts, err := newGenerativeClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := GenerativeClient{CallOptions: defaultGenerativeCallOptions()}
+
+ c := &generativeGRPCClient{
+ connPool: connPool,
+ generativeClient: generativelanguagepb.NewGenerativeServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *generativeGRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *generativeGRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *generativeGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type generativeRESTClient struct {
+ // The http endpoint to connect to.
+ endpoint string
+
+ // The http client.
+ httpClient *http.Client
+
+ // The x-goog-* headers to be sent with each request.
+ xGoogHeaders []string
+
+ // Points back to the CallOptions field of the containing GenerativeClient
+ CallOptions **GenerativeCallOptions
+}
+
+// NewGenerativeRESTClient creates a new generative service rest client.
+//
+// API for using Large Models that generate multimodal content and have
+// additional capabilities beyond text generation.
+func NewGenerativeRESTClient(ctx context.Context, opts ...option.ClientOption) (*GenerativeClient, error) {
+ clientOpts := append(defaultGenerativeRESTClientOptions(), opts...)
+ httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
+ if err != nil {
+ return nil, err
+ }
+
+ callOpts := defaultGenerativeRESTCallOptions()
+ c := &generativeRESTClient{
+ endpoint: endpoint,
+ httpClient: httpClient,
+ CallOptions: &callOpts,
+ }
+ c.setGoogleClientInfo()
+
+ return &GenerativeClient{internalClient: c, CallOptions: callOpts}, nil
+}
+
+func defaultGenerativeRESTClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("https://generativelanguage.googleapis.com"),
+ internaloption.WithDefaultEndpointTemplate("https://generativelanguage.UNIVERSE_DOMAIN"),
+ internaloption.WithDefaultMTLSEndpoint("https://generativelanguage.mtls.googleapis.com"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ }
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *generativeRESTClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *generativeRESTClient) Close() error {
+ // Replace httpClient with nil to force cleanup.
+ c.httpClient = nil
+ return nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: This method always returns nil.
+func (c *generativeRESTClient) Connection() *grpc.ClientConn {
+ return nil
+}
+func (c *generativeGRPCClient) GenerateContent(ctx context.Context, req *generativelanguagepb.GenerateContentRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateContentResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateContent[0:len((*c.CallOptions).GenerateContent):len((*c.CallOptions).GenerateContent)], opts...)
+ var resp *generativelanguagepb.GenerateContentResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.generativeClient.GenerateContent(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *generativeGRPCClient) GenerateAnswer(ctx context.Context, req *generativelanguagepb.GenerateAnswerRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateAnswerResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateAnswer[0:len((*c.CallOptions).GenerateAnswer):len((*c.CallOptions).GenerateAnswer)], opts...)
+ var resp *generativelanguagepb.GenerateAnswerResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.generativeClient.GenerateAnswer(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *generativeGRPCClient) StreamGenerateContent(ctx context.Context, req *generativelanguagepb.GenerateContentRequest, opts ...gax.CallOption) (generativelanguagepb.GenerativeService_StreamGenerateContentClient, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).StreamGenerateContent[0:len((*c.CallOptions).StreamGenerateContent):len((*c.CallOptions).StreamGenerateContent)], opts...)
+ var resp generativelanguagepb.GenerativeService_StreamGenerateContentClient
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.generativeClient.StreamGenerateContent(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *generativeGRPCClient) EmbedContent(ctx context.Context, req *generativelanguagepb.EmbedContentRequest, opts ...gax.CallOption) (*generativelanguagepb.EmbedContentResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).EmbedContent[0:len((*c.CallOptions).EmbedContent):len((*c.CallOptions).EmbedContent)], opts...)
+ var resp *generativelanguagepb.EmbedContentResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.generativeClient.EmbedContent(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *generativeGRPCClient) BatchEmbedContents(ctx context.Context, req *generativelanguagepb.BatchEmbedContentsRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchEmbedContentsResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).BatchEmbedContents[0:len((*c.CallOptions).BatchEmbedContents):len((*c.CallOptions).BatchEmbedContents)], opts...)
+ var resp *generativelanguagepb.BatchEmbedContentsResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.generativeClient.BatchEmbedContents(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *generativeGRPCClient) CountTokens(ctx context.Context, req *generativelanguagepb.CountTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountTokensResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).CountTokens[0:len((*c.CallOptions).CountTokens):len((*c.CallOptions).CountTokens)], opts...)
+ var resp *generativelanguagepb.CountTokensResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.generativeClient.CountTokens(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GenerateContent generates a response from the model given an input
+// GenerateContentRequest.
+//
+// Input capabilities differ between models, including tuned models. See the
+// model guide (at https://ai.google.dev/models/gemini) and
+// tuning guide (at https://ai.google.dev/docs/model_tuning_guidance) for
+// details.
+func (c *generativeRESTClient) GenerateContent(ctx context.Context, req *generativelanguagepb.GenerateContentRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateContentResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:generateContent", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateContent[0:len((*c.CallOptions).GenerateContent):len((*c.CallOptions).GenerateContent)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.GenerateContentResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// GenerateAnswer generates a grounded answer from the model given an input
+// GenerateAnswerRequest.
+func (c *generativeRESTClient) GenerateAnswer(ctx context.Context, req *generativelanguagepb.GenerateAnswerRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateAnswerResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:generateAnswer", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateAnswer[0:len((*c.CallOptions).GenerateAnswer):len((*c.CallOptions).GenerateAnswer)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.GenerateAnswerResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// StreamGenerateContent generates a streamed response from the model given an input
+// GenerateContentRequest.
+func (c *generativeRESTClient) StreamGenerateContent(ctx context.Context, req *generativelanguagepb.GenerateContentRequest, opts ...gax.CallOption) (generativelanguagepb.GenerativeService_StreamGenerateContentClient, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:streamGenerateContent", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ var streamClient *streamGenerateContentRESTClient
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ streamClient = &streamGenerateContentRESTClient{
+ ctx: ctx,
+ md: metadata.MD(httpRsp.Header),
+ stream: gax.NewProtoJSONStreamReader(httpRsp.Body, (&generativelanguagepb.GenerateContentResponse{}).ProtoReflect().Type()),
+ }
+ return nil
+ }, opts...)
+
+ return streamClient, e
+}
+
+// streamGenerateContentRESTClient is the stream client used to consume the server stream created by
+// the REST implementation of StreamGenerateContent.
+type streamGenerateContentRESTClient struct {
+ ctx context.Context
+ md metadata.MD
+ stream *gax.ProtoJSONStream
+}
+
+func (c *streamGenerateContentRESTClient) Recv() (*generativelanguagepb.GenerateContentResponse, error) {
+ if err := c.ctx.Err(); err != nil {
+ defer c.stream.Close()
+ return nil, err
+ }
+ msg, err := c.stream.Recv()
+ if err != nil {
+ defer c.stream.Close()
+ return nil, err
+ }
+ res := msg.(*generativelanguagepb.GenerateContentResponse)
+ return res, nil
+}
+
+func (c *streamGenerateContentRESTClient) Header() (metadata.MD, error) {
+ return c.md, nil
+}
+
+func (c *streamGenerateContentRESTClient) Trailer() metadata.MD {
+ return c.md
+}
+
+func (c *streamGenerateContentRESTClient) CloseSend() error {
+ // This is a no-op to fulfill the interface.
+ return errors.New("this method is not implemented for a server-stream")
+}
+
+func (c *streamGenerateContentRESTClient) Context() context.Context {
+ return c.ctx
+}
+
+func (c *streamGenerateContentRESTClient) SendMsg(m interface{}) error {
+ // This is a no-op to fulfill the interface.
+ return errors.New("this method is not implemented for a server-stream")
+}
+
+func (c *streamGenerateContentRESTClient) RecvMsg(m interface{}) error {
+ // This is a no-op to fulfill the interface.
+ return errors.New("this method is not implemented, use Recv")
+}
+
+// EmbedContent generates an embedding from the model given an input Content.
+func (c *generativeRESTClient) EmbedContent(ctx context.Context, req *generativelanguagepb.EmbedContentRequest, opts ...gax.CallOption) (*generativelanguagepb.EmbedContentResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:embedContent", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).EmbedContent[0:len((*c.CallOptions).EmbedContent):len((*c.CallOptions).EmbedContent)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.EmbedContentResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// BatchEmbedContents generates multiple embeddings from the model given input text in a
+// synchronous call.
+func (c *generativeRESTClient) BatchEmbedContents(ctx context.Context, req *generativelanguagepb.BatchEmbedContentsRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchEmbedContentsResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:batchEmbedContents", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).BatchEmbedContents[0:len((*c.CallOptions).BatchEmbedContents):len((*c.CallOptions).BatchEmbedContents)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.BatchEmbedContentsResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// CountTokens runs a model’s tokenizer on input content and returns the token count.
+func (c *generativeRESTClient) CountTokens(ctx context.Context, req *generativelanguagepb.CountTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountTokensResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:countTokens", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CountTokens[0:len((*c.CallOptions).CountTokens):len((*c.CallOptions).CountTokens)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.CountTokensResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/citation.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/citation.pb.go
new file mode 100644
index 000000000..12d88f7ab
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/citation.pb.go
@@ -0,0 +1,290 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/citation.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// A collection of source attributions for a piece of content.
+type CitationMetadata struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Citations to sources for a specific response.
+ CitationSources []*CitationSource `protobuf:"bytes,1,rep,name=citation_sources,json=citationSources,proto3" json:"citation_sources,omitempty"`
+}
+
+func (x *CitationMetadata) Reset() {
+ *x = CitationMetadata{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CitationMetadata) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CitationMetadata) ProtoMessage() {}
+
+func (x *CitationMetadata) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_citation_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 CitationMetadata.ProtoReflect.Descriptor instead.
+func (*CitationMetadata) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_citation_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CitationMetadata) GetCitationSources() []*CitationSource {
+ if x != nil {
+ return x.CitationSources
+ }
+ return nil
+}
+
+// A citation to a source for a portion of a specific response.
+type CitationSource struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. Start of segment of the response that is attributed to this
+ // source.
+ //
+ // Index indicates the start of the segment, measured in bytes.
+ StartIndex *int32 `protobuf:"varint,1,opt,name=start_index,json=startIndex,proto3,oneof" json:"start_index,omitempty"`
+ // Optional. End of the attributed segment, exclusive.
+ EndIndex *int32 `protobuf:"varint,2,opt,name=end_index,json=endIndex,proto3,oneof" json:"end_index,omitempty"`
+ // Optional. URI that is attributed as a source for a portion of the text.
+ Uri *string `protobuf:"bytes,3,opt,name=uri,proto3,oneof" json:"uri,omitempty"`
+ // Optional. License for the GitHub project that is attributed as a source for
+ // segment.
+ //
+ // License info is required for code citations.
+ License *string `protobuf:"bytes,4,opt,name=license,proto3,oneof" json:"license,omitempty"`
+}
+
+func (x *CitationSource) Reset() {
+ *x = CitationSource{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CitationSource) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CitationSource) ProtoMessage() {}
+
+func (x *CitationSource) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes[1]
+ 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 CitationSource.ProtoReflect.Descriptor instead.
+func (*CitationSource) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_citation_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *CitationSource) GetStartIndex() int32 {
+ if x != nil && x.StartIndex != nil {
+ return *x.StartIndex
+ }
+ return 0
+}
+
+func (x *CitationSource) GetEndIndex() int32 {
+ if x != nil && x.EndIndex != nil {
+ return *x.EndIndex
+ }
+ return 0
+}
+
+func (x *CitationSource) GetUri() string {
+ if x != nil && x.Uri != nil {
+ return *x.Uri
+ }
+ return ""
+}
+
+func (x *CitationSource) GetLicense() string {
+ if x != nil && x.License != nil {
+ return *x.License
+ }
+ return ""
+}
+
+var File_google_ai_generativelanguage_v1beta_citation_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_citation_proto_rawDesc = []byte{
+ 0x0a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61,
+ 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x72, 0x0a, 0x10, 0x43, 0x69,
+ 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x5e,
+ 0x0a, 0x10, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43,
+ 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x0f, 0x63,
+ 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0xd4,
+ 0x01, 0x0a, 0x0e, 0x43, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x0a, 0x73,
+ 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x09,
+ 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42,
+ 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78,
+ 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x03, 0x75, 0x72, 0x69, 0x88, 0x01, 0x01, 0x12,
+ 0x22, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x03, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65,
+ 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e,
+ 0x64, 0x65, 0x78, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x72, 0x69, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6c, 0x69,
+ 0x63, 0x65, 0x6e, 0x73, 0x65, 0x42, 0x99, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x42, 0x0d, 0x43, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
+ 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70,
+ 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70,
+ 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_citation_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_citation_proto_rawDescData = file_google_ai_generativelanguage_v1beta_citation_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_citation_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_citation_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_citation_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_citation_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_citation_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_google_ai_generativelanguage_v1beta_citation_proto_goTypes = []interface{}{
+ (*CitationMetadata)(nil), // 0: google.ai.generativelanguage.v1beta.CitationMetadata
+ (*CitationSource)(nil), // 1: google.ai.generativelanguage.v1beta.CitationSource
+}
+var file_google_ai_generativelanguage_v1beta_citation_proto_depIdxs = []int32{
+ 1, // 0: google.ai.generativelanguage.v1beta.CitationMetadata.citation_sources:type_name -> google.ai.generativelanguage.v1beta.CitationSource
+ 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_google_ai_generativelanguage_v1beta_citation_proto_init() }
+func file_google_ai_generativelanguage_v1beta_citation_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_citation_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CitationMetadata); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CitationSource); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes[1].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_citation_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 2,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_citation_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_citation_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_citation_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_citation_proto = out.File
+ file_google_ai_generativelanguage_v1beta_citation_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_citation_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_citation_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/content.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/content.pb.go
new file mode 100644
index 000000000..0c61961b6
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/content.pb.go
@@ -0,0 +1,1537 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/content.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ structpb "google.golang.org/protobuf/types/known/structpb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Type contains the list of OpenAPI data types as defined by
+// https://spec.openapis.org/oas/v3.0.3#data-types
+type Type int32
+
+const (
+ // Not specified, should not be used.
+ Type_TYPE_UNSPECIFIED Type = 0
+ // String type.
+ Type_STRING Type = 1
+ // Number type.
+ Type_NUMBER Type = 2
+ // Integer type.
+ Type_INTEGER Type = 3
+ // Boolean type.
+ Type_BOOLEAN Type = 4
+ // Array type.
+ Type_ARRAY Type = 5
+ // Object type.
+ Type_OBJECT Type = 6
+)
+
+// Enum value maps for Type.
+var (
+ Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "STRING",
+ 2: "NUMBER",
+ 3: "INTEGER",
+ 4: "BOOLEAN",
+ 5: "ARRAY",
+ 6: "OBJECT",
+ }
+ Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "STRING": 1,
+ "NUMBER": 2,
+ "INTEGER": 3,
+ "BOOLEAN": 4,
+ "ARRAY": 5,
+ "OBJECT": 6,
+ }
+)
+
+func (x Type) Enum() *Type {
+ p := new(Type)
+ *p = x
+ return p
+}
+
+func (x Type) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Type) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_content_proto_enumTypes[0].Descriptor()
+}
+
+func (Type) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_content_proto_enumTypes[0]
+}
+
+func (x Type) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Type.Descriptor instead.
+func (Type) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{0}
+}
+
+// Defines the execution behavior for function calling by defining the
+// execution mode.
+type FunctionCallingConfig_Mode int32
+
+const (
+ // Unspecified function calling mode. This value should not be used.
+ FunctionCallingConfig_MODE_UNSPECIFIED FunctionCallingConfig_Mode = 0
+ // Default model behavior, model decides to predict either a function call
+ // or a natural language repspose.
+ FunctionCallingConfig_AUTO FunctionCallingConfig_Mode = 1
+ // 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".
+ FunctionCallingConfig_ANY FunctionCallingConfig_Mode = 2
+ // Model will not predict any function call. Model behavior is same as when
+ // not passing any function declarations.
+ FunctionCallingConfig_NONE FunctionCallingConfig_Mode = 3
+)
+
+// Enum value maps for FunctionCallingConfig_Mode.
+var (
+ FunctionCallingConfig_Mode_name = map[int32]string{
+ 0: "MODE_UNSPECIFIED",
+ 1: "AUTO",
+ 2: "ANY",
+ 3: "NONE",
+ }
+ FunctionCallingConfig_Mode_value = map[string]int32{
+ "MODE_UNSPECIFIED": 0,
+ "AUTO": 1,
+ "ANY": 2,
+ "NONE": 3,
+ }
+)
+
+func (x FunctionCallingConfig_Mode) Enum() *FunctionCallingConfig_Mode {
+ p := new(FunctionCallingConfig_Mode)
+ *p = x
+ return p
+}
+
+func (x FunctionCallingConfig_Mode) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (FunctionCallingConfig_Mode) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_content_proto_enumTypes[1].Descriptor()
+}
+
+func (FunctionCallingConfig_Mode) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_content_proto_enumTypes[1]
+}
+
+func (x FunctionCallingConfig_Mode) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use FunctionCallingConfig_Mode.Descriptor instead.
+func (FunctionCallingConfig_Mode) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{6, 0}
+}
+
+// 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.
+type Content struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Ordered `Parts` that constitute a single message. Parts may have different
+ // MIME types.
+ Parts []*Part `protobuf:"bytes,1,rep,name=parts,proto3" json:"parts,omitempty"`
+ // 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.
+ Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
+}
+
+func (x *Content) Reset() {
+ *x = Content{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Content) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Content) ProtoMessage() {}
+
+func (x *Content) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_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 Content.ProtoReflect.Descriptor instead.
+func (*Content) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Content) GetParts() []*Part {
+ if x != nil {
+ return x.Parts
+ }
+ return nil
+}
+
+func (x *Content) GetRole() string {
+ if x != nil {
+ return x.Role
+ }
+ return ""
+}
+
+// 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.
+type Part struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Types that are assignable to Data:
+ //
+ // *Part_Text
+ // *Part_InlineData
+ // *Part_FunctionCall
+ // *Part_FunctionResponse
+ // *Part_FileData
+ Data isPart_Data `protobuf_oneof:"data"`
+}
+
+func (x *Part) Reset() {
+ *x = Part{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Part) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Part) ProtoMessage() {}
+
+func (x *Part) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[1]
+ 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 Part.ProtoReflect.Descriptor instead.
+func (*Part) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{1}
+}
+
+func (m *Part) GetData() isPart_Data {
+ if m != nil {
+ return m.Data
+ }
+ return nil
+}
+
+func (x *Part) GetText() string {
+ if x, ok := x.GetData().(*Part_Text); ok {
+ return x.Text
+ }
+ return ""
+}
+
+func (x *Part) GetInlineData() *Blob {
+ if x, ok := x.GetData().(*Part_InlineData); ok {
+ return x.InlineData
+ }
+ return nil
+}
+
+func (x *Part) GetFunctionCall() *FunctionCall {
+ if x, ok := x.GetData().(*Part_FunctionCall); ok {
+ return x.FunctionCall
+ }
+ return nil
+}
+
+func (x *Part) GetFunctionResponse() *FunctionResponse {
+ if x, ok := x.GetData().(*Part_FunctionResponse); ok {
+ return x.FunctionResponse
+ }
+ return nil
+}
+
+func (x *Part) GetFileData() *FileData {
+ if x, ok := x.GetData().(*Part_FileData); ok {
+ return x.FileData
+ }
+ return nil
+}
+
+type isPart_Data interface {
+ isPart_Data()
+}
+
+type Part_Text struct {
+ // Inline text.
+ Text string `protobuf:"bytes,2,opt,name=text,proto3,oneof"`
+}
+
+type Part_InlineData struct {
+ // Inline media bytes.
+ InlineData *Blob `protobuf:"bytes,3,opt,name=inline_data,json=inlineData,proto3,oneof"`
+}
+
+type Part_FunctionCall struct {
+ // A predicted `FunctionCall` returned from the model that contains
+ // a string representing the `FunctionDeclaration.name` with the
+ // arguments and their values.
+ FunctionCall *FunctionCall `protobuf:"bytes,4,opt,name=function_call,json=functionCall,proto3,oneof"`
+}
+
+type Part_FunctionResponse struct {
+ // 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.
+ FunctionResponse *FunctionResponse `protobuf:"bytes,5,opt,name=function_response,json=functionResponse,proto3,oneof"`
+}
+
+type Part_FileData struct {
+ // URI based data.
+ FileData *FileData `protobuf:"bytes,6,opt,name=file_data,json=fileData,proto3,oneof"`
+}
+
+func (*Part_Text) isPart_Data() {}
+
+func (*Part_InlineData) isPart_Data() {}
+
+func (*Part_FunctionCall) isPart_Data() {}
+
+func (*Part_FunctionResponse) isPart_Data() {}
+
+func (*Part_FileData) isPart_Data() {}
+
+// Raw media bytes.
+//
+// Text should not be sent as raw bytes, use the 'text' field.
+type Blob struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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).
+ MimeType string `protobuf:"bytes,1,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
+ // Raw bytes for media formats.
+ Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
+}
+
+func (x *Blob) Reset() {
+ *x = Blob{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Blob) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Blob) ProtoMessage() {}
+
+func (x *Blob) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[2]
+ 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 Blob.ProtoReflect.Descriptor instead.
+func (*Blob) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *Blob) GetMimeType() string {
+ if x != nil {
+ return x.MimeType
+ }
+ return ""
+}
+
+func (x *Blob) GetData() []byte {
+ if x != nil {
+ return x.Data
+ }
+ return nil
+}
+
+// URI based data.
+type FileData struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. The IANA standard MIME type of the source data.
+ MimeType string `protobuf:"bytes,1,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
+ // Required. URI.
+ FileUri string `protobuf:"bytes,2,opt,name=file_uri,json=fileUri,proto3" json:"file_uri,omitempty"`
+}
+
+func (x *FileData) Reset() {
+ *x = FileData{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *FileData) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FileData) ProtoMessage() {}
+
+func (x *FileData) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[3]
+ 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 FileData.ProtoReflect.Descriptor instead.
+func (*FileData) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *FileData) GetMimeType() string {
+ if x != nil {
+ return x.MimeType
+ }
+ return ""
+}
+
+func (x *FileData) GetFileUri() string {
+ if x != nil {
+ return x.FileUri
+ }
+ return ""
+}
+
+// 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 Tool struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ FunctionDeclarations []*FunctionDeclaration `protobuf:"bytes,1,rep,name=function_declarations,json=functionDeclarations,proto3" json:"function_declarations,omitempty"`
+}
+
+func (x *Tool) Reset() {
+ *x = Tool{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Tool) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Tool) ProtoMessage() {}
+
+func (x *Tool) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[4]
+ 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 Tool.ProtoReflect.Descriptor instead.
+func (*Tool) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *Tool) GetFunctionDeclarations() []*FunctionDeclaration {
+ if x != nil {
+ return x.FunctionDeclarations
+ }
+ return nil
+}
+
+// The Tool configuration containing parameters for specifying `Tool` use
+// in the request.
+type ToolConfig struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. Function calling config.
+ FunctionCallingConfig *FunctionCallingConfig `protobuf:"bytes,1,opt,name=function_calling_config,json=functionCallingConfig,proto3" json:"function_calling_config,omitempty"`
+}
+
+func (x *ToolConfig) Reset() {
+ *x = ToolConfig{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ToolConfig) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ToolConfig) ProtoMessage() {}
+
+func (x *ToolConfig) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[5]
+ 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 ToolConfig.ProtoReflect.Descriptor instead.
+func (*ToolConfig) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *ToolConfig) GetFunctionCallingConfig() *FunctionCallingConfig {
+ if x != nil {
+ return x.FunctionCallingConfig
+ }
+ return nil
+}
+
+// Configuration for specifying function calling behavior.
+type FunctionCallingConfig struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. Specifies the mode in which function calling should execute. If
+ // unspecified, the default value will be set to AUTO.
+ Mode FunctionCallingConfig_Mode `protobuf:"varint,1,opt,name=mode,proto3,enum=google.ai.generativelanguage.v1beta.FunctionCallingConfig_Mode" json:"mode,omitempty"`
+ // 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.
+ AllowedFunctionNames []string `protobuf:"bytes,2,rep,name=allowed_function_names,json=allowedFunctionNames,proto3" json:"allowed_function_names,omitempty"`
+}
+
+func (x *FunctionCallingConfig) Reset() {
+ *x = FunctionCallingConfig{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *FunctionCallingConfig) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FunctionCallingConfig) ProtoMessage() {}
+
+func (x *FunctionCallingConfig) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[6]
+ 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 FunctionCallingConfig.ProtoReflect.Descriptor instead.
+func (*FunctionCallingConfig) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *FunctionCallingConfig) GetMode() FunctionCallingConfig_Mode {
+ if x != nil {
+ return x.Mode
+ }
+ return FunctionCallingConfig_MODE_UNSPECIFIED
+}
+
+func (x *FunctionCallingConfig) GetAllowedFunctionNames() []string {
+ if x != nil {
+ return x.AllowedFunctionNames
+ }
+ return nil
+}
+
+// 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 FunctionDeclaration struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Required. A brief description of the function.
+ Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
+ // 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.
+ Parameters *Schema `protobuf:"bytes,3,opt,name=parameters,proto3,oneof" json:"parameters,omitempty"`
+}
+
+func (x *FunctionDeclaration) Reset() {
+ *x = FunctionDeclaration{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *FunctionDeclaration) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FunctionDeclaration) ProtoMessage() {}
+
+func (x *FunctionDeclaration) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[7]
+ 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 FunctionDeclaration.ProtoReflect.Descriptor instead.
+func (*FunctionDeclaration) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *FunctionDeclaration) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *FunctionDeclaration) GetDescription() string {
+ if x != nil {
+ return x.Description
+ }
+ return ""
+}
+
+func (x *FunctionDeclaration) GetParameters() *Schema {
+ if x != nil {
+ return x.Parameters
+ }
+ return nil
+}
+
+// A predicted `FunctionCall` returned from the model that contains
+// a string representing the `FunctionDeclaration.name` with the
+// arguments and their values.
+type FunctionCall struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Optional. The function parameters and values in JSON object format.
+ Args *structpb.Struct `protobuf:"bytes,2,opt,name=args,proto3,oneof" json:"args,omitempty"`
+}
+
+func (x *FunctionCall) Reset() {
+ *x = FunctionCall{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *FunctionCall) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FunctionCall) ProtoMessage() {}
+
+func (x *FunctionCall) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[8]
+ 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 FunctionCall.ProtoReflect.Descriptor instead.
+func (*FunctionCall) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *FunctionCall) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *FunctionCall) GetArgs() *structpb.Struct {
+ if x != nil {
+ return x.Args
+ }
+ return nil
+}
+
+// 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 FunctionResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Required. The function response in JSON object format.
+ Response *structpb.Struct `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
+}
+
+func (x *FunctionResponse) Reset() {
+ *x = FunctionResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *FunctionResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*FunctionResponse) ProtoMessage() {}
+
+func (x *FunctionResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[9]
+ 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 FunctionResponse.ProtoReflect.Descriptor instead.
+func (*FunctionResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *FunctionResponse) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *FunctionResponse) GetResponse() *structpb.Struct {
+ if x != nil {
+ return x.Response
+ }
+ return nil
+}
+
+// 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).
+type Schema struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. Data type.
+ Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=google.ai.generativelanguage.v1beta.Type" json:"type,omitempty"`
+ // 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
+ Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"`
+ // Optional. A brief description of the parameter. This could contain examples
+ // of use. Parameter description may be formatted as Markdown.
+ Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
+ // Optional. Indicates if the value may be null.
+ Nullable bool `protobuf:"varint,4,opt,name=nullable,proto3" json:"nullable,omitempty"`
+ // 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"]}
+ Enum []string `protobuf:"bytes,5,rep,name=enum,proto3" json:"enum,omitempty"`
+ // Optional. Schema of the elements of Type.ARRAY.
+ Items *Schema `protobuf:"bytes,6,opt,name=items,proto3,oneof" json:"items,omitempty"`
+ // Optional. Properties of Type.OBJECT.
+ Properties map[string]*Schema `protobuf:"bytes,7,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // Optional. Required properties of Type.OBJECT.
+ Required []string `protobuf:"bytes,8,rep,name=required,proto3" json:"required,omitempty"`
+}
+
+func (x *Schema) Reset() {
+ *x = Schema{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Schema) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Schema) ProtoMessage() {}
+
+func (x *Schema) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[10]
+ 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 Schema.ProtoReflect.Descriptor instead.
+func (*Schema) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *Schema) GetType() Type {
+ if x != nil {
+ return x.Type
+ }
+ return Type_TYPE_UNSPECIFIED
+}
+
+func (x *Schema) GetFormat() string {
+ if x != nil {
+ return x.Format
+ }
+ return ""
+}
+
+func (x *Schema) GetDescription() string {
+ if x != nil {
+ return x.Description
+ }
+ return ""
+}
+
+func (x *Schema) GetNullable() bool {
+ if x != nil {
+ return x.Nullable
+ }
+ return false
+}
+
+func (x *Schema) GetEnum() []string {
+ if x != nil {
+ return x.Enum
+ }
+ return nil
+}
+
+func (x *Schema) GetItems() *Schema {
+ if x != nil {
+ return x.Items
+ }
+ return nil
+}
+
+func (x *Schema) GetProperties() map[string]*Schema {
+ if x != nil {
+ return x.Properties
+ }
+ return nil
+}
+
+func (x *Schema) GetRequired() []string {
+ if x != nil {
+ return x.Required
+ }
+ return nil
+}
+
+// Passage included inline with a grounding configuration.
+type GroundingPassage struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Identifier for the passage for attributing this passage in grounded
+ // answers.
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
+ // Content of the passage.
+ Content *Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
+}
+
+func (x *GroundingPassage) Reset() {
+ *x = GroundingPassage{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GroundingPassage) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GroundingPassage) ProtoMessage() {}
+
+func (x *GroundingPassage) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[11]
+ 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 GroundingPassage.ProtoReflect.Descriptor instead.
+func (*GroundingPassage) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{11}
+}
+
+func (x *GroundingPassage) GetId() string {
+ if x != nil {
+ return x.Id
+ }
+ return ""
+}
+
+func (x *GroundingPassage) GetContent() *Content {
+ if x != nil {
+ return x.Content
+ }
+ return nil
+}
+
+// A repeated list of passages.
+type GroundingPassages struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // List of passages.
+ Passages []*GroundingPassage `protobuf:"bytes,1,rep,name=passages,proto3" json:"passages,omitempty"`
+}
+
+func (x *GroundingPassages) Reset() {
+ *x = GroundingPassages{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GroundingPassages) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GroundingPassages) ProtoMessage() {}
+
+func (x *GroundingPassages) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[12]
+ 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 GroundingPassages.ProtoReflect.Descriptor instead.
+func (*GroundingPassages) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP(), []int{12}
+}
+
+func (x *GroundingPassages) GetPassages() []*GroundingPassage {
+ if x != nil {
+ return x.Passages
+ }
+ return nil
+}
+
+var File_google_ai_generativelanguage_v1beta_content_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_content_proto_rawDesc = []byte{
+ 0x0a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76,
+ 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x52, 0x05, 0x70, 0x61,
+ 0x72, 0x74, 0x73, 0x12, 0x17, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x80, 0x03, 0x0a,
+ 0x04, 0x50, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x4c, 0x0a, 0x0b, 0x69,
+ 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x00, 0x52, 0x0a, 0x69,
+ 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x58, 0x0a, 0x0d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43,
+ 0x61, 0x6c, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43,
+ 0x61, 0x6c, 0x6c, 0x12, 0x64, 0x0a, 0x11, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
+ 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x10, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x66, 0x69, 0x6c,
+ 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x66,
+ 0x69, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
+ 0x37, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65,
+ 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x4c, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65,
+ 0x44, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70,
+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6d, 0x69,
+ 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x75,
+ 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x66,
+ 0x69, 0x6c, 0x65, 0x55, 0x72, 0x69, 0x22, 0x7a, 0x0a, 0x04, 0x54, 0x6f, 0x6f, 0x6c, 0x12, 0x72,
+ 0x0a, 0x15, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61,
+ 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x63, 0x6c,
+ 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x14, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x0a, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x12, 0x77, 0x0a, 0x17, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x61,
+ 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x03,
+ 0xe0, 0x41, 0x01, 0x52, 0x15, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c,
+ 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xe7, 0x01, 0x0a, 0x15, 0x46,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x12, 0x58, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4d,
+ 0x6f, 0x64, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x39,
+ 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03,
+ 0xe0, 0x41, 0x01, 0x52, 0x14, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x46, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x04, 0x4d, 0x6f, 0x64,
+ 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x55, 0x54, 0x4f, 0x10,
+ 0x01, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f,
+ 0x4e, 0x45, 0x10, 0x03, 0x22, 0xbb, 0x01, 0x0a, 0x13, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x55, 0x0a, 0x0a,
+ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x03, 0xe0,
+ 0x41, 0x01, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
+ 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
+ 0x72, 0x73, 0x22, 0x67, 0x0a, 0x0c, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61,
+ 0x6c, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x61,
+ 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75,
+ 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x88,
+ 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x22, 0x65, 0x0a, 0x10, 0x46,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
+ 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72,
+ 0x75, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x90, 0x04, 0x0a, 0x06, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x42, 0x0a,
+ 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x74, 0x79, 0x70,
+ 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x25,
+ 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c,
+ 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x05,
+ 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12,
+ 0x4b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x48, 0x00, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x88, 0x01, 0x01, 0x12, 0x60, 0x0a, 0x0a,
+ 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b,
+ 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x50, 0x72,
+ 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0,
+ 0x41, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1f,
+ 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x1a,
+ 0x6a, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 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, 0x41, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
+ 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f,
+ 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x6a, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69,
+ 0x6e, 0x67, 0x50, 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x22, 0x66, 0x0a, 0x11, 0x47, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61,
+ 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47,
+ 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
+ 0x08, 0x70, 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2a, 0x65, 0x0a, 0x04, 0x54, 0x79, 0x70,
+ 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e,
+ 0x47, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x12,
+ 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07,
+ 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x52, 0x52,
+ 0x41, 0x59, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x06,
+ 0x42, 0x98, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x0c, 0x43, 0x6f,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c,
+ 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67,
+ 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_content_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_content_proto_rawDescData = file_google_ai_generativelanguage_v1beta_content_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_content_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_content_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_content_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_content_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_content_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_content_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_google_ai_generativelanguage_v1beta_content_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
+var file_google_ai_generativelanguage_v1beta_content_proto_goTypes = []interface{}{
+ (Type)(0), // 0: google.ai.generativelanguage.v1beta.Type
+ (FunctionCallingConfig_Mode)(0), // 1: google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode
+ (*Content)(nil), // 2: google.ai.generativelanguage.v1beta.Content
+ (*Part)(nil), // 3: google.ai.generativelanguage.v1beta.Part
+ (*Blob)(nil), // 4: google.ai.generativelanguage.v1beta.Blob
+ (*FileData)(nil), // 5: google.ai.generativelanguage.v1beta.FileData
+ (*Tool)(nil), // 6: google.ai.generativelanguage.v1beta.Tool
+ (*ToolConfig)(nil), // 7: google.ai.generativelanguage.v1beta.ToolConfig
+ (*FunctionCallingConfig)(nil), // 8: google.ai.generativelanguage.v1beta.FunctionCallingConfig
+ (*FunctionDeclaration)(nil), // 9: google.ai.generativelanguage.v1beta.FunctionDeclaration
+ (*FunctionCall)(nil), // 10: google.ai.generativelanguage.v1beta.FunctionCall
+ (*FunctionResponse)(nil), // 11: google.ai.generativelanguage.v1beta.FunctionResponse
+ (*Schema)(nil), // 12: google.ai.generativelanguage.v1beta.Schema
+ (*GroundingPassage)(nil), // 13: google.ai.generativelanguage.v1beta.GroundingPassage
+ (*GroundingPassages)(nil), // 14: google.ai.generativelanguage.v1beta.GroundingPassages
+ nil, // 15: google.ai.generativelanguage.v1beta.Schema.PropertiesEntry
+ (*structpb.Struct)(nil), // 16: google.protobuf.Struct
+}
+var file_google_ai_generativelanguage_v1beta_content_proto_depIdxs = []int32{
+ 3, // 0: google.ai.generativelanguage.v1beta.Content.parts:type_name -> google.ai.generativelanguage.v1beta.Part
+ 4, // 1: google.ai.generativelanguage.v1beta.Part.inline_data:type_name -> google.ai.generativelanguage.v1beta.Blob
+ 10, // 2: google.ai.generativelanguage.v1beta.Part.function_call:type_name -> google.ai.generativelanguage.v1beta.FunctionCall
+ 11, // 3: google.ai.generativelanguage.v1beta.Part.function_response:type_name -> google.ai.generativelanguage.v1beta.FunctionResponse
+ 5, // 4: google.ai.generativelanguage.v1beta.Part.file_data:type_name -> google.ai.generativelanguage.v1beta.FileData
+ 9, // 5: google.ai.generativelanguage.v1beta.Tool.function_declarations:type_name -> google.ai.generativelanguage.v1beta.FunctionDeclaration
+ 8, // 6: google.ai.generativelanguage.v1beta.ToolConfig.function_calling_config:type_name -> google.ai.generativelanguage.v1beta.FunctionCallingConfig
+ 1, // 7: google.ai.generativelanguage.v1beta.FunctionCallingConfig.mode:type_name -> google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode
+ 12, // 8: google.ai.generativelanguage.v1beta.FunctionDeclaration.parameters:type_name -> google.ai.generativelanguage.v1beta.Schema
+ 16, // 9: google.ai.generativelanguage.v1beta.FunctionCall.args:type_name -> google.protobuf.Struct
+ 16, // 10: google.ai.generativelanguage.v1beta.FunctionResponse.response:type_name -> google.protobuf.Struct
+ 0, // 11: google.ai.generativelanguage.v1beta.Schema.type:type_name -> google.ai.generativelanguage.v1beta.Type
+ 12, // 12: google.ai.generativelanguage.v1beta.Schema.items:type_name -> google.ai.generativelanguage.v1beta.Schema
+ 15, // 13: google.ai.generativelanguage.v1beta.Schema.properties:type_name -> google.ai.generativelanguage.v1beta.Schema.PropertiesEntry
+ 2, // 14: google.ai.generativelanguage.v1beta.GroundingPassage.content:type_name -> google.ai.generativelanguage.v1beta.Content
+ 13, // 15: google.ai.generativelanguage.v1beta.GroundingPassages.passages:type_name -> google.ai.generativelanguage.v1beta.GroundingPassage
+ 12, // 16: google.ai.generativelanguage.v1beta.Schema.PropertiesEntry.value:type_name -> google.ai.generativelanguage.v1beta.Schema
+ 17, // [17:17] is the sub-list for method output_type
+ 17, // [17:17] is the sub-list for method input_type
+ 17, // [17:17] is the sub-list for extension type_name
+ 17, // [17:17] is the sub-list for extension extendee
+ 0, // [0:17] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_content_proto_init() }
+func file_google_ai_generativelanguage_v1beta_content_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_content_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Content); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Part); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Blob); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*FileData); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Tool); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ToolConfig); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*FunctionCallingConfig); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*FunctionDeclaration); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*FunctionCall); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*FunctionResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Schema); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GroundingPassage); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GroundingPassages); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[1].OneofWrappers = []interface{}{
+ (*Part_Text)(nil),
+ (*Part_InlineData)(nil),
+ (*Part_FunctionCall)(nil),
+ (*Part_FunctionResponse)(nil),
+ (*Part_FileData)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[7].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[8].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_content_proto_msgTypes[10].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_content_proto_rawDesc,
+ NumEnums: 2,
+ NumMessages: 14,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_content_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_content_proto_depIdxs,
+ EnumInfos: file_google_ai_generativelanguage_v1beta_content_proto_enumTypes,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_content_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_content_proto = out.File
+ file_google_ai_generativelanguage_v1beta_content_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_content_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_content_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/discuss_service.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/discuss_service.pb.go
new file mode 100644
index 000000000..d55602bd8
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/discuss_service.pb.go
@@ -0,0 +1,1038 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/discuss_service.proto
+
+package generativelanguagepb
+
+import (
+ context "context"
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Request to generate a message response from the model.
+type GenerateMessageRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the model to use.
+ //
+ // Format: `name=models/{model}`.
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // 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.
+ Prompt *MessagePrompt `protobuf:"bytes,2,opt,name=prompt,proto3" json:"prompt,omitempty"`
+ // 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.
+ Temperature *float32 `protobuf:"fixed32,3,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"`
+ // Optional. The number of generated response messages to return.
+ //
+ // This value must be between
+ // `[1, 8]`, inclusive. If unset, this will default to `1`.
+ CandidateCount *int32 `protobuf:"varint,4,opt,name=candidate_count,json=candidateCount,proto3,oneof" json:"candidate_count,omitempty"`
+ // 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`.
+ TopP *float32 `protobuf:"fixed32,5,opt,name=top_p,json=topP,proto3,oneof" json:"top_p,omitempty"`
+ // 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.
+ TopK *int32 `protobuf:"varint,6,opt,name=top_k,json=topK,proto3,oneof" json:"top_k,omitempty"`
+}
+
+func (x *GenerateMessageRequest) Reset() {
+ *x = GenerateMessageRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateMessageRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateMessageRequest) ProtoMessage() {}
+
+func (x *GenerateMessageRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_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 GenerateMessageRequest.ProtoReflect.Descriptor instead.
+func (*GenerateMessageRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GenerateMessageRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *GenerateMessageRequest) GetPrompt() *MessagePrompt {
+ if x != nil {
+ return x.Prompt
+ }
+ return nil
+}
+
+func (x *GenerateMessageRequest) GetTemperature() float32 {
+ if x != nil && x.Temperature != nil {
+ return *x.Temperature
+ }
+ return 0
+}
+
+func (x *GenerateMessageRequest) GetCandidateCount() int32 {
+ if x != nil && x.CandidateCount != nil {
+ return *x.CandidateCount
+ }
+ return 0
+}
+
+func (x *GenerateMessageRequest) GetTopP() float32 {
+ if x != nil && x.TopP != nil {
+ return *x.TopP
+ }
+ return 0
+}
+
+func (x *GenerateMessageRequest) GetTopK() int32 {
+ if x != nil && x.TopK != nil {
+ return *x.TopK
+ }
+ return 0
+}
+
+// The response from the model.
+//
+// This includes candidate messages and
+// conversation history in the form of chronologically-ordered messages.
+type GenerateMessageResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Candidate response messages from the model.
+ Candidates []*Message `protobuf:"bytes,1,rep,name=candidates,proto3" json:"candidates,omitempty"`
+ // The conversation history used by the model.
+ Messages []*Message `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
+ // 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.
+ Filters []*ContentFilter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
+}
+
+func (x *GenerateMessageResponse) Reset() {
+ *x = GenerateMessageResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateMessageResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateMessageResponse) ProtoMessage() {}
+
+func (x *GenerateMessageResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[1]
+ 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 GenerateMessageResponse.ProtoReflect.Descriptor instead.
+func (*GenerateMessageResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GenerateMessageResponse) GetCandidates() []*Message {
+ if x != nil {
+ return x.Candidates
+ }
+ return nil
+}
+
+func (x *GenerateMessageResponse) GetMessages() []*Message {
+ if x != nil {
+ return x.Messages
+ }
+ return nil
+}
+
+func (x *GenerateMessageResponse) GetFilters() []*ContentFilter {
+ if x != nil {
+ return x.Filters
+ }
+ return nil
+}
+
+// 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 Message struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ Author string `protobuf:"bytes,1,opt,name=author,proto3" json:"author,omitempty"`
+ // Required. The text content of the structured `Message`.
+ Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
+ // 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.
+ CitationMetadata *CitationMetadata `protobuf:"bytes,3,opt,name=citation_metadata,json=citationMetadata,proto3,oneof" json:"citation_metadata,omitempty"`
+}
+
+func (x *Message) Reset() {
+ *x = Message{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Message) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Message) ProtoMessage() {}
+
+func (x *Message) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[2]
+ 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 Message.ProtoReflect.Descriptor instead.
+func (*Message) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *Message) GetAuthor() string {
+ if x != nil {
+ return x.Author
+ }
+ return ""
+}
+
+func (x *Message) GetContent() string {
+ if x != nil {
+ return x.Content
+ }
+ return ""
+}
+
+func (x *Message) GetCitationMetadata() *CitationMetadata {
+ if x != nil {
+ return x.CitationMetadata
+ }
+ return nil
+}
+
+// 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.
+type MessagePrompt struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ Context string `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"`
+ // 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`.
+ Examples []*Example `protobuf:"bytes,2,rep,name=examples,proto3" json:"examples,omitempty"`
+ // Required. A snapshot of the recent conversation history sorted
+ // chronologically.
+ //
+ // Turns alternate between two authors.
+ //
+ // If the total input size exceeds the model's `input_token_limit` the input
+ // will be truncated: The oldest items will be dropped from `messages`.
+ Messages []*Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"`
+}
+
+func (x *MessagePrompt) Reset() {
+ *x = MessagePrompt{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *MessagePrompt) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MessagePrompt) ProtoMessage() {}
+
+func (x *MessagePrompt) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[3]
+ 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 MessagePrompt.ProtoReflect.Descriptor instead.
+func (*MessagePrompt) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *MessagePrompt) GetContext() string {
+ if x != nil {
+ return x.Context
+ }
+ return ""
+}
+
+func (x *MessagePrompt) GetExamples() []*Example {
+ if x != nil {
+ return x.Examples
+ }
+ return nil
+}
+
+func (x *MessagePrompt) GetMessages() []*Message {
+ if x != nil {
+ return x.Messages
+ }
+ return nil
+}
+
+// An input/output example used to instruct the Model.
+//
+// It demonstrates how the model should respond or format its response.
+type Example struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. An example of an input `Message` from the user.
+ Input *Message `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
+ // Required. An example of what the model should output given the input.
+ Output *Message `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"`
+}
+
+func (x *Example) Reset() {
+ *x = Example{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Example) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Example) ProtoMessage() {}
+
+func (x *Example) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[4]
+ 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 Example.ProtoReflect.Descriptor instead.
+func (*Example) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *Example) GetInput() *Message {
+ if x != nil {
+ return x.Input
+ }
+ return nil
+}
+
+func (x *Example) GetOutput() *Message {
+ if x != nil {
+ return x.Output
+ }
+ return nil
+}
+
+// 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 CountMessageTokensRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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}`
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // Required. The prompt, whose token count is to be returned.
+ Prompt *MessagePrompt `protobuf:"bytes,2,opt,name=prompt,proto3" json:"prompt,omitempty"`
+}
+
+func (x *CountMessageTokensRequest) Reset() {
+ *x = CountMessageTokensRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CountMessageTokensRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CountMessageTokensRequest) ProtoMessage() {}
+
+func (x *CountMessageTokensRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[5]
+ 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 CountMessageTokensRequest.ProtoReflect.Descriptor instead.
+func (*CountMessageTokensRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *CountMessageTokensRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *CountMessageTokensRequest) GetPrompt() *MessagePrompt {
+ if x != nil {
+ return x.Prompt
+ }
+ return nil
+}
+
+// A response from `CountMessageTokens`.
+//
+// It returns the model's `token_count` for the `prompt`.
+type CountMessageTokensResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The number of tokens that the `model` tokenizes the `prompt` into.
+ //
+ // Always non-negative.
+ TokenCount int32 `protobuf:"varint,1,opt,name=token_count,json=tokenCount,proto3" json:"token_count,omitempty"`
+}
+
+func (x *CountMessageTokensResponse) Reset() {
+ *x = CountMessageTokensResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CountMessageTokensResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CountMessageTokensResponse) ProtoMessage() {}
+
+func (x *CountMessageTokensResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[6]
+ 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 CountMessageTokensResponse.ProtoReflect.Descriptor instead.
+func (*CountMessageTokensResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *CountMessageTokensResponse) GetTokenCount() int32 {
+ if x != nil {
+ return x.TokenCount
+ }
+ return 0
+}
+
+var File_google_ai_generativelanguage_v1beta_discuss_service_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDesc = []byte{
+ 0x0a, 0x39, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x5f, 0x73, 0x65,
+ 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x1a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
+ 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
+ 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
+ 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x03, 0x0a, 0x16, 0x47, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x4f, 0x0a, 0x06, 0x70,
+ 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x2a, 0x0a, 0x0b,
+ 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72,
+ 0x61, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0f, 0x63, 0x61, 0x6e, 0x64,
+ 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x0e, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64,
+ 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05, 0x74,
+ 0x6f, 0x70, 0x5f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48,
+ 0x02, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x50, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x6f,
+ 0x70, 0x5f, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x03,
+ 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4b, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x65,
+ 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x61,
+ 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x08, 0x0a,
+ 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f,
+ 0x6b, 0x22, 0xff, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x65,
+ 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a,
+ 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
+ 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x08, 0x6d,
+ 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73,
+ 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74,
+ 0x65, 0x72, 0x73, 0x22, 0xc9, 0x01, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
+ 0x1b, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x07,
+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x6c, 0x0a, 0x11, 0x63,
+ 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x69, 0x74,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0,
+ 0x41, 0x03, 0x48, 0x00, 0x52, 0x10, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65,
+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x63, 0x69,
+ 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22,
+ 0xcc, 0x01, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6d, 0x70,
+ 0x74, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
+ 0x12, 0x4d, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
+ 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12,
+ 0x4d, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x9d,
+ 0x01, 0x0a, 0x07, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x05, 0x69, 0x6e,
+ 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x69, 0x6e,
+ 0x70, 0x75, 0x74, 0x12, 0x49, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0xb3,
+ 0x01, 0x0a, 0x19, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x05,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02,
+ 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x12, 0x4f, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x72,
+ 0x6f, 0x6d, 0x70, 0x74, 0x22, 0x3d, 0x0a, 0x1a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
+ 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x6f,
+ 0x75, 0x6e, 0x74, 0x32, 0x90, 0x04, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xf8, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6a, 0xda, 0x41, 0x34, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2c,
+ 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x2c, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x2c, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75,
+ 0x6e, 0x74, 0x2c, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x2c, 0x74, 0x6f, 0x70, 0x5f, 0x6b, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x12, 0xdc, 0x01, 0x0a, 0x12, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
+ 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43,
+ 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43,
+ 0x6f, 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x45, 0xda, 0x41, 0x0c, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2c, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30,
+ 0x3a, 0x01, 0x2a, 0x22, 0x2b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x63, 0x6f,
+ 0x75, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73,
+ 0x1a, 0x24, 0xca, 0x41, 0x21, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0x9f, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x42, 0x13, 0x44, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69,
+ 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61,
+ 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescData = file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
+var file_google_ai_generativelanguage_v1beta_discuss_service_proto_goTypes = []interface{}{
+ (*GenerateMessageRequest)(nil), // 0: google.ai.generativelanguage.v1beta.GenerateMessageRequest
+ (*GenerateMessageResponse)(nil), // 1: google.ai.generativelanguage.v1beta.GenerateMessageResponse
+ (*Message)(nil), // 2: google.ai.generativelanguage.v1beta.Message
+ (*MessagePrompt)(nil), // 3: google.ai.generativelanguage.v1beta.MessagePrompt
+ (*Example)(nil), // 4: google.ai.generativelanguage.v1beta.Example
+ (*CountMessageTokensRequest)(nil), // 5: google.ai.generativelanguage.v1beta.CountMessageTokensRequest
+ (*CountMessageTokensResponse)(nil), // 6: google.ai.generativelanguage.v1beta.CountMessageTokensResponse
+ (*ContentFilter)(nil), // 7: google.ai.generativelanguage.v1beta.ContentFilter
+ (*CitationMetadata)(nil), // 8: google.ai.generativelanguage.v1beta.CitationMetadata
+}
+var file_google_ai_generativelanguage_v1beta_discuss_service_proto_depIdxs = []int32{
+ 3, // 0: google.ai.generativelanguage.v1beta.GenerateMessageRequest.prompt:type_name -> google.ai.generativelanguage.v1beta.MessagePrompt
+ 2, // 1: google.ai.generativelanguage.v1beta.GenerateMessageResponse.candidates:type_name -> google.ai.generativelanguage.v1beta.Message
+ 2, // 2: google.ai.generativelanguage.v1beta.GenerateMessageResponse.messages:type_name -> google.ai.generativelanguage.v1beta.Message
+ 7, // 3: google.ai.generativelanguage.v1beta.GenerateMessageResponse.filters:type_name -> google.ai.generativelanguage.v1beta.ContentFilter
+ 8, // 4: google.ai.generativelanguage.v1beta.Message.citation_metadata:type_name -> google.ai.generativelanguage.v1beta.CitationMetadata
+ 4, // 5: google.ai.generativelanguage.v1beta.MessagePrompt.examples:type_name -> google.ai.generativelanguage.v1beta.Example
+ 2, // 6: google.ai.generativelanguage.v1beta.MessagePrompt.messages:type_name -> google.ai.generativelanguage.v1beta.Message
+ 2, // 7: google.ai.generativelanguage.v1beta.Example.input:type_name -> google.ai.generativelanguage.v1beta.Message
+ 2, // 8: google.ai.generativelanguage.v1beta.Example.output:type_name -> google.ai.generativelanguage.v1beta.Message
+ 3, // 9: google.ai.generativelanguage.v1beta.CountMessageTokensRequest.prompt:type_name -> google.ai.generativelanguage.v1beta.MessagePrompt
+ 0, // 10: google.ai.generativelanguage.v1beta.DiscussService.GenerateMessage:input_type -> google.ai.generativelanguage.v1beta.GenerateMessageRequest
+ 5, // 11: google.ai.generativelanguage.v1beta.DiscussService.CountMessageTokens:input_type -> google.ai.generativelanguage.v1beta.CountMessageTokensRequest
+ 1, // 12: google.ai.generativelanguage.v1beta.DiscussService.GenerateMessage:output_type -> google.ai.generativelanguage.v1beta.GenerateMessageResponse
+ 6, // 13: google.ai.generativelanguage.v1beta.DiscussService.CountMessageTokens:output_type -> google.ai.generativelanguage.v1beta.CountMessageTokensResponse
+ 12, // [12:14] is the sub-list for method output_type
+ 10, // [10:12] is the sub-list for method input_type
+ 10, // [10:10] is the sub-list for extension type_name
+ 10, // [10:10] is the sub-list for extension extendee
+ 0, // [0:10] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_discuss_service_proto_init() }
+func file_google_ai_generativelanguage_v1beta_discuss_service_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_discuss_service_proto != nil {
+ return
+ }
+ file_google_ai_generativelanguage_v1beta_citation_proto_init()
+ file_google_ai_generativelanguage_v1beta_safety_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateMessageRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateMessageResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Message); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*MessagePrompt); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Example); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CountMessageTokensRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CountMessageTokensResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[0].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes[2].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 7,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_discuss_service_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_discuss_service_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_discuss_service_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_discuss_service_proto = out.File
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_discuss_service_proto_depIdxs = nil
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConnInterface
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion6
+
+// DiscussServiceClient is the client API for DiscussService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type DiscussServiceClient interface {
+ // Generates a response from the model given an input `MessagePrompt`.
+ GenerateMessage(ctx context.Context, in *GenerateMessageRequest, opts ...grpc.CallOption) (*GenerateMessageResponse, error)
+ // Runs a model's tokenizer on a string and returns the token count.
+ CountMessageTokens(ctx context.Context, in *CountMessageTokensRequest, opts ...grpc.CallOption) (*CountMessageTokensResponse, error)
+}
+
+type discussServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewDiscussServiceClient(cc grpc.ClientConnInterface) DiscussServiceClient {
+ return &discussServiceClient{cc}
+}
+
+func (c *discussServiceClient) GenerateMessage(ctx context.Context, in *GenerateMessageRequest, opts ...grpc.CallOption) (*GenerateMessageResponse, error) {
+ out := new(GenerateMessageResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.DiscussService/GenerateMessage", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *discussServiceClient) CountMessageTokens(ctx context.Context, in *CountMessageTokensRequest, opts ...grpc.CallOption) (*CountMessageTokensResponse, error) {
+ out := new(CountMessageTokensResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.DiscussService/CountMessageTokens", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// DiscussServiceServer is the server API for DiscussService service.
+type DiscussServiceServer interface {
+ // Generates a response from the model given an input `MessagePrompt`.
+ GenerateMessage(context.Context, *GenerateMessageRequest) (*GenerateMessageResponse, error)
+ // Runs a model's tokenizer on a string and returns the token count.
+ CountMessageTokens(context.Context, *CountMessageTokensRequest) (*CountMessageTokensResponse, error)
+}
+
+// UnimplementedDiscussServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedDiscussServiceServer struct {
+}
+
+func (*UnimplementedDiscussServiceServer) GenerateMessage(context.Context, *GenerateMessageRequest) (*GenerateMessageResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GenerateMessage not implemented")
+}
+func (*UnimplementedDiscussServiceServer) CountMessageTokens(context.Context, *CountMessageTokensRequest) (*CountMessageTokensResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CountMessageTokens not implemented")
+}
+
+func RegisterDiscussServiceServer(s *grpc.Server, srv DiscussServiceServer) {
+ s.RegisterService(&_DiscussService_serviceDesc, srv)
+}
+
+func _DiscussService_GenerateMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GenerateMessageRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(DiscussServiceServer).GenerateMessage(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.DiscussService/GenerateMessage",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(DiscussServiceServer).GenerateMessage(ctx, req.(*GenerateMessageRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _DiscussService_CountMessageTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CountMessageTokensRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(DiscussServiceServer).CountMessageTokens(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.DiscussService/CountMessageTokens",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(DiscussServiceServer).CountMessageTokens(ctx, req.(*CountMessageTokensRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _DiscussService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "google.ai.generativelanguage.v1beta.DiscussService",
+ HandlerType: (*DiscussServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "GenerateMessage",
+ Handler: _DiscussService_GenerateMessage_Handler,
+ },
+ {
+ MethodName: "CountMessageTokens",
+ Handler: _DiscussService_CountMessageTokens_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "google/ai/generativelanguage/v1beta/discuss_service.proto",
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file.pb.go
new file mode 100644
index 000000000..11cdfb128
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file.pb.go
@@ -0,0 +1,369 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/file.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// States for the lifecycle of a File.
+type File_State int32
+
+const (
+ // The default value. This value is used if the state is omitted.
+ File_STATE_UNSPECIFIED File_State = 0
+ // File is being processed and cannot be used for inference yet.
+ File_PROCESSING File_State = 1
+ // File is processed and available for inference.
+ File_ACTIVE File_State = 2
+ // File failed processing.
+ File_FAILED File_State = 10
+)
+
+// Enum value maps for File_State.
+var (
+ File_State_name = map[int32]string{
+ 0: "STATE_UNSPECIFIED",
+ 1: "PROCESSING",
+ 2: "ACTIVE",
+ 10: "FAILED",
+ }
+ File_State_value = map[string]int32{
+ "STATE_UNSPECIFIED": 0,
+ "PROCESSING": 1,
+ "ACTIVE": 2,
+ "FAILED": 10,
+ }
+)
+
+func (x File_State) Enum() *File_State {
+ p := new(File_State)
+ *p = x
+ return p
+}
+
+func (x File_State) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (File_State) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_file_proto_enumTypes[0].Descriptor()
+}
+
+func (File_State) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_file_proto_enumTypes[0]
+}
+
+func (x File_State) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use File_State.Descriptor instead.
+func (File_State) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_proto_rawDescGZIP(), []int{0, 0}
+}
+
+// A file uploaded to the API.
+type File struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // 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"
+ DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
+ // Output only. MIME type of the file.
+ MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
+ // Output only. Size of the file in bytes.
+ SizeBytes int64 `protobuf:"varint,4,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
+ // Output only. The timestamp of when the `File` was created.
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ // Output only. The timestamp of when the `File` was last updated.
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ // Output only. The timestamp of when the `File` will be deleted. Only set if
+ // the `File` is scheduled to expire.
+ ExpirationTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=expiration_time,json=expirationTime,proto3" json:"expiration_time,omitempty"`
+ // Output only. SHA-256 hash of the uploaded bytes.
+ Sha256Hash []byte `protobuf:"bytes,8,opt,name=sha256_hash,json=sha256Hash,proto3" json:"sha256_hash,omitempty"`
+ // Output only. The uri of the `File`.
+ Uri string `protobuf:"bytes,9,opt,name=uri,proto3" json:"uri,omitempty"`
+ // Output only. Processing state of the File.
+ State File_State `protobuf:"varint,10,opt,name=state,proto3,enum=google.ai.generativelanguage.v1beta.File_State" json:"state,omitempty"`
+}
+
+func (x *File) Reset() {
+ *x = File{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_file_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *File) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*File) ProtoMessage() {}
+
+func (x *File) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_file_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 File.ProtoReflect.Descriptor instead.
+func (*File) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *File) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *File) GetDisplayName() string {
+ if x != nil {
+ return x.DisplayName
+ }
+ return ""
+}
+
+func (x *File) GetMimeType() string {
+ if x != nil {
+ return x.MimeType
+ }
+ return ""
+}
+
+func (x *File) GetSizeBytes() int64 {
+ if x != nil {
+ return x.SizeBytes
+ }
+ return 0
+}
+
+func (x *File) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *File) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+func (x *File) GetExpirationTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.ExpirationTime
+ }
+ return nil
+}
+
+func (x *File) GetSha256Hash() []byte {
+ if x != nil {
+ return x.Sha256Hash
+ }
+ return nil
+}
+
+func (x *File) GetUri() string {
+ if x != nil {
+ return x.Uri
+ }
+ return ""
+}
+
+func (x *File) GetState() File_State {
+ if x != nil {
+ return x.State
+ }
+ return File_STATE_UNSPECIFIED
+}
+
+var File_google_ai_generativelanguage_v1beta_file_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_file_proto_rawDesc = []byte{
+ 0x0a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
+ 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
+ 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x22, 0xf7, 0x04, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x08, 0xe0, 0x41,
+ 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c,
+ 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x01, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12,
+ 0x20, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70,
+ 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18,
+ 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65,
+ 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f,
+ 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
+ 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
+ 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x0f, 0x65, 0x78, 0x70,
+ 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03,
+ 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54,
+ 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x68, 0x61,
+ 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x73,
+ 0x68, 0x61, 0x32, 0x35, 0x36, 0x48, 0x61, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x72, 0x69,
+ 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x03, 0x75, 0x72, 0x69,
+ 0x12, 0x4a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x46, 0x0a, 0x05,
+ 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a,
+ 0x50, 0x52, 0x4f, 0x43, 0x45, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06,
+ 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c,
+ 0x45, 0x44, 0x10, 0x0a, 0x3a, 0x46, 0xea, 0x41, 0x43, 0x0a, 0x26, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x46, 0x69, 0x6c,
+ 0x65, 0x12, 0x0c, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x66, 0x69, 0x6c, 0x65, 0x7d, 0x2a,
+ 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x32, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x95, 0x01, 0x0a,
+ 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x09, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x72,
+ 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_file_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_file_proto_rawDescData = file_google_ai_generativelanguage_v1beta_file_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_file_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_file_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_file_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_file_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_file_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_file_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_google_ai_generativelanguage_v1beta_file_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_google_ai_generativelanguage_v1beta_file_proto_goTypes = []interface{}{
+ (File_State)(0), // 0: google.ai.generativelanguage.v1beta.File.State
+ (*File)(nil), // 1: google.ai.generativelanguage.v1beta.File
+ (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
+}
+var file_google_ai_generativelanguage_v1beta_file_proto_depIdxs = []int32{
+ 2, // 0: google.ai.generativelanguage.v1beta.File.create_time:type_name -> google.protobuf.Timestamp
+ 2, // 1: google.ai.generativelanguage.v1beta.File.update_time:type_name -> google.protobuf.Timestamp
+ 2, // 2: google.ai.generativelanguage.v1beta.File.expiration_time:type_name -> google.protobuf.Timestamp
+ 0, // 3: google.ai.generativelanguage.v1beta.File.state:type_name -> google.ai.generativelanguage.v1beta.File.State
+ 4, // [4:4] is the sub-list for method output_type
+ 4, // [4:4] is the sub-list for method input_type
+ 4, // [4:4] is the sub-list for extension type_name
+ 4, // [4:4] is the sub-list for extension extendee
+ 0, // [0:4] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_file_proto_init() }
+func file_google_ai_generativelanguage_v1beta_file_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_file_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_file_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*File); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_file_proto_rawDesc,
+ NumEnums: 1,
+ NumMessages: 1,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_file_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_file_proto_depIdxs,
+ EnumInfos: file_google_ai_generativelanguage_v1beta_file_proto_enumTypes,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_file_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_file_proto = out.File
+ file_google_ai_generativelanguage_v1beta_file_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_file_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_file_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file_service.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file_service.pb.go
new file mode 100644
index 000000000..857295d7b
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/file_service.pb.go
@@ -0,0 +1,805 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/file_service.proto
+
+package generativelanguagepb
+
+import (
+ context "context"
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Request for `CreateFile`.
+type CreateFileRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. Metadata for the file to create.
+ File *File `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"`
+}
+
+func (x *CreateFileRequest) Reset() {
+ *x = CreateFileRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateFileRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateFileRequest) ProtoMessage() {}
+
+func (x *CreateFileRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_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 CreateFileRequest.ProtoReflect.Descriptor instead.
+func (*CreateFileRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CreateFileRequest) GetFile() *File {
+ if x != nil {
+ return x.File
+ }
+ return nil
+}
+
+// Response for `CreateFile`.
+type CreateFileResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Metadata for the created file.
+ File *File `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"`
+}
+
+func (x *CreateFileResponse) Reset() {
+ *x = CreateFileResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateFileResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateFileResponse) ProtoMessage() {}
+
+func (x *CreateFileResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[1]
+ 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 CreateFileResponse.ProtoReflect.Descriptor instead.
+func (*CreateFileResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *CreateFileResponse) GetFile() *File {
+ if x != nil {
+ return x.File
+ }
+ return nil
+}
+
+// Request for `ListFiles`.
+type ListFilesRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. Maximum number of `File`s to return per page.
+ // If unspecified, defaults to 10. Maximum `page_size` is 100.
+ PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // Optional. A page token from a previous `ListFiles` call.
+ PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *ListFilesRequest) Reset() {
+ *x = ListFilesRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListFilesRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListFilesRequest) ProtoMessage() {}
+
+func (x *ListFilesRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[2]
+ 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 ListFilesRequest.ProtoReflect.Descriptor instead.
+func (*ListFilesRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ListFilesRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListFilesRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+// Response for `ListFiles`.
+type ListFilesResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The list of `File`s.
+ Files []*File `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
+ // A token that can be sent as a `page_token` into a subsequent `ListFiles`
+ // call.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListFilesResponse) Reset() {
+ *x = ListFilesResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListFilesResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListFilesResponse) ProtoMessage() {}
+
+func (x *ListFilesResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[3]
+ 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 ListFilesResponse.ProtoReflect.Descriptor instead.
+func (*ListFilesResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *ListFilesResponse) GetFiles() []*File {
+ if x != nil {
+ return x.Files
+ }
+ return nil
+}
+
+func (x *ListFilesResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+// Request for `GetFile`.
+type GetFileRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `File` to get.
+ // Example: `files/abc-123`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetFileRequest) Reset() {
+ *x = GetFileRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetFileRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetFileRequest) ProtoMessage() {}
+
+func (x *GetFileRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[4]
+ 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 GetFileRequest.ProtoReflect.Descriptor instead.
+func (*GetFileRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *GetFileRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request for `DeleteFile`.
+type DeleteFileRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `File` to delete.
+ // Example: `files/abc-123`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *DeleteFileRequest) Reset() {
+ *x = DeleteFileRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteFileRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteFileRequest) ProtoMessage() {}
+
+func (x *DeleteFileRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[5]
+ 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 DeleteFileRequest.ProtoReflect.Descriptor instead.
+func (*DeleteFileRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *DeleteFileRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+var File_google_ai_generativelanguage_v1beta_file_service_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_file_service_proto_rawDesc = []byte{
+ 0x0a, 0x36, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
+ 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
+ 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
+ 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a,
+ 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x12, 0x42, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x53, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x04,
+ 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x58, 0x0a, 0x10, 0x4c,
+ 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
+ 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65,
+ 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7c, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c,
+ 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x66, 0x69,
+ 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e,
+ 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f,
+ 0x6b, 0x65, 0x6e, 0x22, 0x54, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x2e, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x28, 0x0a, 0x26, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x46,
+ 0x69, 0x6c, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x57, 0x0a, 0x11, 0x44, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42,
+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2e, 0xe0, 0x41,
+ 0x02, 0xfa, 0x41, 0x28, 0x0a, 0x26, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61,
+ 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x32, 0xfa, 0x04, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
+ 0x63, 0x65, 0x12, 0x97, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c,
+ 0x65, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69,
+ 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x91, 0x01, 0x0a,
+ 0x09, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x6c, 0x65,
+ 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x0f, 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x66, 0x69, 0x6c, 0x65, 0x73,
+ 0x12, 0x90, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x33, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x25, 0xda, 0x41,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x66, 0x69, 0x6c, 0x65, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x12, 0x83, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x69,
+ 0x6c, 0x65, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46,
+ 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
+ 0x74, 0x79, 0x22, 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x18, 0x2a, 0x16, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0x24, 0xca, 0x41, 0x21, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42,
+ 0x9c, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x10, 0x46, 0x69, 0x6c,
+ 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
+ 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescData = file_google_ai_generativelanguage_v1beta_file_service_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_file_service_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_google_ai_generativelanguage_v1beta_file_service_proto_goTypes = []interface{}{
+ (*CreateFileRequest)(nil), // 0: google.ai.generativelanguage.v1beta.CreateFileRequest
+ (*CreateFileResponse)(nil), // 1: google.ai.generativelanguage.v1beta.CreateFileResponse
+ (*ListFilesRequest)(nil), // 2: google.ai.generativelanguage.v1beta.ListFilesRequest
+ (*ListFilesResponse)(nil), // 3: google.ai.generativelanguage.v1beta.ListFilesResponse
+ (*GetFileRequest)(nil), // 4: google.ai.generativelanguage.v1beta.GetFileRequest
+ (*DeleteFileRequest)(nil), // 5: google.ai.generativelanguage.v1beta.DeleteFileRequest
+ (*File)(nil), // 6: google.ai.generativelanguage.v1beta.File
+ (*emptypb.Empty)(nil), // 7: google.protobuf.Empty
+}
+var file_google_ai_generativelanguage_v1beta_file_service_proto_depIdxs = []int32{
+ 6, // 0: google.ai.generativelanguage.v1beta.CreateFileRequest.file:type_name -> google.ai.generativelanguage.v1beta.File
+ 6, // 1: google.ai.generativelanguage.v1beta.CreateFileResponse.file:type_name -> google.ai.generativelanguage.v1beta.File
+ 6, // 2: google.ai.generativelanguage.v1beta.ListFilesResponse.files:type_name -> google.ai.generativelanguage.v1beta.File
+ 0, // 3: google.ai.generativelanguage.v1beta.FileService.CreateFile:input_type -> google.ai.generativelanguage.v1beta.CreateFileRequest
+ 2, // 4: google.ai.generativelanguage.v1beta.FileService.ListFiles:input_type -> google.ai.generativelanguage.v1beta.ListFilesRequest
+ 4, // 5: google.ai.generativelanguage.v1beta.FileService.GetFile:input_type -> google.ai.generativelanguage.v1beta.GetFileRequest
+ 5, // 6: google.ai.generativelanguage.v1beta.FileService.DeleteFile:input_type -> google.ai.generativelanguage.v1beta.DeleteFileRequest
+ 1, // 7: google.ai.generativelanguage.v1beta.FileService.CreateFile:output_type -> google.ai.generativelanguage.v1beta.CreateFileResponse
+ 3, // 8: google.ai.generativelanguage.v1beta.FileService.ListFiles:output_type -> google.ai.generativelanguage.v1beta.ListFilesResponse
+ 6, // 9: google.ai.generativelanguage.v1beta.FileService.GetFile:output_type -> google.ai.generativelanguage.v1beta.File
+ 7, // 10: google.ai.generativelanguage.v1beta.FileService.DeleteFile:output_type -> google.protobuf.Empty
+ 7, // [7:11] is the sub-list for method output_type
+ 3, // [3:7] is the sub-list for method input_type
+ 3, // [3:3] is the sub-list for extension type_name
+ 3, // [3:3] is the sub-list for extension extendee
+ 0, // [0:3] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_file_service_proto_init() }
+func file_google_ai_generativelanguage_v1beta_file_service_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_file_service_proto != nil {
+ return
+ }
+ file_google_ai_generativelanguage_v1beta_file_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateFileRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateFileResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListFilesRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListFilesResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetFileRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteFileRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_file_service_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 6,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_file_service_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_file_service_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_file_service_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_file_service_proto = out.File
+ file_google_ai_generativelanguage_v1beta_file_service_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_file_service_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_file_service_proto_depIdxs = nil
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConnInterface
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion6
+
+// FileServiceClient is the client API for FileService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type FileServiceClient interface {
+ // Creates a `File`.
+ CreateFile(ctx context.Context, in *CreateFileRequest, opts ...grpc.CallOption) (*CreateFileResponse, error)
+ // Lists the metadata for `File`s owned by the requesting project.
+ ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
+ // Gets the metadata for the given `File`.
+ GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*File, error)
+ // Deletes the `File`.
+ DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+}
+
+type fileServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
+ return &fileServiceClient{cc}
+}
+
+func (c *fileServiceClient) CreateFile(ctx context.Context, in *CreateFileRequest, opts ...grpc.CallOption) (*CreateFileResponse, error) {
+ out := new(CreateFileResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.FileService/CreateFile", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *fileServiceClient) ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
+ out := new(ListFilesResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.FileService/ListFiles", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *fileServiceClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*File, error) {
+ out := new(File)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.FileService/GetFile", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *fileServiceClient) DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.FileService/DeleteFile", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// FileServiceServer is the server API for FileService service.
+type FileServiceServer interface {
+ // Creates a `File`.
+ CreateFile(context.Context, *CreateFileRequest) (*CreateFileResponse, error)
+ // Lists the metadata for `File`s owned by the requesting project.
+ ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error)
+ // Gets the metadata for the given `File`.
+ GetFile(context.Context, *GetFileRequest) (*File, error)
+ // Deletes the `File`.
+ DeleteFile(context.Context, *DeleteFileRequest) (*emptypb.Empty, error)
+}
+
+// UnimplementedFileServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedFileServiceServer struct {
+}
+
+func (*UnimplementedFileServiceServer) CreateFile(context.Context, *CreateFileRequest) (*CreateFileResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateFile not implemented")
+}
+func (*UnimplementedFileServiceServer) ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListFiles not implemented")
+}
+func (*UnimplementedFileServiceServer) GetFile(context.Context, *GetFileRequest) (*File, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetFile not implemented")
+}
+func (*UnimplementedFileServiceServer) DeleteFile(context.Context, *DeleteFileRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteFile not implemented")
+}
+
+func RegisterFileServiceServer(s *grpc.Server, srv FileServiceServer) {
+ s.RegisterService(&_FileService_serviceDesc, srv)
+}
+
+func _FileService_CreateFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateFileRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(FileServiceServer).CreateFile(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.FileService/CreateFile",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(FileServiceServer).CreateFile(ctx, req.(*CreateFileRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _FileService_ListFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListFilesRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(FileServiceServer).ListFiles(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.FileService/ListFiles",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(FileServiceServer).ListFiles(ctx, req.(*ListFilesRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _FileService_GetFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetFileRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(FileServiceServer).GetFile(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.FileService/GetFile",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(FileServiceServer).GetFile(ctx, req.(*GetFileRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _FileService_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteFileRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(FileServiceServer).DeleteFile(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.FileService/DeleteFile",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(FileServiceServer).DeleteFile(ctx, req.(*DeleteFileRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _FileService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "google.ai.generativelanguage.v1beta.FileService",
+ HandlerType: (*FileServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "CreateFile",
+ Handler: _FileService_CreateFile_Handler,
+ },
+ {
+ MethodName: "ListFiles",
+ Handler: _FileService_ListFiles_Handler,
+ },
+ {
+ MethodName: "GetFile",
+ Handler: _FileService_GetFile_Handler,
+ },
+ {
+ MethodName: "DeleteFile",
+ Handler: _FileService_DeleteFile_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "google/ai/generativelanguage/v1beta/file_service.proto",
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/generative_service.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/generative_service.pb.go
new file mode 100644
index 000000000..41db30ab6
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/generative_service.pb.go
@@ -0,0 +1,3323 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/generative_service.proto
+
+package generativelanguagepb
+
+import (
+ context "context"
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Type of task for which the embedding will be used.
+type TaskType int32
+
+const (
+ // Unset value, which will default to one of the other enum values.
+ TaskType_TASK_TYPE_UNSPECIFIED TaskType = 0
+ // Specifies the given text is a query in a search/retrieval setting.
+ TaskType_RETRIEVAL_QUERY TaskType = 1
+ // Specifies the given text is a document from the corpus being searched.
+ TaskType_RETRIEVAL_DOCUMENT TaskType = 2
+ // Specifies the given text will be used for STS.
+ TaskType_SEMANTIC_SIMILARITY TaskType = 3
+ // Specifies that the given text will be classified.
+ TaskType_CLASSIFICATION TaskType = 4
+ // Specifies that the embeddings will be used for clustering.
+ TaskType_CLUSTERING TaskType = 5
+ // Specifies that the given text will be used for question answering.
+ TaskType_QUESTION_ANSWERING TaskType = 6
+ // Specifies that the given text will be used for fact verification.
+ TaskType_FACT_VERIFICATION TaskType = 7
+)
+
+// Enum value maps for TaskType.
+var (
+ TaskType_name = map[int32]string{
+ 0: "TASK_TYPE_UNSPECIFIED",
+ 1: "RETRIEVAL_QUERY",
+ 2: "RETRIEVAL_DOCUMENT",
+ 3: "SEMANTIC_SIMILARITY",
+ 4: "CLASSIFICATION",
+ 5: "CLUSTERING",
+ 6: "QUESTION_ANSWERING",
+ 7: "FACT_VERIFICATION",
+ }
+ TaskType_value = map[string]int32{
+ "TASK_TYPE_UNSPECIFIED": 0,
+ "RETRIEVAL_QUERY": 1,
+ "RETRIEVAL_DOCUMENT": 2,
+ "SEMANTIC_SIMILARITY": 3,
+ "CLASSIFICATION": 4,
+ "CLUSTERING": 5,
+ "QUESTION_ANSWERING": 6,
+ "FACT_VERIFICATION": 7,
+ }
+)
+
+func (x TaskType) Enum() *TaskType {
+ p := new(TaskType)
+ *p = x
+ return p
+}
+
+func (x TaskType) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (TaskType) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[0].Descriptor()
+}
+
+func (TaskType) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[0]
+}
+
+func (x TaskType) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use TaskType.Descriptor instead.
+func (TaskType) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{0}
+}
+
+// Specifies what was the reason why prompt was blocked.
+type GenerateContentResponse_PromptFeedback_BlockReason int32
+
+const (
+ // Default value. This value is unused.
+ GenerateContentResponse_PromptFeedback_BLOCK_REASON_UNSPECIFIED GenerateContentResponse_PromptFeedback_BlockReason = 0
+ // Prompt was blocked due to safety reasons. You can inspect
+ // `safety_ratings` to understand which safety category blocked it.
+ GenerateContentResponse_PromptFeedback_SAFETY GenerateContentResponse_PromptFeedback_BlockReason = 1
+ // Prompt was blocked due to unknown reaasons.
+ GenerateContentResponse_PromptFeedback_OTHER GenerateContentResponse_PromptFeedback_BlockReason = 2
+)
+
+// Enum value maps for GenerateContentResponse_PromptFeedback_BlockReason.
+var (
+ GenerateContentResponse_PromptFeedback_BlockReason_name = map[int32]string{
+ 0: "BLOCK_REASON_UNSPECIFIED",
+ 1: "SAFETY",
+ 2: "OTHER",
+ }
+ GenerateContentResponse_PromptFeedback_BlockReason_value = map[string]int32{
+ "BLOCK_REASON_UNSPECIFIED": 0,
+ "SAFETY": 1,
+ "OTHER": 2,
+ }
+)
+
+func (x GenerateContentResponse_PromptFeedback_BlockReason) Enum() *GenerateContentResponse_PromptFeedback_BlockReason {
+ p := new(GenerateContentResponse_PromptFeedback_BlockReason)
+ *p = x
+ return p
+}
+
+func (x GenerateContentResponse_PromptFeedback_BlockReason) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (GenerateContentResponse_PromptFeedback_BlockReason) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[1].Descriptor()
+}
+
+func (GenerateContentResponse_PromptFeedback_BlockReason) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[1]
+}
+
+func (x GenerateContentResponse_PromptFeedback_BlockReason) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use GenerateContentResponse_PromptFeedback_BlockReason.Descriptor instead.
+func (GenerateContentResponse_PromptFeedback_BlockReason) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{3, 0, 0}
+}
+
+// Defines the reason why the model stopped generating tokens.
+type Candidate_FinishReason int32
+
+const (
+ // Default value. This value is unused.
+ Candidate_FINISH_REASON_UNSPECIFIED Candidate_FinishReason = 0
+ // Natural stop point of the model or provided stop sequence.
+ Candidate_STOP Candidate_FinishReason = 1
+ // The maximum number of tokens as specified in the request was reached.
+ Candidate_MAX_TOKENS Candidate_FinishReason = 2
+ // The candidate content was flagged for safety reasons.
+ Candidate_SAFETY Candidate_FinishReason = 3
+ // The candidate content was flagged for recitation reasons.
+ Candidate_RECITATION Candidate_FinishReason = 4
+ // Unknown reason.
+ Candidate_OTHER Candidate_FinishReason = 5
+)
+
+// Enum value maps for Candidate_FinishReason.
+var (
+ Candidate_FinishReason_name = map[int32]string{
+ 0: "FINISH_REASON_UNSPECIFIED",
+ 1: "STOP",
+ 2: "MAX_TOKENS",
+ 3: "SAFETY",
+ 4: "RECITATION",
+ 5: "OTHER",
+ }
+ Candidate_FinishReason_value = map[string]int32{
+ "FINISH_REASON_UNSPECIFIED": 0,
+ "STOP": 1,
+ "MAX_TOKENS": 2,
+ "SAFETY": 3,
+ "RECITATION": 4,
+ "OTHER": 5,
+ }
+)
+
+func (x Candidate_FinishReason) Enum() *Candidate_FinishReason {
+ p := new(Candidate_FinishReason)
+ *p = x
+ return p
+}
+
+func (x Candidate_FinishReason) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Candidate_FinishReason) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[2].Descriptor()
+}
+
+func (Candidate_FinishReason) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[2]
+}
+
+func (x Candidate_FinishReason) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Candidate_FinishReason.Descriptor instead.
+func (Candidate_FinishReason) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{4, 0}
+}
+
+// Style for grounded answers.
+type GenerateAnswerRequest_AnswerStyle int32
+
+const (
+ // Unspecified answer style.
+ GenerateAnswerRequest_ANSWER_STYLE_UNSPECIFIED GenerateAnswerRequest_AnswerStyle = 0
+ // Succint but abstract style.
+ GenerateAnswerRequest_ABSTRACTIVE GenerateAnswerRequest_AnswerStyle = 1
+ // Very brief and extractive style.
+ GenerateAnswerRequest_EXTRACTIVE GenerateAnswerRequest_AnswerStyle = 2
+ // Verbose style including extra details. The response may be formatted as a
+ // sentence, paragraph, multiple paragraphs, or bullet points, etc.
+ GenerateAnswerRequest_VERBOSE GenerateAnswerRequest_AnswerStyle = 3
+)
+
+// Enum value maps for GenerateAnswerRequest_AnswerStyle.
+var (
+ GenerateAnswerRequest_AnswerStyle_name = map[int32]string{
+ 0: "ANSWER_STYLE_UNSPECIFIED",
+ 1: "ABSTRACTIVE",
+ 2: "EXTRACTIVE",
+ 3: "VERBOSE",
+ }
+ GenerateAnswerRequest_AnswerStyle_value = map[string]int32{
+ "ANSWER_STYLE_UNSPECIFIED": 0,
+ "ABSTRACTIVE": 1,
+ "EXTRACTIVE": 2,
+ "VERBOSE": 3,
+ }
+)
+
+func (x GenerateAnswerRequest_AnswerStyle) Enum() *GenerateAnswerRequest_AnswerStyle {
+ p := new(GenerateAnswerRequest_AnswerStyle)
+ *p = x
+ return p
+}
+
+func (x GenerateAnswerRequest_AnswerStyle) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (GenerateAnswerRequest_AnswerStyle) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[3].Descriptor()
+}
+
+func (GenerateAnswerRequest_AnswerStyle) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[3]
+}
+
+func (x GenerateAnswerRequest_AnswerStyle) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use GenerateAnswerRequest_AnswerStyle.Descriptor instead.
+func (GenerateAnswerRequest_AnswerStyle) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{7, 0}
+}
+
+// Specifies what was the reason why input was blocked.
+type GenerateAnswerResponse_InputFeedback_BlockReason int32
+
+const (
+ // Default value. This value is unused.
+ GenerateAnswerResponse_InputFeedback_BLOCK_REASON_UNSPECIFIED GenerateAnswerResponse_InputFeedback_BlockReason = 0
+ // Input was blocked due to safety reasons. You can inspect
+ // `safety_ratings` to understand which safety category blocked it.
+ GenerateAnswerResponse_InputFeedback_SAFETY GenerateAnswerResponse_InputFeedback_BlockReason = 1
+ // Input was blocked due to other reasons.
+ GenerateAnswerResponse_InputFeedback_OTHER GenerateAnswerResponse_InputFeedback_BlockReason = 2
+)
+
+// Enum value maps for GenerateAnswerResponse_InputFeedback_BlockReason.
+var (
+ GenerateAnswerResponse_InputFeedback_BlockReason_name = map[int32]string{
+ 0: "BLOCK_REASON_UNSPECIFIED",
+ 1: "SAFETY",
+ 2: "OTHER",
+ }
+ GenerateAnswerResponse_InputFeedback_BlockReason_value = map[string]int32{
+ "BLOCK_REASON_UNSPECIFIED": 0,
+ "SAFETY": 1,
+ "OTHER": 2,
+ }
+)
+
+func (x GenerateAnswerResponse_InputFeedback_BlockReason) Enum() *GenerateAnswerResponse_InputFeedback_BlockReason {
+ p := new(GenerateAnswerResponse_InputFeedback_BlockReason)
+ *p = x
+ return p
+}
+
+func (x GenerateAnswerResponse_InputFeedback_BlockReason) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (GenerateAnswerResponse_InputFeedback_BlockReason) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[4].Descriptor()
+}
+
+func (GenerateAnswerResponse_InputFeedback_BlockReason) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes[4]
+}
+
+func (x GenerateAnswerResponse_InputFeedback_BlockReason) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use GenerateAnswerResponse_InputFeedback_BlockReason.Descriptor instead.
+func (GenerateAnswerResponse_InputFeedback_BlockReason) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{8, 0, 0}
+}
+
+// Request to generate a completion from the model.
+type GenerateContentRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Model` to use for generating the completion.
+ //
+ // Format: `name=models/{model}`.
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // Optional. Developer set system instruction. Currently, text only.
+ SystemInstruction *Content `protobuf:"bytes,8,opt,name=system_instruction,json=systemInstruction,proto3,oneof" json:"system_instruction,omitempty"`
+ // 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.
+ Contents []*Content `protobuf:"bytes,2,rep,name=contents,proto3" json:"contents,omitempty"`
+ // 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`.
+ Tools []*Tool `protobuf:"bytes,5,rep,name=tools,proto3" json:"tools,omitempty"`
+ // Optional. Tool configuration for any `Tool` specified in the request.
+ ToolConfig *ToolConfig `protobuf:"bytes,7,opt,name=tool_config,json=toolConfig,proto3" json:"tool_config,omitempty"`
+ // 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.
+ SafetySettings []*SafetySetting `protobuf:"bytes,3,rep,name=safety_settings,json=safetySettings,proto3" json:"safety_settings,omitempty"`
+ // Optional. Configuration options for model generation and outputs.
+ GenerationConfig *GenerationConfig `protobuf:"bytes,4,opt,name=generation_config,json=generationConfig,proto3,oneof" json:"generation_config,omitempty"`
+}
+
+func (x *GenerateContentRequest) Reset() {
+ *x = GenerateContentRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateContentRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateContentRequest) ProtoMessage() {}
+
+func (x *GenerateContentRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_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 GenerateContentRequest.ProtoReflect.Descriptor instead.
+func (*GenerateContentRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GenerateContentRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *GenerateContentRequest) GetSystemInstruction() *Content {
+ if x != nil {
+ return x.SystemInstruction
+ }
+ return nil
+}
+
+func (x *GenerateContentRequest) GetContents() []*Content {
+ if x != nil {
+ return x.Contents
+ }
+ return nil
+}
+
+func (x *GenerateContentRequest) GetTools() []*Tool {
+ if x != nil {
+ return x.Tools
+ }
+ return nil
+}
+
+func (x *GenerateContentRequest) GetToolConfig() *ToolConfig {
+ if x != nil {
+ return x.ToolConfig
+ }
+ return nil
+}
+
+func (x *GenerateContentRequest) GetSafetySettings() []*SafetySetting {
+ if x != nil {
+ return x.SafetySettings
+ }
+ return nil
+}
+
+func (x *GenerateContentRequest) GetGenerationConfig() *GenerationConfig {
+ if x != nil {
+ return x.GenerationConfig
+ }
+ return nil
+}
+
+// Configuration options for model generation and outputs. Not all parameters
+// may be configurable for every model.
+type GenerationConfig struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. Number of generated responses to return.
+ //
+ // Currently, this value can only be set to 1. If unset, this will default
+ // to 1.
+ CandidateCount *int32 `protobuf:"varint,1,opt,name=candidate_count,json=candidateCount,proto3,oneof" json:"candidate_count,omitempty"`
+ // 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.
+ StopSequences []string `protobuf:"bytes,2,rep,name=stop_sequences,json=stopSequences,proto3" json:"stop_sequences,omitempty"`
+ // 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.
+ MaxOutputTokens *int32 `protobuf:"varint,4,opt,name=max_output_tokens,json=maxOutputTokens,proto3,oneof" json:"max_output_tokens,omitempty"`
+ // 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].
+ Temperature *float32 `protobuf:"fixed32,5,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"`
+ // 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.
+ TopP *float32 `protobuf:"fixed32,6,opt,name=top_p,json=topP,proto3,oneof" json:"top_p,omitempty"`
+ // 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.
+ TopK *int32 `protobuf:"varint,7,opt,name=top_k,json=topK,proto3,oneof" json:"top_k,omitempty"`
+ // Optional. Output response mimetype of the generated candidate text.
+ // Supported mimetype:
+ // `text/plain`: (default) Text output.
+ // `application/json`: JSON response in the candidates.
+ ResponseMimeType string `protobuf:"bytes,13,opt,name=response_mime_type,json=responseMimeType,proto3" json:"response_mime_type,omitempty"`
+ // 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.
+ ResponseSchema *Schema `protobuf:"bytes,14,opt,name=response_schema,json=responseSchema,proto3" json:"response_schema,omitempty"`
+}
+
+func (x *GenerationConfig) Reset() {
+ *x = GenerationConfig{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerationConfig) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerationConfig) ProtoMessage() {}
+
+func (x *GenerationConfig) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[1]
+ 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 GenerationConfig.ProtoReflect.Descriptor instead.
+func (*GenerationConfig) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GenerationConfig) GetCandidateCount() int32 {
+ if x != nil && x.CandidateCount != nil {
+ return *x.CandidateCount
+ }
+ return 0
+}
+
+func (x *GenerationConfig) GetStopSequences() []string {
+ if x != nil {
+ return x.StopSequences
+ }
+ return nil
+}
+
+func (x *GenerationConfig) GetMaxOutputTokens() int32 {
+ if x != nil && x.MaxOutputTokens != nil {
+ return *x.MaxOutputTokens
+ }
+ return 0
+}
+
+func (x *GenerationConfig) GetTemperature() float32 {
+ if x != nil && x.Temperature != nil {
+ return *x.Temperature
+ }
+ return 0
+}
+
+func (x *GenerationConfig) GetTopP() float32 {
+ if x != nil && x.TopP != nil {
+ return *x.TopP
+ }
+ return 0
+}
+
+func (x *GenerationConfig) GetTopK() int32 {
+ if x != nil && x.TopK != nil {
+ return *x.TopK
+ }
+ return 0
+}
+
+func (x *GenerationConfig) GetResponseMimeType() string {
+ if x != nil {
+ return x.ResponseMimeType
+ }
+ return ""
+}
+
+func (x *GenerationConfig) GetResponseSchema() *Schema {
+ if x != nil {
+ return x.ResponseSchema
+ }
+ return nil
+}
+
+// Configuration for retrieving grounding content from a `Corpus` or
+// `Document` created using the Semantic Retriever API.
+type SemanticRetrieverConfig struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. Name of the resource for retrieval, e.g. corpora/123 or
+ // corpora/123/documents/abc.
+ Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
+ // Required. Query to use for similarity matching `Chunk`s in the given
+ // resource.
+ Query *Content `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
+ // Optional. Filters for selecting `Document`s and/or `Chunk`s from the
+ // resource.
+ MetadataFilters []*MetadataFilter `protobuf:"bytes,3,rep,name=metadata_filters,json=metadataFilters,proto3" json:"metadata_filters,omitempty"`
+ // Optional. Maximum number of relevant `Chunk`s to retrieve.
+ MaxChunksCount *int32 `protobuf:"varint,4,opt,name=max_chunks_count,json=maxChunksCount,proto3,oneof" json:"max_chunks_count,omitempty"`
+ // Optional. Minimum relevance score for retrieved relevant `Chunk`s.
+ MinimumRelevanceScore *float32 `protobuf:"fixed32,5,opt,name=minimum_relevance_score,json=minimumRelevanceScore,proto3,oneof" json:"minimum_relevance_score,omitempty"`
+}
+
+func (x *SemanticRetrieverConfig) Reset() {
+ *x = SemanticRetrieverConfig{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SemanticRetrieverConfig) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SemanticRetrieverConfig) ProtoMessage() {}
+
+func (x *SemanticRetrieverConfig) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[2]
+ 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 SemanticRetrieverConfig.ProtoReflect.Descriptor instead.
+func (*SemanticRetrieverConfig) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *SemanticRetrieverConfig) GetSource() string {
+ if x != nil {
+ return x.Source
+ }
+ return ""
+}
+
+func (x *SemanticRetrieverConfig) GetQuery() *Content {
+ if x != nil {
+ return x.Query
+ }
+ return nil
+}
+
+func (x *SemanticRetrieverConfig) GetMetadataFilters() []*MetadataFilter {
+ if x != nil {
+ return x.MetadataFilters
+ }
+ return nil
+}
+
+func (x *SemanticRetrieverConfig) GetMaxChunksCount() int32 {
+ if x != nil && x.MaxChunksCount != nil {
+ return *x.MaxChunksCount
+ }
+ return 0
+}
+
+func (x *SemanticRetrieverConfig) GetMinimumRelevanceScore() float32 {
+ if x != nil && x.MinimumRelevanceScore != nil {
+ return *x.MinimumRelevanceScore
+ }
+ return 0
+}
+
+// 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`.
+type GenerateContentResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Candidate responses from the model.
+ Candidates []*Candidate `protobuf:"bytes,1,rep,name=candidates,proto3" json:"candidates,omitempty"`
+ // Returns the prompt's feedback related to the content filters.
+ PromptFeedback *GenerateContentResponse_PromptFeedback `protobuf:"bytes,2,opt,name=prompt_feedback,json=promptFeedback,proto3" json:"prompt_feedback,omitempty"`
+ // Output only. Metadata on the generation requests' token usage.
+ UsageMetadata *GenerateContentResponse_UsageMetadata `protobuf:"bytes,3,opt,name=usage_metadata,json=usageMetadata,proto3" json:"usage_metadata,omitempty"`
+}
+
+func (x *GenerateContentResponse) Reset() {
+ *x = GenerateContentResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateContentResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateContentResponse) ProtoMessage() {}
+
+func (x *GenerateContentResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[3]
+ 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 GenerateContentResponse.ProtoReflect.Descriptor instead.
+func (*GenerateContentResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *GenerateContentResponse) GetCandidates() []*Candidate {
+ if x != nil {
+ return x.Candidates
+ }
+ return nil
+}
+
+func (x *GenerateContentResponse) GetPromptFeedback() *GenerateContentResponse_PromptFeedback {
+ if x != nil {
+ return x.PromptFeedback
+ }
+ return nil
+}
+
+func (x *GenerateContentResponse) GetUsageMetadata() *GenerateContentResponse_UsageMetadata {
+ if x != nil {
+ return x.UsageMetadata
+ }
+ return nil
+}
+
+// A response candidate generated from the model.
+type Candidate struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. Index of the candidate in the list of candidates.
+ Index *int32 `protobuf:"varint,3,opt,name=index,proto3,oneof" json:"index,omitempty"`
+ // Output only. Generated content returned from the model.
+ Content *Content `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
+ // Optional. Output only. The reason why the model stopped generating tokens.
+ //
+ // If empty, the model has not stopped generating the tokens.
+ FinishReason Candidate_FinishReason `protobuf:"varint,2,opt,name=finish_reason,json=finishReason,proto3,enum=google.ai.generativelanguage.v1beta.Candidate_FinishReason" json:"finish_reason,omitempty"`
+ // List of ratings for the safety of a response candidate.
+ //
+ // There is at most one rating per category.
+ SafetyRatings []*SafetyRating `protobuf:"bytes,5,rep,name=safety_ratings,json=safetyRatings,proto3" json:"safety_ratings,omitempty"`
+ // 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.
+ CitationMetadata *CitationMetadata `protobuf:"bytes,6,opt,name=citation_metadata,json=citationMetadata,proto3" json:"citation_metadata,omitempty"`
+ // Output only. Token count for this candidate.
+ TokenCount int32 `protobuf:"varint,7,opt,name=token_count,json=tokenCount,proto3" json:"token_count,omitempty"`
+ // Output only. Attribution information for sources that contributed to a
+ // grounded answer.
+ //
+ // This field is populated for `GenerateAnswer` calls.
+ GroundingAttributions []*GroundingAttribution `protobuf:"bytes,8,rep,name=grounding_attributions,json=groundingAttributions,proto3" json:"grounding_attributions,omitempty"`
+}
+
+func (x *Candidate) Reset() {
+ *x = Candidate{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Candidate) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Candidate) ProtoMessage() {}
+
+func (x *Candidate) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[4]
+ 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 Candidate.ProtoReflect.Descriptor instead.
+func (*Candidate) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *Candidate) GetIndex() int32 {
+ if x != nil && x.Index != nil {
+ return *x.Index
+ }
+ return 0
+}
+
+func (x *Candidate) GetContent() *Content {
+ if x != nil {
+ return x.Content
+ }
+ return nil
+}
+
+func (x *Candidate) GetFinishReason() Candidate_FinishReason {
+ if x != nil {
+ return x.FinishReason
+ }
+ return Candidate_FINISH_REASON_UNSPECIFIED
+}
+
+func (x *Candidate) GetSafetyRatings() []*SafetyRating {
+ if x != nil {
+ return x.SafetyRatings
+ }
+ return nil
+}
+
+func (x *Candidate) GetCitationMetadata() *CitationMetadata {
+ if x != nil {
+ return x.CitationMetadata
+ }
+ return nil
+}
+
+func (x *Candidate) GetTokenCount() int32 {
+ if x != nil {
+ return x.TokenCount
+ }
+ return 0
+}
+
+func (x *Candidate) GetGroundingAttributions() []*GroundingAttribution {
+ if x != nil {
+ return x.GroundingAttributions
+ }
+ return nil
+}
+
+// Identifier for the source contributing to this attribution.
+type AttributionSourceId struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Types that are assignable to Source:
+ //
+ // *AttributionSourceId_GroundingPassage
+ // *AttributionSourceId_SemanticRetrieverChunk_
+ Source isAttributionSourceId_Source `protobuf_oneof:"source"`
+}
+
+func (x *AttributionSourceId) Reset() {
+ *x = AttributionSourceId{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *AttributionSourceId) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AttributionSourceId) ProtoMessage() {}
+
+func (x *AttributionSourceId) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[5]
+ 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 AttributionSourceId.ProtoReflect.Descriptor instead.
+func (*AttributionSourceId) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (m *AttributionSourceId) GetSource() isAttributionSourceId_Source {
+ if m != nil {
+ return m.Source
+ }
+ return nil
+}
+
+func (x *AttributionSourceId) GetGroundingPassage() *AttributionSourceId_GroundingPassageId {
+ if x, ok := x.GetSource().(*AttributionSourceId_GroundingPassage); ok {
+ return x.GroundingPassage
+ }
+ return nil
+}
+
+func (x *AttributionSourceId) GetSemanticRetrieverChunk() *AttributionSourceId_SemanticRetrieverChunk {
+ if x, ok := x.GetSource().(*AttributionSourceId_SemanticRetrieverChunk_); ok {
+ return x.SemanticRetrieverChunk
+ }
+ return nil
+}
+
+type isAttributionSourceId_Source interface {
+ isAttributionSourceId_Source()
+}
+
+type AttributionSourceId_GroundingPassage struct {
+ // Identifier for an inline passage.
+ GroundingPassage *AttributionSourceId_GroundingPassageId `protobuf:"bytes,1,opt,name=grounding_passage,json=groundingPassage,proto3,oneof"`
+}
+
+type AttributionSourceId_SemanticRetrieverChunk_ struct {
+ // Identifier for a `Chunk` fetched via Semantic Retriever.
+ SemanticRetrieverChunk *AttributionSourceId_SemanticRetrieverChunk `protobuf:"bytes,2,opt,name=semantic_retriever_chunk,json=semanticRetrieverChunk,proto3,oneof"`
+}
+
+func (*AttributionSourceId_GroundingPassage) isAttributionSourceId_Source() {}
+
+func (*AttributionSourceId_SemanticRetrieverChunk_) isAttributionSourceId_Source() {}
+
+// Attribution for a source that contributed to an answer.
+type GroundingAttribution struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. Identifier for the source contributing to this attribution.
+ SourceId *AttributionSourceId `protobuf:"bytes,3,opt,name=source_id,json=sourceId,proto3" json:"source_id,omitempty"`
+ // Grounding source content that makes up this attribution.
+ Content *Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
+}
+
+func (x *GroundingAttribution) Reset() {
+ *x = GroundingAttribution{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GroundingAttribution) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GroundingAttribution) ProtoMessage() {}
+
+func (x *GroundingAttribution) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[6]
+ 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 GroundingAttribution.ProtoReflect.Descriptor instead.
+func (*GroundingAttribution) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *GroundingAttribution) GetSourceId() *AttributionSourceId {
+ if x != nil {
+ return x.SourceId
+ }
+ return nil
+}
+
+func (x *GroundingAttribution) GetContent() *Content {
+ if x != nil {
+ return x.Content
+ }
+ return nil
+}
+
+// Request to generate a grounded answer from the model.
+type GenerateAnswerRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The sources in which to ground the answer.
+ //
+ // Types that are assignable to GroundingSource:
+ //
+ // *GenerateAnswerRequest_InlinePassages
+ // *GenerateAnswerRequest_SemanticRetriever
+ GroundingSource isGenerateAnswerRequest_GroundingSource `protobuf_oneof:"grounding_source"`
+ // Required. The name of the `Model` to use for generating the grounded
+ // response.
+ //
+ // Format: `model=models/{model}`.
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // 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.
+ Contents []*Content `protobuf:"bytes,2,rep,name=contents,proto3" json:"contents,omitempty"`
+ // Required. Style in which answers should be returned.
+ AnswerStyle GenerateAnswerRequest_AnswerStyle `protobuf:"varint,5,opt,name=answer_style,json=answerStyle,proto3,enum=google.ai.generativelanguage.v1beta.GenerateAnswerRequest_AnswerStyle" json:"answer_style,omitempty"`
+ // 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.
+ SafetySettings []*SafetySetting `protobuf:"bytes,3,rep,name=safety_settings,json=safetySettings,proto3" json:"safety_settings,omitempty"`
+ // 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.
+ Temperature *float32 `protobuf:"fixed32,4,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"`
+}
+
+func (x *GenerateAnswerRequest) Reset() {
+ *x = GenerateAnswerRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateAnswerRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateAnswerRequest) ProtoMessage() {}
+
+func (x *GenerateAnswerRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[7]
+ 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 GenerateAnswerRequest.ProtoReflect.Descriptor instead.
+func (*GenerateAnswerRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (m *GenerateAnswerRequest) GetGroundingSource() isGenerateAnswerRequest_GroundingSource {
+ if m != nil {
+ return m.GroundingSource
+ }
+ return nil
+}
+
+func (x *GenerateAnswerRequest) GetInlinePassages() *GroundingPassages {
+ if x, ok := x.GetGroundingSource().(*GenerateAnswerRequest_InlinePassages); ok {
+ return x.InlinePassages
+ }
+ return nil
+}
+
+func (x *GenerateAnswerRequest) GetSemanticRetriever() *SemanticRetrieverConfig {
+ if x, ok := x.GetGroundingSource().(*GenerateAnswerRequest_SemanticRetriever); ok {
+ return x.SemanticRetriever
+ }
+ return nil
+}
+
+func (x *GenerateAnswerRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *GenerateAnswerRequest) GetContents() []*Content {
+ if x != nil {
+ return x.Contents
+ }
+ return nil
+}
+
+func (x *GenerateAnswerRequest) GetAnswerStyle() GenerateAnswerRequest_AnswerStyle {
+ if x != nil {
+ return x.AnswerStyle
+ }
+ return GenerateAnswerRequest_ANSWER_STYLE_UNSPECIFIED
+}
+
+func (x *GenerateAnswerRequest) GetSafetySettings() []*SafetySetting {
+ if x != nil {
+ return x.SafetySettings
+ }
+ return nil
+}
+
+func (x *GenerateAnswerRequest) GetTemperature() float32 {
+ if x != nil && x.Temperature != nil {
+ return *x.Temperature
+ }
+ return 0
+}
+
+type isGenerateAnswerRequest_GroundingSource interface {
+ isGenerateAnswerRequest_GroundingSource()
+}
+
+type GenerateAnswerRequest_InlinePassages struct {
+ // Passages provided inline with the request.
+ InlinePassages *GroundingPassages `protobuf:"bytes,6,opt,name=inline_passages,json=inlinePassages,proto3,oneof"`
+}
+
+type GenerateAnswerRequest_SemanticRetriever struct {
+ // Content retrieved from resources created via the Semantic Retriever
+ // API.
+ SemanticRetriever *SemanticRetrieverConfig `protobuf:"bytes,7,opt,name=semantic_retriever,json=semanticRetriever,proto3,oneof"`
+}
+
+func (*GenerateAnswerRequest_InlinePassages) isGenerateAnswerRequest_GroundingSource() {}
+
+func (*GenerateAnswerRequest_SemanticRetriever) isGenerateAnswerRequest_GroundingSource() {}
+
+// Response from the model for a grounded answer.
+type GenerateAnswerResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`.
+ Answer *Candidate `protobuf:"bytes,1,opt,name=answer,proto3" json:"answer,omitempty"`
+ // 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.
+ AnswerableProbability *float32 `protobuf:"fixed32,2,opt,name=answerable_probability,json=answerableProbability,proto3,oneof" json:"answerable_probability,omitempty"`
+ // 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`)
+ InputFeedback *GenerateAnswerResponse_InputFeedback `protobuf:"bytes,3,opt,name=input_feedback,json=inputFeedback,proto3,oneof" json:"input_feedback,omitempty"`
+}
+
+func (x *GenerateAnswerResponse) Reset() {
+ *x = GenerateAnswerResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateAnswerResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateAnswerResponse) ProtoMessage() {}
+
+func (x *GenerateAnswerResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[8]
+ 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 GenerateAnswerResponse.ProtoReflect.Descriptor instead.
+func (*GenerateAnswerResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *GenerateAnswerResponse) GetAnswer() *Candidate {
+ if x != nil {
+ return x.Answer
+ }
+ return nil
+}
+
+func (x *GenerateAnswerResponse) GetAnswerableProbability() float32 {
+ if x != nil && x.AnswerableProbability != nil {
+ return *x.AnswerableProbability
+ }
+ return 0
+}
+
+func (x *GenerateAnswerResponse) GetInputFeedback() *GenerateAnswerResponse_InputFeedback {
+ if x != nil {
+ return x.InputFeedback
+ }
+ return nil
+}
+
+// Request containing the `Content` for the model to embed.
+type EmbedContentRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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}`
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // Required. The content to embed. Only the `parts.text` fields will be
+ // counted.
+ Content *Content `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
+ // Optional. Optional task type for which the embeddings will be used. Can
+ // only be set for `models/embedding-001`.
+ TaskType *TaskType `protobuf:"varint,3,opt,name=task_type,json=taskType,proto3,enum=google.ai.generativelanguage.v1beta.TaskType,oneof" json:"task_type,omitempty"`
+ // 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.
+ Title *string `protobuf:"bytes,4,opt,name=title,proto3,oneof" json:"title,omitempty"`
+ // 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.
+ OutputDimensionality *int32 `protobuf:"varint,5,opt,name=output_dimensionality,json=outputDimensionality,proto3,oneof" json:"output_dimensionality,omitempty"`
+}
+
+func (x *EmbedContentRequest) Reset() {
+ *x = EmbedContentRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *EmbedContentRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EmbedContentRequest) ProtoMessage() {}
+
+func (x *EmbedContentRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[9]
+ 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 EmbedContentRequest.ProtoReflect.Descriptor instead.
+func (*EmbedContentRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *EmbedContentRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *EmbedContentRequest) GetContent() *Content {
+ if x != nil {
+ return x.Content
+ }
+ return nil
+}
+
+func (x *EmbedContentRequest) GetTaskType() TaskType {
+ if x != nil && x.TaskType != nil {
+ return *x.TaskType
+ }
+ return TaskType_TASK_TYPE_UNSPECIFIED
+}
+
+func (x *EmbedContentRequest) GetTitle() string {
+ if x != nil && x.Title != nil {
+ return *x.Title
+ }
+ return ""
+}
+
+func (x *EmbedContentRequest) GetOutputDimensionality() int32 {
+ if x != nil && x.OutputDimensionality != nil {
+ return *x.OutputDimensionality
+ }
+ return 0
+}
+
+// A list of floats representing an embedding.
+type ContentEmbedding struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The embedding values.
+ Values []float32 `protobuf:"fixed32,1,rep,packed,name=values,proto3" json:"values,omitempty"`
+}
+
+func (x *ContentEmbedding) Reset() {
+ *x = ContentEmbedding{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ContentEmbedding) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ContentEmbedding) ProtoMessage() {}
+
+func (x *ContentEmbedding) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[10]
+ 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 ContentEmbedding.ProtoReflect.Descriptor instead.
+func (*ContentEmbedding) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *ContentEmbedding) GetValues() []float32 {
+ if x != nil {
+ return x.Values
+ }
+ return nil
+}
+
+// The response to an `EmbedContentRequest`.
+type EmbedContentResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. The embedding generated from the input content.
+ Embedding *ContentEmbedding `protobuf:"bytes,1,opt,name=embedding,proto3" json:"embedding,omitempty"`
+}
+
+func (x *EmbedContentResponse) Reset() {
+ *x = EmbedContentResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *EmbedContentResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EmbedContentResponse) ProtoMessage() {}
+
+func (x *EmbedContentResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[11]
+ 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 EmbedContentResponse.ProtoReflect.Descriptor instead.
+func (*EmbedContentResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{11}
+}
+
+func (x *EmbedContentResponse) GetEmbedding() *ContentEmbedding {
+ if x != nil {
+ return x.Embedding
+ }
+ return nil
+}
+
+// Batch request to get embeddings from the model for a list of prompts.
+type BatchEmbedContentsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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}`
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // Required. Embed requests for the batch. The model in each of these requests
+ // must match the model specified `BatchEmbedContentsRequest.model`.
+ Requests []*EmbedContentRequest `protobuf:"bytes,2,rep,name=requests,proto3" json:"requests,omitempty"`
+}
+
+func (x *BatchEmbedContentsRequest) Reset() {
+ *x = BatchEmbedContentsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchEmbedContentsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchEmbedContentsRequest) ProtoMessage() {}
+
+func (x *BatchEmbedContentsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[12]
+ 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 BatchEmbedContentsRequest.ProtoReflect.Descriptor instead.
+func (*BatchEmbedContentsRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{12}
+}
+
+func (x *BatchEmbedContentsRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *BatchEmbedContentsRequest) GetRequests() []*EmbedContentRequest {
+ if x != nil {
+ return x.Requests
+ }
+ return nil
+}
+
+// The response to a `BatchEmbedContentsRequest`.
+type BatchEmbedContentsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. The embeddings for each request, in the same order as provided
+ // in the batch request.
+ Embeddings []*ContentEmbedding `protobuf:"bytes,1,rep,name=embeddings,proto3" json:"embeddings,omitempty"`
+}
+
+func (x *BatchEmbedContentsResponse) Reset() {
+ *x = BatchEmbedContentsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[13]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchEmbedContentsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchEmbedContentsResponse) ProtoMessage() {}
+
+func (x *BatchEmbedContentsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[13]
+ 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 BatchEmbedContentsResponse.ProtoReflect.Descriptor instead.
+func (*BatchEmbedContentsResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *BatchEmbedContentsResponse) GetEmbeddings() []*ContentEmbedding {
+ if x != nil {
+ return x.Embeddings
+ }
+ return nil
+}
+
+// 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 CountTokensRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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}`
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // Optional. The input given to the model as a prompt.
+ Contents []*Content `protobuf:"bytes,2,rep,name=contents,proto3" json:"contents,omitempty"`
+ // Optional. The overall input given to the model. CountTokens will count
+ // prompt, function calling, etc.
+ GenerateContentRequest *GenerateContentRequest `protobuf:"bytes,3,opt,name=generate_content_request,json=generateContentRequest,proto3" json:"generate_content_request,omitempty"`
+}
+
+func (x *CountTokensRequest) Reset() {
+ *x = CountTokensRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[14]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CountTokensRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CountTokensRequest) ProtoMessage() {}
+
+func (x *CountTokensRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[14]
+ 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 CountTokensRequest.ProtoReflect.Descriptor instead.
+func (*CountTokensRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{14}
+}
+
+func (x *CountTokensRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *CountTokensRequest) GetContents() []*Content {
+ if x != nil {
+ return x.Contents
+ }
+ return nil
+}
+
+func (x *CountTokensRequest) GetGenerateContentRequest() *GenerateContentRequest {
+ if x != nil {
+ return x.GenerateContentRequest
+ }
+ return nil
+}
+
+// A response from `CountTokens`.
+//
+// It returns the model's `token_count` for the `prompt`.
+type CountTokensResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The number of tokens that the `model` tokenizes the `prompt` into.
+ //
+ // Always non-negative.
+ TotalTokens int32 `protobuf:"varint,1,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"`
+}
+
+func (x *CountTokensResponse) Reset() {
+ *x = CountTokensResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[15]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CountTokensResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CountTokensResponse) ProtoMessage() {}
+
+func (x *CountTokensResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[15]
+ 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 CountTokensResponse.ProtoReflect.Descriptor instead.
+func (*CountTokensResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{15}
+}
+
+func (x *CountTokensResponse) GetTotalTokens() int32 {
+ if x != nil {
+ return x.TotalTokens
+ }
+ return 0
+}
+
+// A set of the feedback metadata the prompt specified in
+// `GenerateContentRequest.content`.
+type GenerateContentResponse_PromptFeedback struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. If set, the prompt was blocked and no candidates are returned.
+ // Rephrase your prompt.
+ BlockReason GenerateContentResponse_PromptFeedback_BlockReason `protobuf:"varint,1,opt,name=block_reason,json=blockReason,proto3,enum=google.ai.generativelanguage.v1beta.GenerateContentResponse_PromptFeedback_BlockReason" json:"block_reason,omitempty"`
+ // Ratings for safety of the prompt.
+ // There is at most one rating per category.
+ SafetyRatings []*SafetyRating `protobuf:"bytes,2,rep,name=safety_ratings,json=safetyRatings,proto3" json:"safety_ratings,omitempty"`
+}
+
+func (x *GenerateContentResponse_PromptFeedback) Reset() {
+ *x = GenerateContentResponse_PromptFeedback{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[16]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateContentResponse_PromptFeedback) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateContentResponse_PromptFeedback) ProtoMessage() {}
+
+func (x *GenerateContentResponse_PromptFeedback) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[16]
+ 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 GenerateContentResponse_PromptFeedback.ProtoReflect.Descriptor instead.
+func (*GenerateContentResponse_PromptFeedback) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{3, 0}
+}
+
+func (x *GenerateContentResponse_PromptFeedback) GetBlockReason() GenerateContentResponse_PromptFeedback_BlockReason {
+ if x != nil {
+ return x.BlockReason
+ }
+ return GenerateContentResponse_PromptFeedback_BLOCK_REASON_UNSPECIFIED
+}
+
+func (x *GenerateContentResponse_PromptFeedback) GetSafetyRatings() []*SafetyRating {
+ if x != nil {
+ return x.SafetyRatings
+ }
+ return nil
+}
+
+// Metadata on the generation request's token usage.
+type GenerateContentResponse_UsageMetadata struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Number of tokens in the prompt.
+ PromptTokenCount int32 `protobuf:"varint,1,opt,name=prompt_token_count,json=promptTokenCount,proto3" json:"prompt_token_count,omitempty"`
+ // Total number of tokens across the generated candidates.
+ CandidatesTokenCount int32 `protobuf:"varint,2,opt,name=candidates_token_count,json=candidatesTokenCount,proto3" json:"candidates_token_count,omitempty"`
+ // Total token count for the generation request (prompt + candidates).
+ TotalTokenCount int32 `protobuf:"varint,3,opt,name=total_token_count,json=totalTokenCount,proto3" json:"total_token_count,omitempty"`
+}
+
+func (x *GenerateContentResponse_UsageMetadata) Reset() {
+ *x = GenerateContentResponse_UsageMetadata{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[17]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateContentResponse_UsageMetadata) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateContentResponse_UsageMetadata) ProtoMessage() {}
+
+func (x *GenerateContentResponse_UsageMetadata) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[17]
+ 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 GenerateContentResponse_UsageMetadata.ProtoReflect.Descriptor instead.
+func (*GenerateContentResponse_UsageMetadata) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{3, 1}
+}
+
+func (x *GenerateContentResponse_UsageMetadata) GetPromptTokenCount() int32 {
+ if x != nil {
+ return x.PromptTokenCount
+ }
+ return 0
+}
+
+func (x *GenerateContentResponse_UsageMetadata) GetCandidatesTokenCount() int32 {
+ if x != nil {
+ return x.CandidatesTokenCount
+ }
+ return 0
+}
+
+func (x *GenerateContentResponse_UsageMetadata) GetTotalTokenCount() int32 {
+ if x != nil {
+ return x.TotalTokenCount
+ }
+ return 0
+}
+
+// Identifier for a part within a `GroundingPassage`.
+type AttributionSourceId_GroundingPassageId struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. ID of the passage matching the `GenerateAnswerRequest`'s
+ // `GroundingPassage.id`.
+ PassageId string `protobuf:"bytes,1,opt,name=passage_id,json=passageId,proto3" json:"passage_id,omitempty"`
+ // Output only. Index of the part within the `GenerateAnswerRequest`'s
+ // `GroundingPassage.content`.
+ PartIndex int32 `protobuf:"varint,2,opt,name=part_index,json=partIndex,proto3" json:"part_index,omitempty"`
+}
+
+func (x *AttributionSourceId_GroundingPassageId) Reset() {
+ *x = AttributionSourceId_GroundingPassageId{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[18]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *AttributionSourceId_GroundingPassageId) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AttributionSourceId_GroundingPassageId) ProtoMessage() {}
+
+func (x *AttributionSourceId_GroundingPassageId) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[18]
+ 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 AttributionSourceId_GroundingPassageId.ProtoReflect.Descriptor instead.
+func (*AttributionSourceId_GroundingPassageId) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{5, 0}
+}
+
+func (x *AttributionSourceId_GroundingPassageId) GetPassageId() string {
+ if x != nil {
+ return x.PassageId
+ }
+ return ""
+}
+
+func (x *AttributionSourceId_GroundingPassageId) GetPartIndex() int32 {
+ if x != nil {
+ return x.PartIndex
+ }
+ return 0
+}
+
+// Identifier for a `Chunk` retrieved via Semantic Retriever specified in the
+// `GenerateAnswerRequest` using `SemanticRetrieverConfig`.
+type AttributionSourceId_SemanticRetrieverChunk struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. Name of the source matching the request's
+ // `SemanticRetrieverConfig.source`. Example: `corpora/123` or
+ // `corpora/123/documents/abc`
+ Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
+ // Output only. Name of the `Chunk` containing the attributed text.
+ // Example: `corpora/123/documents/abc/chunks/xyz`
+ Chunk string `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"`
+}
+
+func (x *AttributionSourceId_SemanticRetrieverChunk) Reset() {
+ *x = AttributionSourceId_SemanticRetrieverChunk{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[19]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *AttributionSourceId_SemanticRetrieverChunk) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AttributionSourceId_SemanticRetrieverChunk) ProtoMessage() {}
+
+func (x *AttributionSourceId_SemanticRetrieverChunk) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[19]
+ 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 AttributionSourceId_SemanticRetrieverChunk.ProtoReflect.Descriptor instead.
+func (*AttributionSourceId_SemanticRetrieverChunk) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{5, 1}
+}
+
+func (x *AttributionSourceId_SemanticRetrieverChunk) GetSource() string {
+ if x != nil {
+ return x.Source
+ }
+ return ""
+}
+
+func (x *AttributionSourceId_SemanticRetrieverChunk) GetChunk() string {
+ if x != nil {
+ return x.Chunk
+ }
+ return ""
+}
+
+// Feedback related to the input data used to answer the question, as opposed
+// to model-generated response to the question.
+type GenerateAnswerResponse_InputFeedback struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Optional. If set, the input was blocked and no candidates are returned.
+ // Rephrase your input.
+ BlockReason *GenerateAnswerResponse_InputFeedback_BlockReason `protobuf:"varint,1,opt,name=block_reason,json=blockReason,proto3,enum=google.ai.generativelanguage.v1beta.GenerateAnswerResponse_InputFeedback_BlockReason,oneof" json:"block_reason,omitempty"`
+ // Ratings for safety of the input.
+ // There is at most one rating per category.
+ SafetyRatings []*SafetyRating `protobuf:"bytes,2,rep,name=safety_ratings,json=safetyRatings,proto3" json:"safety_ratings,omitempty"`
+}
+
+func (x *GenerateAnswerResponse_InputFeedback) Reset() {
+ *x = GenerateAnswerResponse_InputFeedback{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[20]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateAnswerResponse_InputFeedback) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateAnswerResponse_InputFeedback) ProtoMessage() {}
+
+func (x *GenerateAnswerResponse_InputFeedback) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[20]
+ 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 GenerateAnswerResponse_InputFeedback.ProtoReflect.Descriptor instead.
+func (*GenerateAnswerResponse_InputFeedback) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP(), []int{8, 0}
+}
+
+func (x *GenerateAnswerResponse_InputFeedback) GetBlockReason() GenerateAnswerResponse_InputFeedback_BlockReason {
+ if x != nil && x.BlockReason != nil {
+ return *x.BlockReason
+ }
+ return GenerateAnswerResponse_InputFeedback_BLOCK_REASON_UNSPECIFIED
+}
+
+func (x *GenerateAnswerResponse_InputFeedback) GetSafetyRatings() []*SafetyRating {
+ if x != nil {
+ return x.SafetyRatings
+ }
+ return nil
+}
+
+var File_google_ai_generativelanguage_v1beta_generative_service_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDesc = []byte{
+ 0x0a, 0x3c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x1a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f,
+ 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+ 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2f, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
+ 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+ 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76,
+ 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x05, 0x0a, 0x16, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f,
+ 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52,
+ 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x65, 0x0a, 0x12, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d,
+ 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x11, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49,
+ 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a,
+ 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
+ 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x44, 0x0a, 0x05,
+ 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x74, 0x6f, 0x6f,
+ 0x6c, 0x73, 0x12, 0x55, 0x0a, 0x0b, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x6f,
+ 0x6f, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x74,
+ 0x6f, 0x6f, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x60, 0x0a, 0x0f, 0x73, 0x61, 0x66,
+ 0x65, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x53,
+ 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x73, 0x61, 0x66,
+ 0x65, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x6c, 0x0a, 0x11, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x03, 0xe0,
+ 0x41, 0x01, 0x48, 0x01, 0x52, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x73, 0x79,
+ 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xed, 0x03, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x31, 0x0a, 0x0f, 0x63,
+ 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x61, 0x6e,
+ 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x2a,
+ 0x0a, 0x0e, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73,
+ 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x73, 0x74, 0x6f,
+ 0x70, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x11, 0x6d, 0x61,
+ 0x78, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18,
+ 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x0f, 0x6d, 0x61,
+ 0x78, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x88, 0x01, 0x01,
+ 0x12, 0x2a, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x0b, 0x74, 0x65,
+ 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05,
+ 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x48, 0x03, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x50, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05, 0x74,
+ 0x6f, 0x70, 0x5f, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48,
+ 0x04, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4b, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x72, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65,
+ 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x72, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a,
+ 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61,
+ 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x63, 0x68,
+ 0x65, 0x6d, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x61, 0x6e,
+ 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x14, 0x0a, 0x12,
+ 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x42, 0x08, 0x0a, 0x06,
+ 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x6b, 0x22, 0x8b, 0x03, 0x0a, 0x17, 0x53, 0x65, 0x6d, 0x61, 0x6e,
+ 0x74, 0x69, 0x63, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
+ 0x47, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41,
+ 0x02, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x63, 0x0a, 0x10, 0x6d, 0x65, 0x74, 0x61,
+ 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+ 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6d, 0x65,
+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x32, 0x0a,
+ 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
+ 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x0e,
+ 0x6d, 0x61, 0x78, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01,
+ 0x01, 0x12, 0x40, 0x0a, 0x17, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c,
+ 0x65, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x15, 0x6d, 0x69, 0x6e, 0x69, 0x6d,
+ 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x63, 0x6f, 0x72, 0x65,
+ 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x68, 0x75, 0x6e,
+ 0x6b, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x6d, 0x69, 0x6e,
+ 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x73,
+ 0x63, 0x6f, 0x72, 0x65, 0x22, 0xab, 0x06, 0x0a, 0x17, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x12, 0x4e, 0x0a, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x61, 0x6e, 0x64, 0x69,
+ 0x64, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73,
+ 0x12, 0x74, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x62,
+ 0x61, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x46, 0x65,
+ 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x46, 0x65,
+ 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x76, 0x0a, 0x0e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f,
+ 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4a,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x55, 0x73, 0x61,
+ 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,
+ 0x0d, 0x75, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0xaf,
+ 0x02, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63,
+ 0x6b, 0x12, 0x7f, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f,
+ 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x57, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x46, 0x65, 0x65, 0x64,
+ 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e,
+ 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x73,
+ 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x5f, 0x72, 0x61, 0x74,
+ 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73,
+ 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x42, 0x0a, 0x0b,
+ 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x18, 0x42,
+ 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x41, 0x46,
+ 0x45, 0x54, 0x59, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x10, 0x02,
+ 0x1a, 0x9f, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
+ 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x5f, 0x74, 0x6f, 0x6b,
+ 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10,
+ 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74,
+ 0x12, 0x34, 0x0a, 0x16, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x5f, 0x74,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
+ 0x52, 0x14, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x54, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f,
+ 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x05, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x6f, 0x75,
+ 0x6e, 0x74, 0x22, 0xbc, 0x05, 0x0a, 0x09, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65,
+ 0x12, 0x1e, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x88, 0x01, 0x01,
+ 0x12, 0x4b, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x68, 0x0a,
+ 0x0d, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x61, 0x6e, 0x64, 0x69,
+ 0x64, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x61, 0x73, 0x6f,
+ 0x6e, 0x42, 0x06, 0xe0, 0x41, 0x01, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x66, 0x69, 0x6e, 0x69, 0x73,
+ 0x68, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x61, 0x66, 0x65, 0x74,
+ 0x79, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32,
+ 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69,
+ 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67,
+ 0x73, 0x12, 0x67, 0x0a, 0x11, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65,
+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x43, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64,
+ 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x10, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x0b, 0x74, 0x6f,
+ 0x6b, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74,
+ 0x12, 0x75, 0x0a, 0x16, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b,
+ 0x32, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03,
+ 0x52, 0x15, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6e, 0x0a, 0x0c, 0x46, 0x69, 0x6e, 0x69, 0x73,
+ 0x68, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x19, 0x46, 0x49, 0x4e, 0x49, 0x53,
+ 0x48, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01,
+ 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x41, 0x58, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x02,
+ 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x41, 0x46, 0x45, 0x54, 0x59, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a,
+ 0x52, 0x45, 0x43, 0x49, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05,
+ 0x4f, 0x54, 0x48, 0x45, 0x52, 0x10, 0x05, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x22, 0xd9, 0x03, 0x0a, 0x13, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f,
+ 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x7a, 0x0a, 0x11, 0x67, 0x72, 0x6f,
+ 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x2e, 0x47,
+ 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49,
+ 0x64, 0x48, 0x00, 0x52, 0x10, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61,
+ 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x8b, 0x01, 0x0a, 0x18, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74,
+ 0x69, 0x63, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x75,
+ 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x4f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x41,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x49, 0x64, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x74, 0x72, 0x69,
+ 0x65, 0x76, 0x65, 0x72, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x16, 0x73, 0x65, 0x6d,
+ 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x43, 0x68,
+ 0x75, 0x6e, 0x6b, 0x1a, 0x5c, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67,
+ 0x50, 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x03, 0x52, 0x09, 0x70, 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x22, 0x0a,
+ 0x0a, 0x70, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65,
+ 0x78, 0x1a, 0x50, 0x0a, 0x16, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x74,
+ 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x1b, 0x0a, 0x06, 0x73,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03,
+ 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e,
+ 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x63, 0x68,
+ 0x75, 0x6e, 0x6b, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xba, 0x01,
+ 0x0a, 0x14, 0x47, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5a, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x49, 0x64, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x49, 0x64, 0x12, 0x46, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0xfc, 0x05, 0x0a, 0x15, 0x47,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x61, 0x0a, 0x0f, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x70,
+ 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x73,
+ 0x73, 0x61, 0x67, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50,
+ 0x61, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x6d, 0x0a, 0x12, 0x73, 0x65, 0x6d, 0x61, 0x6e,
+ 0x74, 0x69, 0x63, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x18, 0x07, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74,
+ 0x69, 0x63, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x48, 0x00, 0x52, 0x11, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x65, 0x74,
+ 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x4d, 0x0a,
+ 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
+ 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x6e, 0x0a, 0x0c,
+ 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x46, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41,
+ 0x6e, 0x73, 0x77, 0x65, 0x72, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x0b, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x60, 0x0a, 0x0f,
+ 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18,
+ 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x61, 0x66, 0x65,
+ 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e,
+ 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2a,
+ 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20,
+ 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x0b, 0x74, 0x65, 0x6d, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x22, 0x59, 0x0a, 0x0b, 0x41, 0x6e,
+ 0x73, 0x77, 0x65, 0x72, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x41, 0x4e, 0x53,
+ 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x42, 0x53, 0x54, 0x52,
+ 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x54, 0x52,
+ 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x56, 0x45, 0x52, 0x42,
+ 0x4f, 0x53, 0x45, 0x10, 0x03, 0x42, 0x12, 0x0a, 0x10, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x69,
+ 0x6e, 0x67, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x65,
+ 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x91, 0x05, 0x0a, 0x16, 0x47, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x61, 0x6e, 0x64, 0x69,
+ 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x16,
+ 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x61,
+ 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41,
+ 0x03, 0x48, 0x00, 0x52, 0x15, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x50,
+ 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x7a, 0x0a,
+ 0x0e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x01, 0x52, 0x0d, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x65,
+ 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x88, 0x01, 0x01, 0x1a, 0xc3, 0x02, 0x0a, 0x0d, 0x49, 0x6e,
+ 0x70, 0x75, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x82, 0x01, 0x0a, 0x0c,
+ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x55, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e,
+ 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x42, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00,
+ 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x88, 0x01, 0x01,
+ 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6e,
+ 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53,
+ 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x61, 0x66,
+ 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x42, 0x0a, 0x0b, 0x42, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x18, 0x42, 0x4c, 0x4f,
+ 0x43, 0x4b, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x41, 0x46, 0x45, 0x54,
+ 0x59, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x10, 0x02, 0x42, 0x0f,
+ 0x0a, 0x0d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42,
+ 0x19, 0x0a, 0x17, 0x5f, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70,
+ 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x69,
+ 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x22, 0x90, 0x03,
+ 0x0a, 0x13, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x4b, 0x0a, 0x07,
+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02,
+ 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x54, 0x0a, 0x09, 0x74, 0x61, 0x73,
+ 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x48, 0x00, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12,
+ 0x1e, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
+ 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12,
+ 0x3d, 0x0a, 0x15, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73,
+ 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03,
+ 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x14, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x44, 0x69, 0x6d,
+ 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x42, 0x0c,
+ 0x0a, 0x0a, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x08, 0x0a, 0x06,
+ 0x5f, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75,
+ 0x74, 0x5f, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79,
+ 0x22, 0x2a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64,
+ 0x64, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01,
+ 0x20, 0x03, 0x28, 0x02, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x70, 0x0a, 0x14,
+ 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e,
+ 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x03,
+ 0xe0, 0x41, 0x03, 0x52, 0x09, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x22, 0xbd,
+ 0x01, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x05,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02,
+ 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x12, 0x59, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18,
+ 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x6d, 0x62, 0x65,
+ 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x78,
+ 0x0a, 0x1a, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0a,
+ 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
+ 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6d,
+ 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x65, 0x6d,
+ 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x12, 0x43, 0x6f, 0x75,
+ 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f,
+ 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52,
+ 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x4d, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43,
+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x7a, 0x0a, 0x18, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x16, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x22, 0x38, 0x0a, 0x13, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61,
+ 0x6c, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b,
+ 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2a, 0xbe, 0x01, 0x0a, 0x08,
+ 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x54, 0x41, 0x53, 0x4b,
+ 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
+ 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x54, 0x52, 0x49, 0x45, 0x56, 0x41, 0x4c,
+ 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x54, 0x52,
+ 0x49, 0x45, 0x56, 0x41, 0x4c, 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02,
+ 0x12, 0x17, 0x0a, 0x13, 0x53, 0x45, 0x4d, 0x41, 0x4e, 0x54, 0x49, 0x43, 0x5f, 0x53, 0x49, 0x4d,
+ 0x49, 0x4c, 0x41, 0x52, 0x49, 0x54, 0x59, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x4c, 0x41,
+ 0x53, 0x53, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x0e, 0x0a,
+ 0x0a, 0x43, 0x4c, 0x55, 0x53, 0x54, 0x45, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x16, 0x0a,
+ 0x12, 0x51, 0x55, 0x45, 0x53, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x4e, 0x53, 0x57, 0x45, 0x52,
+ 0x49, 0x4e, 0x47, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x41, 0x43, 0x54, 0x5f, 0x56, 0x45,
+ 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x07, 0x32, 0x81, 0x0b, 0x0a,
+ 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
+ 0x63, 0x65, 0x12, 0x86, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43,
+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x22, 0x78, 0xda, 0x41, 0x0e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x61, 0x3a, 0x01, 0x2a, 0x5a, 0x32, 0x3a,
+ 0x01, 0x2a, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x3d, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0xeb, 0x01, 0x0a, 0x0e,
+ 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x3a,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x73,
+ 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0xda, 0x41, 0x2b, 0x6d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x73, 0x61, 0x66, 0x65, 0x74,
+ 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2c, 0x61, 0x6e, 0x73, 0x77, 0x65,
+ 0x72, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x01, 0x2a,
+ 0x22, 0x27, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0xe0, 0x01, 0x0a, 0x15, 0x53, 0x74,
+ 0x72, 0x65, 0x61, 0x6d, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43,
+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a,
+ 0xda, 0x41, 0x0e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x47, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0xc5, 0x01, 0x0a,
+ 0x0c, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x6d,
+ 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x40, 0xda, 0x41, 0x0d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x12, 0xde, 0x01, 0x0a, 0x12, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d,
+ 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0xda, 0x41,
+ 0x0e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a, 0x01, 0x2a, 0x22, 0x2b, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f,
+ 0x2a, 0x7d, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0xc2, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0xda, 0x41, 0x0e, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x1a, 0x24, 0xca, 0x41, 0x21, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x42, 0xa2, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x16, 0x47, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50,
+ 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62,
+ 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescData = file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
+var file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
+var file_google_ai_generativelanguage_v1beta_generative_service_proto_goTypes = []interface{}{
+ (TaskType)(0), // 0: google.ai.generativelanguage.v1beta.TaskType
+ (GenerateContentResponse_PromptFeedback_BlockReason)(0), // 1: google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.BlockReason
+ (Candidate_FinishReason)(0), // 2: google.ai.generativelanguage.v1beta.Candidate.FinishReason
+ (GenerateAnswerRequest_AnswerStyle)(0), // 3: google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle
+ (GenerateAnswerResponse_InputFeedback_BlockReason)(0), // 4: google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.BlockReason
+ (*GenerateContentRequest)(nil), // 5: google.ai.generativelanguage.v1beta.GenerateContentRequest
+ (*GenerationConfig)(nil), // 6: google.ai.generativelanguage.v1beta.GenerationConfig
+ (*SemanticRetrieverConfig)(nil), // 7: google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
+ (*GenerateContentResponse)(nil), // 8: google.ai.generativelanguage.v1beta.GenerateContentResponse
+ (*Candidate)(nil), // 9: google.ai.generativelanguage.v1beta.Candidate
+ (*AttributionSourceId)(nil), // 10: google.ai.generativelanguage.v1beta.AttributionSourceId
+ (*GroundingAttribution)(nil), // 11: google.ai.generativelanguage.v1beta.GroundingAttribution
+ (*GenerateAnswerRequest)(nil), // 12: google.ai.generativelanguage.v1beta.GenerateAnswerRequest
+ (*GenerateAnswerResponse)(nil), // 13: google.ai.generativelanguage.v1beta.GenerateAnswerResponse
+ (*EmbedContentRequest)(nil), // 14: google.ai.generativelanguage.v1beta.EmbedContentRequest
+ (*ContentEmbedding)(nil), // 15: google.ai.generativelanguage.v1beta.ContentEmbedding
+ (*EmbedContentResponse)(nil), // 16: google.ai.generativelanguage.v1beta.EmbedContentResponse
+ (*BatchEmbedContentsRequest)(nil), // 17: google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
+ (*BatchEmbedContentsResponse)(nil), // 18: google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
+ (*CountTokensRequest)(nil), // 19: google.ai.generativelanguage.v1beta.CountTokensRequest
+ (*CountTokensResponse)(nil), // 20: google.ai.generativelanguage.v1beta.CountTokensResponse
+ (*GenerateContentResponse_PromptFeedback)(nil), // 21: google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
+ (*GenerateContentResponse_UsageMetadata)(nil), // 22: google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
+ (*AttributionSourceId_GroundingPassageId)(nil), // 23: google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
+ (*AttributionSourceId_SemanticRetrieverChunk)(nil), // 24: google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
+ (*GenerateAnswerResponse_InputFeedback)(nil), // 25: google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
+ (*Content)(nil), // 26: google.ai.generativelanguage.v1beta.Content
+ (*Tool)(nil), // 27: google.ai.generativelanguage.v1beta.Tool
+ (*ToolConfig)(nil), // 28: google.ai.generativelanguage.v1beta.ToolConfig
+ (*SafetySetting)(nil), // 29: google.ai.generativelanguage.v1beta.SafetySetting
+ (*Schema)(nil), // 30: google.ai.generativelanguage.v1beta.Schema
+ (*MetadataFilter)(nil), // 31: google.ai.generativelanguage.v1beta.MetadataFilter
+ (*SafetyRating)(nil), // 32: google.ai.generativelanguage.v1beta.SafetyRating
+ (*CitationMetadata)(nil), // 33: google.ai.generativelanguage.v1beta.CitationMetadata
+ (*GroundingPassages)(nil), // 34: google.ai.generativelanguage.v1beta.GroundingPassages
+}
+var file_google_ai_generativelanguage_v1beta_generative_service_proto_depIdxs = []int32{
+ 26, // 0: google.ai.generativelanguage.v1beta.GenerateContentRequest.system_instruction:type_name -> google.ai.generativelanguage.v1beta.Content
+ 26, // 1: google.ai.generativelanguage.v1beta.GenerateContentRequest.contents:type_name -> google.ai.generativelanguage.v1beta.Content
+ 27, // 2: google.ai.generativelanguage.v1beta.GenerateContentRequest.tools:type_name -> google.ai.generativelanguage.v1beta.Tool
+ 28, // 3: google.ai.generativelanguage.v1beta.GenerateContentRequest.tool_config:type_name -> google.ai.generativelanguage.v1beta.ToolConfig
+ 29, // 4: google.ai.generativelanguage.v1beta.GenerateContentRequest.safety_settings:type_name -> google.ai.generativelanguage.v1beta.SafetySetting
+ 6, // 5: google.ai.generativelanguage.v1beta.GenerateContentRequest.generation_config:type_name -> google.ai.generativelanguage.v1beta.GenerationConfig
+ 30, // 6: google.ai.generativelanguage.v1beta.GenerationConfig.response_schema:type_name -> google.ai.generativelanguage.v1beta.Schema
+ 26, // 7: google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.query:type_name -> google.ai.generativelanguage.v1beta.Content
+ 31, // 8: google.ai.generativelanguage.v1beta.SemanticRetrieverConfig.metadata_filters:type_name -> google.ai.generativelanguage.v1beta.MetadataFilter
+ 9, // 9: google.ai.generativelanguage.v1beta.GenerateContentResponse.candidates:type_name -> google.ai.generativelanguage.v1beta.Candidate
+ 21, // 10: google.ai.generativelanguage.v1beta.GenerateContentResponse.prompt_feedback:type_name -> google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback
+ 22, // 11: google.ai.generativelanguage.v1beta.GenerateContentResponse.usage_metadata:type_name -> google.ai.generativelanguage.v1beta.GenerateContentResponse.UsageMetadata
+ 26, // 12: google.ai.generativelanguage.v1beta.Candidate.content:type_name -> google.ai.generativelanguage.v1beta.Content
+ 2, // 13: google.ai.generativelanguage.v1beta.Candidate.finish_reason:type_name -> google.ai.generativelanguage.v1beta.Candidate.FinishReason
+ 32, // 14: google.ai.generativelanguage.v1beta.Candidate.safety_ratings:type_name -> google.ai.generativelanguage.v1beta.SafetyRating
+ 33, // 15: google.ai.generativelanguage.v1beta.Candidate.citation_metadata:type_name -> google.ai.generativelanguage.v1beta.CitationMetadata
+ 11, // 16: google.ai.generativelanguage.v1beta.Candidate.grounding_attributions:type_name -> google.ai.generativelanguage.v1beta.GroundingAttribution
+ 23, // 17: google.ai.generativelanguage.v1beta.AttributionSourceId.grounding_passage:type_name -> google.ai.generativelanguage.v1beta.AttributionSourceId.GroundingPassageId
+ 24, // 18: google.ai.generativelanguage.v1beta.AttributionSourceId.semantic_retriever_chunk:type_name -> google.ai.generativelanguage.v1beta.AttributionSourceId.SemanticRetrieverChunk
+ 10, // 19: google.ai.generativelanguage.v1beta.GroundingAttribution.source_id:type_name -> google.ai.generativelanguage.v1beta.AttributionSourceId
+ 26, // 20: google.ai.generativelanguage.v1beta.GroundingAttribution.content:type_name -> google.ai.generativelanguage.v1beta.Content
+ 34, // 21: google.ai.generativelanguage.v1beta.GenerateAnswerRequest.inline_passages:type_name -> google.ai.generativelanguage.v1beta.GroundingPassages
+ 7, // 22: google.ai.generativelanguage.v1beta.GenerateAnswerRequest.semantic_retriever:type_name -> google.ai.generativelanguage.v1beta.SemanticRetrieverConfig
+ 26, // 23: google.ai.generativelanguage.v1beta.GenerateAnswerRequest.contents:type_name -> google.ai.generativelanguage.v1beta.Content
+ 3, // 24: google.ai.generativelanguage.v1beta.GenerateAnswerRequest.answer_style:type_name -> google.ai.generativelanguage.v1beta.GenerateAnswerRequest.AnswerStyle
+ 29, // 25: google.ai.generativelanguage.v1beta.GenerateAnswerRequest.safety_settings:type_name -> google.ai.generativelanguage.v1beta.SafetySetting
+ 9, // 26: google.ai.generativelanguage.v1beta.GenerateAnswerResponse.answer:type_name -> google.ai.generativelanguage.v1beta.Candidate
+ 25, // 27: google.ai.generativelanguage.v1beta.GenerateAnswerResponse.input_feedback:type_name -> google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback
+ 26, // 28: google.ai.generativelanguage.v1beta.EmbedContentRequest.content:type_name -> google.ai.generativelanguage.v1beta.Content
+ 0, // 29: google.ai.generativelanguage.v1beta.EmbedContentRequest.task_type:type_name -> google.ai.generativelanguage.v1beta.TaskType
+ 15, // 30: google.ai.generativelanguage.v1beta.EmbedContentResponse.embedding:type_name -> google.ai.generativelanguage.v1beta.ContentEmbedding
+ 14, // 31: google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest.requests:type_name -> google.ai.generativelanguage.v1beta.EmbedContentRequest
+ 15, // 32: google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse.embeddings:type_name -> google.ai.generativelanguage.v1beta.ContentEmbedding
+ 26, // 33: google.ai.generativelanguage.v1beta.CountTokensRequest.contents:type_name -> google.ai.generativelanguage.v1beta.Content
+ 5, // 34: google.ai.generativelanguage.v1beta.CountTokensRequest.generate_content_request:type_name -> google.ai.generativelanguage.v1beta.GenerateContentRequest
+ 1, // 35: google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.block_reason:type_name -> google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.BlockReason
+ 32, // 36: google.ai.generativelanguage.v1beta.GenerateContentResponse.PromptFeedback.safety_ratings:type_name -> google.ai.generativelanguage.v1beta.SafetyRating
+ 4, // 37: google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.block_reason:type_name -> google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.BlockReason
+ 32, // 38: google.ai.generativelanguage.v1beta.GenerateAnswerResponse.InputFeedback.safety_ratings:type_name -> google.ai.generativelanguage.v1beta.SafetyRating
+ 5, // 39: google.ai.generativelanguage.v1beta.GenerativeService.GenerateContent:input_type -> google.ai.generativelanguage.v1beta.GenerateContentRequest
+ 12, // 40: google.ai.generativelanguage.v1beta.GenerativeService.GenerateAnswer:input_type -> google.ai.generativelanguage.v1beta.GenerateAnswerRequest
+ 5, // 41: google.ai.generativelanguage.v1beta.GenerativeService.StreamGenerateContent:input_type -> google.ai.generativelanguage.v1beta.GenerateContentRequest
+ 14, // 42: google.ai.generativelanguage.v1beta.GenerativeService.EmbedContent:input_type -> google.ai.generativelanguage.v1beta.EmbedContentRequest
+ 17, // 43: google.ai.generativelanguage.v1beta.GenerativeService.BatchEmbedContents:input_type -> google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest
+ 19, // 44: google.ai.generativelanguage.v1beta.GenerativeService.CountTokens:input_type -> google.ai.generativelanguage.v1beta.CountTokensRequest
+ 8, // 45: google.ai.generativelanguage.v1beta.GenerativeService.GenerateContent:output_type -> google.ai.generativelanguage.v1beta.GenerateContentResponse
+ 13, // 46: google.ai.generativelanguage.v1beta.GenerativeService.GenerateAnswer:output_type -> google.ai.generativelanguage.v1beta.GenerateAnswerResponse
+ 8, // 47: google.ai.generativelanguage.v1beta.GenerativeService.StreamGenerateContent:output_type -> google.ai.generativelanguage.v1beta.GenerateContentResponse
+ 16, // 48: google.ai.generativelanguage.v1beta.GenerativeService.EmbedContent:output_type -> google.ai.generativelanguage.v1beta.EmbedContentResponse
+ 18, // 49: google.ai.generativelanguage.v1beta.GenerativeService.BatchEmbedContents:output_type -> google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse
+ 20, // 50: google.ai.generativelanguage.v1beta.GenerativeService.CountTokens:output_type -> google.ai.generativelanguage.v1beta.CountTokensResponse
+ 45, // [45:51] is the sub-list for method output_type
+ 39, // [39:45] is the sub-list for method input_type
+ 39, // [39:39] is the sub-list for extension type_name
+ 39, // [39:39] is the sub-list for extension extendee
+ 0, // [0:39] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_generative_service_proto_init() }
+func file_google_ai_generativelanguage_v1beta_generative_service_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_generative_service_proto != nil {
+ return
+ }
+ file_google_ai_generativelanguage_v1beta_citation_proto_init()
+ file_google_ai_generativelanguage_v1beta_content_proto_init()
+ file_google_ai_generativelanguage_v1beta_retriever_proto_init()
+ file_google_ai_generativelanguage_v1beta_safety_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateContentRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerationConfig); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SemanticRetrieverConfig); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateContentResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Candidate); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*AttributionSourceId); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GroundingAttribution); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateAnswerRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateAnswerResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*EmbedContentRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ContentEmbedding); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*EmbedContentResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchEmbedContentsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchEmbedContentsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CountTokensRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CountTokensResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateContentResponse_PromptFeedback); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateContentResponse_UsageMetadata); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*AttributionSourceId_GroundingPassageId); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*AttributionSourceId_SemanticRetrieverChunk); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateAnswerResponse_InputFeedback); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[0].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[1].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[2].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[4].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[5].OneofWrappers = []interface{}{
+ (*AttributionSourceId_GroundingPassage)(nil),
+ (*AttributionSourceId_SemanticRetrieverChunk_)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[7].OneofWrappers = []interface{}{
+ (*GenerateAnswerRequest_InlinePassages)(nil),
+ (*GenerateAnswerRequest_SemanticRetriever)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[8].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[9].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes[20].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDesc,
+ NumEnums: 5,
+ NumMessages: 21,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_generative_service_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_generative_service_proto_depIdxs,
+ EnumInfos: file_google_ai_generativelanguage_v1beta_generative_service_proto_enumTypes,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_generative_service_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_generative_service_proto = out.File
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_generative_service_proto_depIdxs = nil
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConnInterface
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion6
+
+// GenerativeServiceClient is the client API for GenerativeService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type GenerativeServiceClient interface {
+ // 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.
+ GenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (*GenerateContentResponse, error)
+ // Generates a grounded answer from the model given an input
+ // `GenerateAnswerRequest`.
+ GenerateAnswer(ctx context.Context, in *GenerateAnswerRequest, opts ...grpc.CallOption) (*GenerateAnswerResponse, error)
+ // Generates a streamed response from the model given an input
+ // `GenerateContentRequest`.
+ StreamGenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (GenerativeService_StreamGenerateContentClient, error)
+ // Generates an embedding from the model given an input `Content`.
+ EmbedContent(ctx context.Context, in *EmbedContentRequest, opts ...grpc.CallOption) (*EmbedContentResponse, error)
+ // Generates multiple embeddings from the model given input text in a
+ // synchronous call.
+ BatchEmbedContents(ctx context.Context, in *BatchEmbedContentsRequest, opts ...grpc.CallOption) (*BatchEmbedContentsResponse, error)
+ // Runs a model's tokenizer on input content and returns the token count.
+ CountTokens(ctx context.Context, in *CountTokensRequest, opts ...grpc.CallOption) (*CountTokensResponse, error)
+}
+
+type generativeServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewGenerativeServiceClient(cc grpc.ClientConnInterface) GenerativeServiceClient {
+ return &generativeServiceClient{cc}
+}
+
+func (c *generativeServiceClient) GenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (*GenerateContentResponse, error) {
+ out := new(GenerateContentResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.GenerativeService/GenerateContent", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *generativeServiceClient) GenerateAnswer(ctx context.Context, in *GenerateAnswerRequest, opts ...grpc.CallOption) (*GenerateAnswerResponse, error) {
+ out := new(GenerateAnswerResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.GenerativeService/GenerateAnswer", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *generativeServiceClient) StreamGenerateContent(ctx context.Context, in *GenerateContentRequest, opts ...grpc.CallOption) (GenerativeService_StreamGenerateContentClient, error) {
+ stream, err := c.cc.NewStream(ctx, &_GenerativeService_serviceDesc.Streams[0], "/google.ai.generativelanguage.v1beta.GenerativeService/StreamGenerateContent", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &generativeServiceStreamGenerateContentClient{stream}
+ if err := x.ClientStream.SendMsg(in); err != nil {
+ return nil, err
+ }
+ if err := x.ClientStream.CloseSend(); err != nil {
+ return nil, err
+ }
+ return x, nil
+}
+
+type GenerativeService_StreamGenerateContentClient interface {
+ Recv() (*GenerateContentResponse, error)
+ grpc.ClientStream
+}
+
+type generativeServiceStreamGenerateContentClient struct {
+ grpc.ClientStream
+}
+
+func (x *generativeServiceStreamGenerateContentClient) Recv() (*GenerateContentResponse, error) {
+ m := new(GenerateContentResponse)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
+func (c *generativeServiceClient) EmbedContent(ctx context.Context, in *EmbedContentRequest, opts ...grpc.CallOption) (*EmbedContentResponse, error) {
+ out := new(EmbedContentResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.GenerativeService/EmbedContent", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *generativeServiceClient) BatchEmbedContents(ctx context.Context, in *BatchEmbedContentsRequest, opts ...grpc.CallOption) (*BatchEmbedContentsResponse, error) {
+ out := new(BatchEmbedContentsResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.GenerativeService/BatchEmbedContents", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *generativeServiceClient) CountTokens(ctx context.Context, in *CountTokensRequest, opts ...grpc.CallOption) (*CountTokensResponse, error) {
+ out := new(CountTokensResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.GenerativeService/CountTokens", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// GenerativeServiceServer is the server API for GenerativeService service.
+type GenerativeServiceServer interface {
+ // 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.
+ GenerateContent(context.Context, *GenerateContentRequest) (*GenerateContentResponse, error)
+ // Generates a grounded answer from the model given an input
+ // `GenerateAnswerRequest`.
+ GenerateAnswer(context.Context, *GenerateAnswerRequest) (*GenerateAnswerResponse, error)
+ // Generates a streamed response from the model given an input
+ // `GenerateContentRequest`.
+ StreamGenerateContent(*GenerateContentRequest, GenerativeService_StreamGenerateContentServer) error
+ // Generates an embedding from the model given an input `Content`.
+ EmbedContent(context.Context, *EmbedContentRequest) (*EmbedContentResponse, error)
+ // Generates multiple embeddings from the model given input text in a
+ // synchronous call.
+ BatchEmbedContents(context.Context, *BatchEmbedContentsRequest) (*BatchEmbedContentsResponse, error)
+ // Runs a model's tokenizer on input content and returns the token count.
+ CountTokens(context.Context, *CountTokensRequest) (*CountTokensResponse, error)
+}
+
+// UnimplementedGenerativeServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedGenerativeServiceServer struct {
+}
+
+func (*UnimplementedGenerativeServiceServer) GenerateContent(context.Context, *GenerateContentRequest) (*GenerateContentResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GenerateContent not implemented")
+}
+func (*UnimplementedGenerativeServiceServer) GenerateAnswer(context.Context, *GenerateAnswerRequest) (*GenerateAnswerResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GenerateAnswer not implemented")
+}
+func (*UnimplementedGenerativeServiceServer) StreamGenerateContent(*GenerateContentRequest, GenerativeService_StreamGenerateContentServer) error {
+ return status.Errorf(codes.Unimplemented, "method StreamGenerateContent not implemented")
+}
+func (*UnimplementedGenerativeServiceServer) EmbedContent(context.Context, *EmbedContentRequest) (*EmbedContentResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method EmbedContent not implemented")
+}
+func (*UnimplementedGenerativeServiceServer) BatchEmbedContents(context.Context, *BatchEmbedContentsRequest) (*BatchEmbedContentsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method BatchEmbedContents not implemented")
+}
+func (*UnimplementedGenerativeServiceServer) CountTokens(context.Context, *CountTokensRequest) (*CountTokensResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CountTokens not implemented")
+}
+
+func RegisterGenerativeServiceServer(s *grpc.Server, srv GenerativeServiceServer) {
+ s.RegisterService(&_GenerativeService_serviceDesc, srv)
+}
+
+func _GenerativeService_GenerateContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GenerateContentRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(GenerativeServiceServer).GenerateContent(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.GenerativeService/GenerateContent",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(GenerativeServiceServer).GenerateContent(ctx, req.(*GenerateContentRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _GenerativeService_GenerateAnswer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GenerateAnswerRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(GenerativeServiceServer).GenerateAnswer(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.GenerativeService/GenerateAnswer",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(GenerativeServiceServer).GenerateAnswer(ctx, req.(*GenerateAnswerRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _GenerativeService_StreamGenerateContent_Handler(srv interface{}, stream grpc.ServerStream) error {
+ m := new(GenerateContentRequest)
+ if err := stream.RecvMsg(m); err != nil {
+ return err
+ }
+ return srv.(GenerativeServiceServer).StreamGenerateContent(m, &generativeServiceStreamGenerateContentServer{stream})
+}
+
+type GenerativeService_StreamGenerateContentServer interface {
+ Send(*GenerateContentResponse) error
+ grpc.ServerStream
+}
+
+type generativeServiceStreamGenerateContentServer struct {
+ grpc.ServerStream
+}
+
+func (x *generativeServiceStreamGenerateContentServer) Send(m *GenerateContentResponse) error {
+ return x.ServerStream.SendMsg(m)
+}
+
+func _GenerativeService_EmbedContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(EmbedContentRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(GenerativeServiceServer).EmbedContent(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.GenerativeService/EmbedContent",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(GenerativeServiceServer).EmbedContent(ctx, req.(*EmbedContentRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _GenerativeService_BatchEmbedContents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(BatchEmbedContentsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(GenerativeServiceServer).BatchEmbedContents(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.GenerativeService/BatchEmbedContents",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(GenerativeServiceServer).BatchEmbedContents(ctx, req.(*BatchEmbedContentsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _GenerativeService_CountTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CountTokensRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(GenerativeServiceServer).CountTokens(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.GenerativeService/CountTokens",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(GenerativeServiceServer).CountTokens(ctx, req.(*CountTokensRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _GenerativeService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "google.ai.generativelanguage.v1beta.GenerativeService",
+ HandlerType: (*GenerativeServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "GenerateContent",
+ Handler: _GenerativeService_GenerateContent_Handler,
+ },
+ {
+ MethodName: "GenerateAnswer",
+ Handler: _GenerativeService_GenerateAnswer_Handler,
+ },
+ {
+ MethodName: "EmbedContent",
+ Handler: _GenerativeService_EmbedContent_Handler,
+ },
+ {
+ MethodName: "BatchEmbedContents",
+ Handler: _GenerativeService_BatchEmbedContents_Handler,
+ },
+ {
+ MethodName: "CountTokens",
+ Handler: _GenerativeService_CountTokens_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{
+ {
+ StreamName: "StreamGenerateContent",
+ Handler: _GenerativeService_StreamGenerateContent_Handler,
+ ServerStreams: true,
+ },
+ },
+ Metadata: "google/ai/generativelanguage/v1beta/generative_service.proto",
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model.pb.go
new file mode 100644
index 000000000..7d623204c
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model.pb.go
@@ -0,0 +1,334 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/model.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Information about a Generative Language Model.
+type Model struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Required. The name of the base model, pass this to the generation request.
+ //
+ // Examples:
+ //
+ // * `chat-bison`
+ BaseModelId string `protobuf:"bytes,2,opt,name=base_model_id,json=baseModelId,proto3" json:"base_model_id,omitempty"`
+ // Required. The version number of the model.
+ //
+ // This represents the major version
+ Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
+ // 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.
+ DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
+ // A short description of the model.
+ Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
+ // Maximum number of input tokens allowed for this model.
+ InputTokenLimit int32 `protobuf:"varint,6,opt,name=input_token_limit,json=inputTokenLimit,proto3" json:"input_token_limit,omitempty"`
+ // Maximum number of output tokens available for this model.
+ OutputTokenLimit int32 `protobuf:"varint,7,opt,name=output_token_limit,json=outputTokenLimit,proto3" json:"output_token_limit,omitempty"`
+ // The model's supported generation methods.
+ //
+ // The method names are defined as Pascal case
+ // strings, such as `generateMessage` which correspond to API methods.
+ SupportedGenerationMethods []string `protobuf:"bytes,8,rep,name=supported_generation_methods,json=supportedGenerationMethods,proto3" json:"supported_generation_methods,omitempty"`
+ // 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.
+ Temperature *float32 `protobuf:"fixed32,9,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"`
+ // 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.
+ TopP *float32 `protobuf:"fixed32,10,opt,name=top_p,json=topP,proto3,oneof" json:"top_p,omitempty"`
+ // 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.
+ TopK *int32 `protobuf:"varint,11,opt,name=top_k,json=topK,proto3,oneof" json:"top_k,omitempty"`
+}
+
+func (x *Model) Reset() {
+ *x = Model{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Model) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Model) ProtoMessage() {}
+
+func (x *Model) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_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 Model.ProtoReflect.Descriptor instead.
+func (*Model) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Model) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Model) GetBaseModelId() string {
+ if x != nil {
+ return x.BaseModelId
+ }
+ return ""
+}
+
+func (x *Model) GetVersion() string {
+ if x != nil {
+ return x.Version
+ }
+ return ""
+}
+
+func (x *Model) GetDisplayName() string {
+ if x != nil {
+ return x.DisplayName
+ }
+ return ""
+}
+
+func (x *Model) GetDescription() string {
+ if x != nil {
+ return x.Description
+ }
+ return ""
+}
+
+func (x *Model) GetInputTokenLimit() int32 {
+ if x != nil {
+ return x.InputTokenLimit
+ }
+ return 0
+}
+
+func (x *Model) GetOutputTokenLimit() int32 {
+ if x != nil {
+ return x.OutputTokenLimit
+ }
+ return 0
+}
+
+func (x *Model) GetSupportedGenerationMethods() []string {
+ if x != nil {
+ return x.SupportedGenerationMethods
+ }
+ return nil
+}
+
+func (x *Model) GetTemperature() float32 {
+ if x != nil && x.Temperature != nil {
+ return *x.Temperature
+ }
+ return 0
+}
+
+func (x *Model) GetTopP() float32 {
+ if x != nil && x.TopP != nil {
+ return *x.TopP
+ }
+ return 0
+}
+
+func (x *Model) GetTopK() int32 {
+ if x != nil && x.TopK != nil {
+ return *x.TopK
+ }
+ return 0
+}
+
+var File_google_ai_generativelanguage_v1beta_model_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_model_proto_rawDesc = []byte{
+ 0x0a, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
+ 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f,
+ 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x22, 0x86, 0x04, 0x0a, 0x05, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
+ 0x02, 0x52, 0x0b, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x1d,
+ 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a,
+ 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65,
+ 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
+ 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x69,
+ 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2c,
+ 0x0a, 0x12, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c,
+ 0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x70,
+ 0x75, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x40, 0x0a, 0x1c,
+ 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x08, 0x20, 0x03,
+ 0x28, 0x09, 0x52, 0x1a, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x47, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x25,
+ 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x09, 0x20,
+ 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x18, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x18, 0x0a,
+ 0x20, 0x01, 0x28, 0x02, 0x48, 0x01, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x50, 0x88, 0x01, 0x01, 0x12,
+ 0x18, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x5f, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02,
+ 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4b, 0x88, 0x01, 0x01, 0x3a, 0x3c, 0xea, 0x41, 0x39, 0x0a, 0x27,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x0e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f,
+ 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x7d, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x65, 0x6d, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f,
+ 0x70, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x6b, 0x42, 0x96, 0x01, 0x0a, 0x27,
+ 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x0a, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x72,
+ 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_model_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_model_proto_rawDescData = file_google_ai_generativelanguage_v1beta_model_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_model_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_model_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_model_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_model_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_model_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_google_ai_generativelanguage_v1beta_model_proto_goTypes = []interface{}{
+ (*Model)(nil), // 0: google.ai.generativelanguage.v1beta.Model
+}
+var file_google_ai_generativelanguage_v1beta_model_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
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_model_proto_init() }
+func file_google_ai_generativelanguage_v1beta_model_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_model_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Model); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_proto_msgTypes[0].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_model_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 1,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_model_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_model_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_model_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_model_proto = out.File
+ file_google_ai_generativelanguage_v1beta_model_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_model_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_model_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model_service.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model_service.pb.go
new file mode 100644
index 000000000..fd15aa07d
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/model_service.pb.go
@@ -0,0 +1,1435 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/model_service.proto
+
+package generativelanguagepb
+
+import (
+ context "context"
+ reflect "reflect"
+ sync "sync"
+
+ longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Request for getting information about a specific Model.
+type GetModelRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the model.
+ //
+ // This name should match a model name returned by the `ListModels` method.
+ //
+ // Format: `models/{model}`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetModelRequest) Reset() {
+ *x = GetModelRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetModelRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetModelRequest) ProtoMessage() {}
+
+func (x *GetModelRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_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 GetModelRequest.ProtoReflect.Descriptor instead.
+func (*GetModelRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GetModelRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request for listing all Models.
+type ListModelsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // 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.
+ PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *ListModelsRequest) Reset() {
+ *x = ListModelsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListModelsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListModelsRequest) ProtoMessage() {}
+
+func (x *ListModelsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[1]
+ 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 ListModelsRequest.ProtoReflect.Descriptor instead.
+func (*ListModelsRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *ListModelsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListModelsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+// Response from `ListModel` containing a paginated list of Models.
+type ListModelsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The returned Models.
+ Models []*Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ //
+ // If this field is omitted, there are no more pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListModelsResponse) Reset() {
+ *x = ListModelsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListModelsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListModelsResponse) ProtoMessage() {}
+
+func (x *ListModelsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[2]
+ 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 ListModelsResponse.ProtoReflect.Descriptor instead.
+func (*ListModelsResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ListModelsResponse) GetModels() []*Model {
+ if x != nil {
+ return x.Models
+ }
+ return nil
+}
+
+func (x *ListModelsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+// Request for getting information about a specific Model.
+type GetTunedModelRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the model.
+ //
+ // Format: `tunedModels/my-model-id`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetTunedModelRequest) Reset() {
+ *x = GetTunedModelRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetTunedModelRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetTunedModelRequest) ProtoMessage() {}
+
+func (x *GetTunedModelRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[3]
+ 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 GetTunedModelRequest.ProtoReflect.Descriptor instead.
+func (*GetTunedModelRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *GetTunedModelRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request for listing TunedModels.
+type ListTunedModelsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // 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.
+ PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+ // 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
+ Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
+}
+
+func (x *ListTunedModelsRequest) Reset() {
+ *x = ListTunedModelsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListTunedModelsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListTunedModelsRequest) ProtoMessage() {}
+
+func (x *ListTunedModelsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[4]
+ 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 ListTunedModelsRequest.ProtoReflect.Descriptor instead.
+func (*ListTunedModelsRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *ListTunedModelsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListTunedModelsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+func (x *ListTunedModelsRequest) GetFilter() string {
+ if x != nil {
+ return x.Filter
+ }
+ return ""
+}
+
+// Response from `ListTunedModels` containing a paginated list of Models.
+type ListTunedModelsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The returned Models.
+ TunedModels []*TunedModel `protobuf:"bytes,1,rep,name=tuned_models,json=tunedModels,proto3" json:"tuned_models,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ //
+ // If this field is omitted, there are no more pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListTunedModelsResponse) Reset() {
+ *x = ListTunedModelsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListTunedModelsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListTunedModelsResponse) ProtoMessage() {}
+
+func (x *ListTunedModelsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[5]
+ 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 ListTunedModelsResponse.ProtoReflect.Descriptor instead.
+func (*ListTunedModelsResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *ListTunedModelsResponse) GetTunedModels() []*TunedModel {
+ if x != nil {
+ return x.TunedModels
+ }
+ return nil
+}
+
+func (x *ListTunedModelsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+// Request to create a TunedModel.
+type CreateTunedModelRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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])?.
+ TunedModelId *string `protobuf:"bytes,1,opt,name=tuned_model_id,json=tunedModelId,proto3,oneof" json:"tuned_model_id,omitempty"`
+ // Required. The tuned model to create.
+ TunedModel *TunedModel `protobuf:"bytes,2,opt,name=tuned_model,json=tunedModel,proto3" json:"tuned_model,omitempty"`
+}
+
+func (x *CreateTunedModelRequest) Reset() {
+ *x = CreateTunedModelRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateTunedModelRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateTunedModelRequest) ProtoMessage() {}
+
+func (x *CreateTunedModelRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[6]
+ 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 CreateTunedModelRequest.ProtoReflect.Descriptor instead.
+func (*CreateTunedModelRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *CreateTunedModelRequest) GetTunedModelId() string {
+ if x != nil && x.TunedModelId != nil {
+ return *x.TunedModelId
+ }
+ return ""
+}
+
+func (x *CreateTunedModelRequest) GetTunedModel() *TunedModel {
+ if x != nil {
+ return x.TunedModel
+ }
+ return nil
+}
+
+// Metadata about the state and progress of creating a tuned model returned from
+// the long-running operation
+type CreateTunedModelMetadata struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Name of the tuned model associated with the tuning operation.
+ TunedModel string `protobuf:"bytes,5,opt,name=tuned_model,json=tunedModel,proto3" json:"tuned_model,omitempty"`
+ // The total number of tuning steps.
+ TotalSteps int32 `protobuf:"varint,1,opt,name=total_steps,json=totalSteps,proto3" json:"total_steps,omitempty"`
+ // The number of steps completed.
+ CompletedSteps int32 `protobuf:"varint,2,opt,name=completed_steps,json=completedSteps,proto3" json:"completed_steps,omitempty"`
+ // The completed percentage for the tuning operation.
+ CompletedPercent float32 `protobuf:"fixed32,3,opt,name=completed_percent,json=completedPercent,proto3" json:"completed_percent,omitempty"`
+ // Metrics collected during tuning.
+ Snapshots []*TuningSnapshot `protobuf:"bytes,4,rep,name=snapshots,proto3" json:"snapshots,omitempty"`
+}
+
+func (x *CreateTunedModelMetadata) Reset() {
+ *x = CreateTunedModelMetadata{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateTunedModelMetadata) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateTunedModelMetadata) ProtoMessage() {}
+
+func (x *CreateTunedModelMetadata) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[7]
+ 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 CreateTunedModelMetadata.ProtoReflect.Descriptor instead.
+func (*CreateTunedModelMetadata) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *CreateTunedModelMetadata) GetTunedModel() string {
+ if x != nil {
+ return x.TunedModel
+ }
+ return ""
+}
+
+func (x *CreateTunedModelMetadata) GetTotalSteps() int32 {
+ if x != nil {
+ return x.TotalSteps
+ }
+ return 0
+}
+
+func (x *CreateTunedModelMetadata) GetCompletedSteps() int32 {
+ if x != nil {
+ return x.CompletedSteps
+ }
+ return 0
+}
+
+func (x *CreateTunedModelMetadata) GetCompletedPercent() float32 {
+ if x != nil {
+ return x.CompletedPercent
+ }
+ return 0
+}
+
+func (x *CreateTunedModelMetadata) GetSnapshots() []*TuningSnapshot {
+ if x != nil {
+ return x.Snapshots
+ }
+ return nil
+}
+
+// Request to update a TunedModel.
+type UpdateTunedModelRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The tuned model to update.
+ TunedModel *TunedModel `protobuf:"bytes,1,opt,name=tuned_model,json=tunedModel,proto3" json:"tuned_model,omitempty"`
+ // Required. The list of fields to update.
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateTunedModelRequest) Reset() {
+ *x = UpdateTunedModelRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateTunedModelRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateTunedModelRequest) ProtoMessage() {}
+
+func (x *UpdateTunedModelRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[8]
+ 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 UpdateTunedModelRequest.ProtoReflect.Descriptor instead.
+func (*UpdateTunedModelRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *UpdateTunedModelRequest) GetTunedModel() *TunedModel {
+ if x != nil {
+ return x.TunedModel
+ }
+ return nil
+}
+
+func (x *UpdateTunedModelRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+// Request to delete a TunedModel.
+type DeleteTunedModelRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the model.
+ // Format: `tunedModels/my-model-id`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *DeleteTunedModelRequest) Reset() {
+ *x = DeleteTunedModelRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteTunedModelRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteTunedModelRequest) ProtoMessage() {}
+
+func (x *DeleteTunedModelRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[9]
+ 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 DeleteTunedModelRequest.ProtoReflect.Descriptor instead.
+func (*DeleteTunedModelRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *DeleteTunedModelRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+var File_google_ai_generativelanguage_v1beta_model_service_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_model_service_proto_rawDesc = []byte{
+ 0x0a, 0x37, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76,
+ 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x2f,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+ 0x35, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2f, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
+ 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69,
+ 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
+ 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x6c, 0x6f, 0x6e, 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2f, 0x6f, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
+ 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65,
+ 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a,
+ 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x12, 0x43, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f,
+ 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4f, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61,
+ 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70,
+ 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f,
+ 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67,
+ 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a,
+ 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74,
+ 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x60, 0x0a, 0x14, 0x47, 0x65, 0x74,
+ 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x48, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x34, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2e, 0x0a, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x7b, 0x0a, 0x16, 0x4c,
+ 0x69, 0x73, 0x74, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69,
+ 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70,
+ 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f,
+ 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x95, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73,
+ 0x74, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0c, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x0b, 0x74, 0x75, 0x6e,
+ 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74,
+ 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x22, 0xb3, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x0e,
+ 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x75, 0x6e,
+ 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x55, 0x0a, 0x0b,
+ 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x22, 0xb8, 0x02, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64,
+ 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x0b, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xfa, 0x41, 0x2e, 0x0a, 0x2c, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x0a, 0x74, 0x75, 0x6e,
+ 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c,
+ 0x5f, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f,
+ 0x74, 0x61, 0x6c, 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70,
+ 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x05, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x53, 0x74, 0x65, 0x70,
+ 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x70,
+ 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x10, 0x63, 0x6f,
+ 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x51,
+ 0x0a, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6e,
+ 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74,
+ 0x73, 0x22, 0xb2, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65,
+ 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a,
+ 0x0b, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
+ 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c,
+ 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x63, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x48, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x34, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2e, 0x0a, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xcd, 0x0a, 0x0a, 0x0c,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x94, 0x01, 0x0a,
+ 0x08, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x26, 0xda, 0x41, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x12, 0xac, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x73, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x14, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a,
+ 0x65, 0x2c, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x73, 0x12, 0xa8, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x75,
+ 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x22, 0x2b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12,
+ 0x1c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74,
+ 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xc0, 0x01,
+ 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x73, 0x12, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x75, 0x6e, 0x65,
+ 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41,
+ 0x14, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x2c, 0x70, 0x61, 0x67, 0x65, 0x5f,
+ 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2f, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
+ 0x12, 0xed, 0x01, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x6e,
+ 0x67, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x22, 0x7c, 0xca, 0x41, 0x26, 0x0a, 0x0a, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x12, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xda, 0x41, 0x0b,
+ 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0xda, 0x41, 0x1a, 0x74, 0x75,
+ 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x2c, 0x74, 0x75, 0x6e,
+ 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x0b,
+ 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x13, 0x2f, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2f, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
+ 0x12, 0xda, 0x01, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x57, 0xda, 0x41, 0x17, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x3a, 0x0b, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x32, 0x28, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x74, 0x75,
+ 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74,
+ 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x95, 0x01,
+ 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54,
+ 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2b, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d,
+ 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x2a, 0x1c, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x1a, 0x24, 0xca, 0x41, 0x21, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0x9d, 0x01, 0x0a, 0x27,
+ 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x11, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65,
+ 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c,
+ 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67,
+ 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescData = file_google_ai_generativelanguage_v1beta_model_service_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_model_service_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
+var file_google_ai_generativelanguage_v1beta_model_service_proto_goTypes = []interface{}{
+ (*GetModelRequest)(nil), // 0: google.ai.generativelanguage.v1beta.GetModelRequest
+ (*ListModelsRequest)(nil), // 1: google.ai.generativelanguage.v1beta.ListModelsRequest
+ (*ListModelsResponse)(nil), // 2: google.ai.generativelanguage.v1beta.ListModelsResponse
+ (*GetTunedModelRequest)(nil), // 3: google.ai.generativelanguage.v1beta.GetTunedModelRequest
+ (*ListTunedModelsRequest)(nil), // 4: google.ai.generativelanguage.v1beta.ListTunedModelsRequest
+ (*ListTunedModelsResponse)(nil), // 5: google.ai.generativelanguage.v1beta.ListTunedModelsResponse
+ (*CreateTunedModelRequest)(nil), // 6: google.ai.generativelanguage.v1beta.CreateTunedModelRequest
+ (*CreateTunedModelMetadata)(nil), // 7: google.ai.generativelanguage.v1beta.CreateTunedModelMetadata
+ (*UpdateTunedModelRequest)(nil), // 8: google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
+ (*DeleteTunedModelRequest)(nil), // 9: google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
+ (*Model)(nil), // 10: google.ai.generativelanguage.v1beta.Model
+ (*TunedModel)(nil), // 11: google.ai.generativelanguage.v1beta.TunedModel
+ (*TuningSnapshot)(nil), // 12: google.ai.generativelanguage.v1beta.TuningSnapshot
+ (*fieldmaskpb.FieldMask)(nil), // 13: google.protobuf.FieldMask
+ (*longrunningpb.Operation)(nil), // 14: google.longrunning.Operation
+ (*emptypb.Empty)(nil), // 15: google.protobuf.Empty
+}
+var file_google_ai_generativelanguage_v1beta_model_service_proto_depIdxs = []int32{
+ 10, // 0: google.ai.generativelanguage.v1beta.ListModelsResponse.models:type_name -> google.ai.generativelanguage.v1beta.Model
+ 11, // 1: google.ai.generativelanguage.v1beta.ListTunedModelsResponse.tuned_models:type_name -> google.ai.generativelanguage.v1beta.TunedModel
+ 11, // 2: google.ai.generativelanguage.v1beta.CreateTunedModelRequest.tuned_model:type_name -> google.ai.generativelanguage.v1beta.TunedModel
+ 12, // 3: google.ai.generativelanguage.v1beta.CreateTunedModelMetadata.snapshots:type_name -> google.ai.generativelanguage.v1beta.TuningSnapshot
+ 11, // 4: google.ai.generativelanguage.v1beta.UpdateTunedModelRequest.tuned_model:type_name -> google.ai.generativelanguage.v1beta.TunedModel
+ 13, // 5: google.ai.generativelanguage.v1beta.UpdateTunedModelRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 0, // 6: google.ai.generativelanguage.v1beta.ModelService.GetModel:input_type -> google.ai.generativelanguage.v1beta.GetModelRequest
+ 1, // 7: google.ai.generativelanguage.v1beta.ModelService.ListModels:input_type -> google.ai.generativelanguage.v1beta.ListModelsRequest
+ 3, // 8: google.ai.generativelanguage.v1beta.ModelService.GetTunedModel:input_type -> google.ai.generativelanguage.v1beta.GetTunedModelRequest
+ 4, // 9: google.ai.generativelanguage.v1beta.ModelService.ListTunedModels:input_type -> google.ai.generativelanguage.v1beta.ListTunedModelsRequest
+ 6, // 10: google.ai.generativelanguage.v1beta.ModelService.CreateTunedModel:input_type -> google.ai.generativelanguage.v1beta.CreateTunedModelRequest
+ 8, // 11: google.ai.generativelanguage.v1beta.ModelService.UpdateTunedModel:input_type -> google.ai.generativelanguage.v1beta.UpdateTunedModelRequest
+ 9, // 12: google.ai.generativelanguage.v1beta.ModelService.DeleteTunedModel:input_type -> google.ai.generativelanguage.v1beta.DeleteTunedModelRequest
+ 10, // 13: google.ai.generativelanguage.v1beta.ModelService.GetModel:output_type -> google.ai.generativelanguage.v1beta.Model
+ 2, // 14: google.ai.generativelanguage.v1beta.ModelService.ListModels:output_type -> google.ai.generativelanguage.v1beta.ListModelsResponse
+ 11, // 15: google.ai.generativelanguage.v1beta.ModelService.GetTunedModel:output_type -> google.ai.generativelanguage.v1beta.TunedModel
+ 5, // 16: google.ai.generativelanguage.v1beta.ModelService.ListTunedModels:output_type -> google.ai.generativelanguage.v1beta.ListTunedModelsResponse
+ 14, // 17: google.ai.generativelanguage.v1beta.ModelService.CreateTunedModel:output_type -> google.longrunning.Operation
+ 11, // 18: google.ai.generativelanguage.v1beta.ModelService.UpdateTunedModel:output_type -> google.ai.generativelanguage.v1beta.TunedModel
+ 15, // 19: google.ai.generativelanguage.v1beta.ModelService.DeleteTunedModel:output_type -> google.protobuf.Empty
+ 13, // [13:20] is the sub-list for method output_type
+ 6, // [6:13] is the sub-list for method input_type
+ 6, // [6:6] is the sub-list for extension type_name
+ 6, // [6:6] is the sub-list for extension extendee
+ 0, // [0:6] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_model_service_proto_init() }
+func file_google_ai_generativelanguage_v1beta_model_service_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_model_service_proto != nil {
+ return
+ }
+ file_google_ai_generativelanguage_v1beta_model_proto_init()
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetModelRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListModelsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListModelsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetTunedModelRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListTunedModelsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListTunedModelsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateTunedModelRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateTunedModelMetadata); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateTunedModelRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteTunedModelRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes[6].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_model_service_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 10,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_model_service_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_model_service_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_model_service_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_model_service_proto = out.File
+ file_google_ai_generativelanguage_v1beta_model_service_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_model_service_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_model_service_proto_depIdxs = nil
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConnInterface
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion6
+
+// ModelServiceClient is the client API for ModelService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type ModelServiceClient interface {
+ // Gets information about a specific Model.
+ GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error)
+ // Lists models available through the API.
+ ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error)
+ // Gets information about a specific TunedModel.
+ GetTunedModel(ctx context.Context, in *GetTunedModelRequest, opts ...grpc.CallOption) (*TunedModel, error)
+ // Lists tuned models owned by the user.
+ ListTunedModels(ctx context.Context, in *ListTunedModelsRequest, opts ...grpc.CallOption) (*ListTunedModelsResponse, error)
+ // 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
+ CreateTunedModel(ctx context.Context, in *CreateTunedModelRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
+ // Updates a tuned model.
+ UpdateTunedModel(ctx context.Context, in *UpdateTunedModelRequest, opts ...grpc.CallOption) (*TunedModel, error)
+ // Deletes a tuned model.
+ DeleteTunedModel(ctx context.Context, in *DeleteTunedModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+}
+
+type modelServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewModelServiceClient(cc grpc.ClientConnInterface) ModelServiceClient {
+ return &modelServiceClient{cc}
+}
+
+func (c *modelServiceClient) GetModel(ctx context.Context, in *GetModelRequest, opts ...grpc.CallOption) (*Model, error) {
+ out := new(Model)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.ModelService/GetModel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *modelServiceClient) ListModels(ctx context.Context, in *ListModelsRequest, opts ...grpc.CallOption) (*ListModelsResponse, error) {
+ out := new(ListModelsResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.ModelService/ListModels", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *modelServiceClient) GetTunedModel(ctx context.Context, in *GetTunedModelRequest, opts ...grpc.CallOption) (*TunedModel, error) {
+ out := new(TunedModel)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.ModelService/GetTunedModel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *modelServiceClient) ListTunedModels(ctx context.Context, in *ListTunedModelsRequest, opts ...grpc.CallOption) (*ListTunedModelsResponse, error) {
+ out := new(ListTunedModelsResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.ModelService/ListTunedModels", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *modelServiceClient) CreateTunedModel(ctx context.Context, in *CreateTunedModelRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) {
+ out := new(longrunningpb.Operation)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.ModelService/CreateTunedModel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *modelServiceClient) UpdateTunedModel(ctx context.Context, in *UpdateTunedModelRequest, opts ...grpc.CallOption) (*TunedModel, error) {
+ out := new(TunedModel)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.ModelService/UpdateTunedModel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *modelServiceClient) DeleteTunedModel(ctx context.Context, in *DeleteTunedModelRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.ModelService/DeleteTunedModel", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// ModelServiceServer is the server API for ModelService service.
+type ModelServiceServer interface {
+ // Gets information about a specific Model.
+ GetModel(context.Context, *GetModelRequest) (*Model, error)
+ // Lists models available through the API.
+ ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error)
+ // Gets information about a specific TunedModel.
+ GetTunedModel(context.Context, *GetTunedModelRequest) (*TunedModel, error)
+ // Lists tuned models owned by the user.
+ ListTunedModels(context.Context, *ListTunedModelsRequest) (*ListTunedModelsResponse, error)
+ // 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
+ CreateTunedModel(context.Context, *CreateTunedModelRequest) (*longrunningpb.Operation, error)
+ // Updates a tuned model.
+ UpdateTunedModel(context.Context, *UpdateTunedModelRequest) (*TunedModel, error)
+ // Deletes a tuned model.
+ DeleteTunedModel(context.Context, *DeleteTunedModelRequest) (*emptypb.Empty, error)
+}
+
+// UnimplementedModelServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedModelServiceServer struct {
+}
+
+func (*UnimplementedModelServiceServer) GetModel(context.Context, *GetModelRequest) (*Model, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetModel not implemented")
+}
+func (*UnimplementedModelServiceServer) ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListModels not implemented")
+}
+func (*UnimplementedModelServiceServer) GetTunedModel(context.Context, *GetTunedModelRequest) (*TunedModel, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetTunedModel not implemented")
+}
+func (*UnimplementedModelServiceServer) ListTunedModels(context.Context, *ListTunedModelsRequest) (*ListTunedModelsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListTunedModels not implemented")
+}
+func (*UnimplementedModelServiceServer) CreateTunedModel(context.Context, *CreateTunedModelRequest) (*longrunningpb.Operation, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateTunedModel not implemented")
+}
+func (*UnimplementedModelServiceServer) UpdateTunedModel(context.Context, *UpdateTunedModelRequest) (*TunedModel, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateTunedModel not implemented")
+}
+func (*UnimplementedModelServiceServer) DeleteTunedModel(context.Context, *DeleteTunedModelRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteTunedModel not implemented")
+}
+
+func RegisterModelServiceServer(s *grpc.Server, srv ModelServiceServer) {
+ s.RegisterService(&_ModelService_serviceDesc, srv)
+}
+
+func _ModelService_GetModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetModelRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ModelServiceServer).GetModel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.ModelService/GetModel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ModelServiceServer).GetModel(ctx, req.(*GetModelRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ModelService_ListModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListModelsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ModelServiceServer).ListModels(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.ModelService/ListModels",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ModelServiceServer).ListModels(ctx, req.(*ListModelsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ModelService_GetTunedModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetTunedModelRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ModelServiceServer).GetTunedModel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.ModelService/GetTunedModel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ModelServiceServer).GetTunedModel(ctx, req.(*GetTunedModelRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ModelService_ListTunedModels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListTunedModelsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ModelServiceServer).ListTunedModels(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.ModelService/ListTunedModels",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ModelServiceServer).ListTunedModels(ctx, req.(*ListTunedModelsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ModelService_CreateTunedModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateTunedModelRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ModelServiceServer).CreateTunedModel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.ModelService/CreateTunedModel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ModelServiceServer).CreateTunedModel(ctx, req.(*CreateTunedModelRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ModelService_UpdateTunedModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateTunedModelRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ModelServiceServer).UpdateTunedModel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.ModelService/UpdateTunedModel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ModelServiceServer).UpdateTunedModel(ctx, req.(*UpdateTunedModelRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _ModelService_DeleteTunedModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteTunedModelRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ModelServiceServer).DeleteTunedModel(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.ModelService/DeleteTunedModel",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ModelServiceServer).DeleteTunedModel(ctx, req.(*DeleteTunedModelRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _ModelService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "google.ai.generativelanguage.v1beta.ModelService",
+ HandlerType: (*ModelServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "GetModel",
+ Handler: _ModelService_GetModel_Handler,
+ },
+ {
+ MethodName: "ListModels",
+ Handler: _ModelService_ListModels_Handler,
+ },
+ {
+ MethodName: "GetTunedModel",
+ Handler: _ModelService_GetTunedModel_Handler,
+ },
+ {
+ MethodName: "ListTunedModels",
+ Handler: _ModelService_ListTunedModels_Handler,
+ },
+ {
+ MethodName: "CreateTunedModel",
+ Handler: _ModelService_CreateTunedModel_Handler,
+ },
+ {
+ MethodName: "UpdateTunedModel",
+ Handler: _ModelService_UpdateTunedModel_Handler,
+ },
+ {
+ MethodName: "DeleteTunedModel",
+ Handler: _ModelService_DeleteTunedModel_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "google/ai/generativelanguage/v1beta/model_service.proto",
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission.pb.go
new file mode 100644
index 000000000..c8f02d46c
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission.pb.go
@@ -0,0 +1,385 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/permission.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Defines types of the grantee of this permission.
+type Permission_GranteeType int32
+
+const (
+ // The default value. This value is unused.
+ Permission_GRANTEE_TYPE_UNSPECIFIED Permission_GranteeType = 0
+ // Represents a user. When set, you must provide email_address for the user.
+ Permission_USER Permission_GranteeType = 1
+ // Represents a group. When set, you must provide email_address for the
+ // group.
+ Permission_GROUP Permission_GranteeType = 2
+ // Represents access to everyone. No extra information is required.
+ Permission_EVERYONE Permission_GranteeType = 3
+)
+
+// Enum value maps for Permission_GranteeType.
+var (
+ Permission_GranteeType_name = map[int32]string{
+ 0: "GRANTEE_TYPE_UNSPECIFIED",
+ 1: "USER",
+ 2: "GROUP",
+ 3: "EVERYONE",
+ }
+ Permission_GranteeType_value = map[string]int32{
+ "GRANTEE_TYPE_UNSPECIFIED": 0,
+ "USER": 1,
+ "GROUP": 2,
+ "EVERYONE": 3,
+ }
+)
+
+func (x Permission_GranteeType) Enum() *Permission_GranteeType {
+ p := new(Permission_GranteeType)
+ *p = x
+ return p
+}
+
+func (x Permission_GranteeType) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Permission_GranteeType) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_permission_proto_enumTypes[0].Descriptor()
+}
+
+func (Permission_GranteeType) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_permission_proto_enumTypes[0]
+}
+
+func (x Permission_GranteeType) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Permission_GranteeType.Descriptor instead.
+func (Permission_GranteeType) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_proto_rawDescGZIP(), []int{0, 0}
+}
+
+// Defines the role granted by this permission.
+type Permission_Role int32
+
+const (
+ // The default value. This value is unused.
+ Permission_ROLE_UNSPECIFIED Permission_Role = 0
+ // Owner can use, update, share and delete the resource.
+ Permission_OWNER Permission_Role = 1
+ // Writer can use, update and share the resource.
+ Permission_WRITER Permission_Role = 2
+ // Reader can use the resource.
+ Permission_READER Permission_Role = 3
+)
+
+// Enum value maps for Permission_Role.
+var (
+ Permission_Role_name = map[int32]string{
+ 0: "ROLE_UNSPECIFIED",
+ 1: "OWNER",
+ 2: "WRITER",
+ 3: "READER",
+ }
+ Permission_Role_value = map[string]int32{
+ "ROLE_UNSPECIFIED": 0,
+ "OWNER": 1,
+ "WRITER": 2,
+ "READER": 3,
+ }
+)
+
+func (x Permission_Role) Enum() *Permission_Role {
+ p := new(Permission_Role)
+ *p = x
+ return p
+}
+
+func (x Permission_Role) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Permission_Role) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_permission_proto_enumTypes[1].Descriptor()
+}
+
+func (Permission_Role) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_permission_proto_enumTypes[1]
+}
+
+func (x Permission_Role) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Permission_Role.Descriptor instead.
+func (Permission_Role) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_proto_rawDescGZIP(), []int{0, 1}
+}
+
+// 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 Permission struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Optional. Immutable. The type of the grantee.
+ GranteeType *Permission_GranteeType `protobuf:"varint,2,opt,name=grantee_type,json=granteeType,proto3,enum=google.ai.generativelanguage.v1beta.Permission_GranteeType,oneof" json:"grantee_type,omitempty"`
+ // 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.
+ EmailAddress *string `protobuf:"bytes,3,opt,name=email_address,json=emailAddress,proto3,oneof" json:"email_address,omitempty"`
+ // Required. The role granted by this permission.
+ Role *Permission_Role `protobuf:"varint,4,opt,name=role,proto3,enum=google.ai.generativelanguage.v1beta.Permission_Role,oneof" json:"role,omitempty"`
+}
+
+func (x *Permission) Reset() {
+ *x = Permission{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Permission) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Permission) ProtoMessage() {}
+
+func (x *Permission) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_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 Permission.ProtoReflect.Descriptor instead.
+func (*Permission) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Permission) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Permission) GetGranteeType() Permission_GranteeType {
+ if x != nil && x.GranteeType != nil {
+ return *x.GranteeType
+ }
+ return Permission_GRANTEE_TYPE_UNSPECIFIED
+}
+
+func (x *Permission) GetEmailAddress() string {
+ if x != nil && x.EmailAddress != nil {
+ return *x.EmailAddress
+ }
+ return ""
+}
+
+func (x *Permission) GetRole() Permission_Role {
+ if x != nil && x.Role != nil {
+ return *x.Role
+ }
+ return Permission_ROLE_UNSPECIFIED
+}
+
+var File_google_ai_generativelanguage_v1beta_permission_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_permission_proto_rawDesc = []byte{
+ 0x0a, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65,
+ 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x05, 0x0a, 0x0a, 0x50, 0x65, 0x72, 0x6d,
+ 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x03, 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x12, 0x6b, 0x0a, 0x0c, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x5f, 0x74, 0x79,
+ 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50,
+ 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65,
+ 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x06, 0xe0, 0x41, 0x01, 0xe0, 0x41, 0x05, 0x48, 0x00, 0x52,
+ 0x0b, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12,
+ 0x30, 0x0a, 0x0d, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x01, 0xe0, 0x41, 0x05, 0x48, 0x01,
+ 0x52, 0x0c, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01,
+ 0x01, 0x12, 0x52, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x48, 0x02, 0x52, 0x04, 0x72, 0x6f,
+ 0x6c, 0x65, 0x88, 0x01, 0x01, 0x22, 0x4e, 0x0a, 0x0b, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65,
+ 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x47, 0x52, 0x41, 0x4e, 0x54, 0x45, 0x45, 0x5f,
+ 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
+ 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05,
+ 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x56, 0x45, 0x52, 0x59,
+ 0x4f, 0x4e, 0x45, 0x10, 0x03, 0x22, 0x3f, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a,
+ 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
+ 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a,
+ 0x0a, 0x06, 0x57, 0x52, 0x49, 0x54, 0x45, 0x52, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45,
+ 0x41, 0x44, 0x45, 0x52, 0x10, 0x03, 0x3a, 0xaa, 0x01, 0xea, 0x41, 0xa6, 0x01, 0x0a, 0x2c, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x74, 0x75, 0x6e,
+ 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f,
+ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x7d, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
+ 0x6e, 0x73, 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x12,
+ 0x29, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x7b, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73,
+ 0x7d, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x70,
+ 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x2a, 0x0b, 0x70, 0x65, 0x72, 0x6d,
+ 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61,
+ 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x42,
+ 0x9b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x0f, 0x50, 0x65, 0x72,
+ 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d,
+ 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_permission_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_permission_proto_rawDescData = file_google_ai_generativelanguage_v1beta_permission_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_permission_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_permission_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_permission_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_permission_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_permission_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_permission_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_google_ai_generativelanguage_v1beta_permission_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_google_ai_generativelanguage_v1beta_permission_proto_goTypes = []interface{}{
+ (Permission_GranteeType)(0), // 0: google.ai.generativelanguage.v1beta.Permission.GranteeType
+ (Permission_Role)(0), // 1: google.ai.generativelanguage.v1beta.Permission.Role
+ (*Permission)(nil), // 2: google.ai.generativelanguage.v1beta.Permission
+}
+var file_google_ai_generativelanguage_v1beta_permission_proto_depIdxs = []int32{
+ 0, // 0: google.ai.generativelanguage.v1beta.Permission.grantee_type:type_name -> google.ai.generativelanguage.v1beta.Permission.GranteeType
+ 1, // 1: google.ai.generativelanguage.v1beta.Permission.role:type_name -> google.ai.generativelanguage.v1beta.Permission.Role
+ 2, // [2:2] is the sub-list for method output_type
+ 2, // [2:2] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_permission_proto_init() }
+func file_google_ai_generativelanguage_v1beta_permission_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_permission_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_permission_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Permission); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_proto_msgTypes[0].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_permission_proto_rawDesc,
+ NumEnums: 2,
+ NumMessages: 1,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_permission_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_permission_proto_depIdxs,
+ EnumInfos: file_google_ai_generativelanguage_v1beta_permission_proto_enumTypes,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_permission_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_permission_proto = out.File
+ file_google_ai_generativelanguage_v1beta_permission_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_permission_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_permission_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission_service.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission_service.pb.go
new file mode 100644
index 000000000..95ffe7400
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/permission_service.pb.go
@@ -0,0 +1,1162 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/permission_service.proto
+
+package generativelanguagepb
+
+import (
+ context "context"
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Request to create a `Permission`.
+type CreatePermissionRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The parent resource of the `Permission`.
+ // Formats:
+ //
+ // `tunedModels/{tuned_model}`
+ // `corpora/{corpus}`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // Required. The permission to create.
+ Permission *Permission `protobuf:"bytes,2,opt,name=permission,proto3" json:"permission,omitempty"`
+}
+
+func (x *CreatePermissionRequest) Reset() {
+ *x = CreatePermissionRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreatePermissionRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreatePermissionRequest) ProtoMessage() {}
+
+func (x *CreatePermissionRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_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 CreatePermissionRequest.ProtoReflect.Descriptor instead.
+func (*CreatePermissionRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CreatePermissionRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *CreatePermissionRequest) GetPermission() *Permission {
+ if x != nil {
+ return x.Permission
+ }
+ return nil
+}
+
+// Request for getting information about a specific `Permission`.
+type GetPermissionRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the permission.
+ //
+ // Formats:
+ //
+ // `tunedModels/{tuned_model}/permissions/{permission}`
+ // `corpora/{corpus}/permissions/{permission}`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetPermissionRequest) Reset() {
+ *x = GetPermissionRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetPermissionRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetPermissionRequest) ProtoMessage() {}
+
+func (x *GetPermissionRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[1]
+ 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 GetPermissionRequest.ProtoReflect.Descriptor instead.
+func (*GetPermissionRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GetPermissionRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request for listing permissions.
+type ListPermissionsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The parent resource of the permissions.
+ // Formats:
+ //
+ // `tunedModels/{tuned_model}`
+ // `corpora/{corpus}`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // 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.
+ PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // 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.
+ PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *ListPermissionsRequest) Reset() {
+ *x = ListPermissionsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListPermissionsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListPermissionsRequest) ProtoMessage() {}
+
+func (x *ListPermissionsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[2]
+ 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 ListPermissionsRequest.ProtoReflect.Descriptor instead.
+func (*ListPermissionsRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ListPermissionsRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *ListPermissionsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListPermissionsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+// Response from `ListPermissions` containing a paginated list of
+// permissions.
+type ListPermissionsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Returned permissions.
+ Permissions []*Permission `protobuf:"bytes,1,rep,name=permissions,proto3" json:"permissions,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ //
+ // If this field is omitted, there are no more pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListPermissionsResponse) Reset() {
+ *x = ListPermissionsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListPermissionsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListPermissionsResponse) ProtoMessage() {}
+
+func (x *ListPermissionsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[3]
+ 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 ListPermissionsResponse.ProtoReflect.Descriptor instead.
+func (*ListPermissionsResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *ListPermissionsResponse) GetPermissions() []*Permission {
+ if x != nil {
+ return x.Permissions
+ }
+ return nil
+}
+
+func (x *ListPermissionsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+// Request to update the `Permission`.
+type UpdatePermissionRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The permission to update.
+ //
+ // The permission's `name` field is used to identify the permission to update.
+ Permission *Permission `protobuf:"bytes,1,opt,name=permission,proto3" json:"permission,omitempty"`
+ // Required. The list of fields to update. Accepted ones:
+ // - role (`Permission.role` field)
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdatePermissionRequest) Reset() {
+ *x = UpdatePermissionRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdatePermissionRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdatePermissionRequest) ProtoMessage() {}
+
+func (x *UpdatePermissionRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[4]
+ 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 UpdatePermissionRequest.ProtoReflect.Descriptor instead.
+func (*UpdatePermissionRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *UpdatePermissionRequest) GetPermission() *Permission {
+ if x != nil {
+ return x.Permission
+ }
+ return nil
+}
+
+func (x *UpdatePermissionRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+// Request to delete the `Permission`.
+type DeletePermissionRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the permission.
+ // Formats:
+ //
+ // `tunedModels/{tuned_model}/permissions/{permission}`
+ // `corpora/{corpus}/permissions/{permission}`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *DeletePermissionRequest) Reset() {
+ *x = DeletePermissionRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeletePermissionRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeletePermissionRequest) ProtoMessage() {}
+
+func (x *DeletePermissionRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[5]
+ 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 DeletePermissionRequest.ProtoReflect.Descriptor instead.
+func (*DeletePermissionRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *DeletePermissionRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request to transfer the ownership of the tuned model.
+type TransferOwnershipRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the tuned model to transfer ownership.
+ //
+ // Format: `tunedModels/my-model-id`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Required. The email address of the user to whom the tuned model is being
+ // transferred to.
+ EmailAddress string `protobuf:"bytes,2,opt,name=email_address,json=emailAddress,proto3" json:"email_address,omitempty"`
+}
+
+func (x *TransferOwnershipRequest) Reset() {
+ *x = TransferOwnershipRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TransferOwnershipRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TransferOwnershipRequest) ProtoMessage() {}
+
+func (x *TransferOwnershipRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[6]
+ 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 TransferOwnershipRequest.ProtoReflect.Descriptor instead.
+func (*TransferOwnershipRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *TransferOwnershipRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *TransferOwnershipRequest) GetEmailAddress() string {
+ if x != nil {
+ return x.EmailAddress
+ }
+ return ""
+}
+
+// Response from `TransferOwnership`.
+type TransferOwnershipResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *TransferOwnershipResponse) Reset() {
+ *x = TransferOwnershipResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TransferOwnershipResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TransferOwnershipResponse) ProtoMessage() {}
+
+func (x *TransferOwnershipResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[7]
+ 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 TransferOwnershipResponse.ProtoReflect.Descriptor instead.
+func (*TransferOwnershipResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP(), []int{7}
+}
+
+var File_google_ai_generativelanguage_v1beta_permission_service_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDesc = []byte{
+ 0x0a, 0x3c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x1a, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65,
+ 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65,
+ 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d,
+ 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64,
+ 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x01, 0x0a, 0x17,
+ 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2e, 0x12,
+ 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,
+ 0x6f, 0x6d, 0x2f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x60, 0x0a, 0x14, 0x47,
+ 0x65, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x34, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2e, 0x0a, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x65, 0x72,
+ 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x81, 0x01,
+ 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x03,
+ 0x0a, 0x01, 0x2a, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70,
+ 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03,
+ 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a,
+ 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x22, 0x94, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a,
+ 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73,
+ 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f,
+ 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50,
+ 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb1, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50,
+ 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a,
+ 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02,
+ 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x63, 0x0a, 0x17,
+ 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2e, 0x0a, 0x2c, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x6e, 0x61, 0x6d,
+ 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x77,
+ 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48,
+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xe0, 0x41,
+ 0x02, 0xfa, 0x41, 0x2e, 0x12, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61,
+ 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x65, 0x6d, 0x61, 0x69,
+ 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65,
+ 0x73, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x77,
+ 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32,
+ 0xec, 0x0b, 0x0a, 0x11, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65,
+ 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8c, 0x02, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
+ 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50,
+ 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x88, 0x01, 0xda, 0x41, 0x11, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x6e, 0x3a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x5a, 0x34, 0x3a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x22, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x65, 0x72,
+ 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xe0, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x6d,
+ 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74,
+ 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x22, 0x63, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x56, 0x5a, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x70, 0x65, 0x72,
+ 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x2a, 0x2f, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xf3, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74,
+ 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c,
+ 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x56, 0x5a, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f,
+ 0x72, 0x61, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x73, 0x12, 0x2a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x3d, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xa8, 0x02,
+ 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50,
+ 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
+ 0x6e, 0x22, 0xa4, 0x01, 0xda, 0x41, 0x16, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
+ 0x6e, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x84, 0x01, 0x3a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x5a, 0x3f, 0x3a, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x31,
+ 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61,
+ 0x2f, 0x2a, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x32, 0x35, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x65, 0x72, 0x6d,
+ 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74, 0x75, 0x6e, 0x65,
+ 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xcd, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
+ 0x70, 0x74, 0x79, 0x22, 0x63, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x56, 0x5a, 0x28, 0x2a, 0x26, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x70, 0x65,
+ 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x2a, 0x2a, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74, 0x75, 0x6e, 0x65,
+ 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xcd, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61,
+ 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x3d,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x77, 0x6e,
+ 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x65,
+ 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x4f,
+ 0x77, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x1a, 0x24, 0xca, 0x41, 0x21, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0xa2,
+ 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x16, 0x50, 0x65, 0x72, 0x6d,
+ 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f,
+ 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescData = file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
+var file_google_ai_generativelanguage_v1beta_permission_service_proto_goTypes = []interface{}{
+ (*CreatePermissionRequest)(nil), // 0: google.ai.generativelanguage.v1beta.CreatePermissionRequest
+ (*GetPermissionRequest)(nil), // 1: google.ai.generativelanguage.v1beta.GetPermissionRequest
+ (*ListPermissionsRequest)(nil), // 2: google.ai.generativelanguage.v1beta.ListPermissionsRequest
+ (*ListPermissionsResponse)(nil), // 3: google.ai.generativelanguage.v1beta.ListPermissionsResponse
+ (*UpdatePermissionRequest)(nil), // 4: google.ai.generativelanguage.v1beta.UpdatePermissionRequest
+ (*DeletePermissionRequest)(nil), // 5: google.ai.generativelanguage.v1beta.DeletePermissionRequest
+ (*TransferOwnershipRequest)(nil), // 6: google.ai.generativelanguage.v1beta.TransferOwnershipRequest
+ (*TransferOwnershipResponse)(nil), // 7: google.ai.generativelanguage.v1beta.TransferOwnershipResponse
+ (*Permission)(nil), // 8: google.ai.generativelanguage.v1beta.Permission
+ (*fieldmaskpb.FieldMask)(nil), // 9: google.protobuf.FieldMask
+ (*emptypb.Empty)(nil), // 10: google.protobuf.Empty
+}
+var file_google_ai_generativelanguage_v1beta_permission_service_proto_depIdxs = []int32{
+ 8, // 0: google.ai.generativelanguage.v1beta.CreatePermissionRequest.permission:type_name -> google.ai.generativelanguage.v1beta.Permission
+ 8, // 1: google.ai.generativelanguage.v1beta.ListPermissionsResponse.permissions:type_name -> google.ai.generativelanguage.v1beta.Permission
+ 8, // 2: google.ai.generativelanguage.v1beta.UpdatePermissionRequest.permission:type_name -> google.ai.generativelanguage.v1beta.Permission
+ 9, // 3: google.ai.generativelanguage.v1beta.UpdatePermissionRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 0, // 4: google.ai.generativelanguage.v1beta.PermissionService.CreatePermission:input_type -> google.ai.generativelanguage.v1beta.CreatePermissionRequest
+ 1, // 5: google.ai.generativelanguage.v1beta.PermissionService.GetPermission:input_type -> google.ai.generativelanguage.v1beta.GetPermissionRequest
+ 2, // 6: google.ai.generativelanguage.v1beta.PermissionService.ListPermissions:input_type -> google.ai.generativelanguage.v1beta.ListPermissionsRequest
+ 4, // 7: google.ai.generativelanguage.v1beta.PermissionService.UpdatePermission:input_type -> google.ai.generativelanguage.v1beta.UpdatePermissionRequest
+ 5, // 8: google.ai.generativelanguage.v1beta.PermissionService.DeletePermission:input_type -> google.ai.generativelanguage.v1beta.DeletePermissionRequest
+ 6, // 9: google.ai.generativelanguage.v1beta.PermissionService.TransferOwnership:input_type -> google.ai.generativelanguage.v1beta.TransferOwnershipRequest
+ 8, // 10: google.ai.generativelanguage.v1beta.PermissionService.CreatePermission:output_type -> google.ai.generativelanguage.v1beta.Permission
+ 8, // 11: google.ai.generativelanguage.v1beta.PermissionService.GetPermission:output_type -> google.ai.generativelanguage.v1beta.Permission
+ 3, // 12: google.ai.generativelanguage.v1beta.PermissionService.ListPermissions:output_type -> google.ai.generativelanguage.v1beta.ListPermissionsResponse
+ 8, // 13: google.ai.generativelanguage.v1beta.PermissionService.UpdatePermission:output_type -> google.ai.generativelanguage.v1beta.Permission
+ 10, // 14: google.ai.generativelanguage.v1beta.PermissionService.DeletePermission:output_type -> google.protobuf.Empty
+ 7, // 15: google.ai.generativelanguage.v1beta.PermissionService.TransferOwnership:output_type -> google.ai.generativelanguage.v1beta.TransferOwnershipResponse
+ 10, // [10:16] is the sub-list for method output_type
+ 4, // [4:10] is the sub-list for method input_type
+ 4, // [4:4] is the sub-list for extension type_name
+ 4, // [4:4] is the sub-list for extension extendee
+ 0, // [0:4] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_permission_service_proto_init() }
+func file_google_ai_generativelanguage_v1beta_permission_service_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_permission_service_proto != nil {
+ return
+ }
+ file_google_ai_generativelanguage_v1beta_permission_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreatePermissionRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetPermissionRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListPermissionsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListPermissionsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdatePermissionRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeletePermissionRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TransferOwnershipRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TransferOwnershipResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 8,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_permission_service_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_permission_service_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_permission_service_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_permission_service_proto = out.File
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_permission_service_proto_depIdxs = nil
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConnInterface
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion6
+
+// PermissionServiceClient is the client API for PermissionService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type PermissionServiceClient interface {
+ // Create a permission to a specific resource.
+ CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*Permission, error)
+ // Gets information about a specific Permission.
+ GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*Permission, error)
+ // Lists permissions for the specific resource.
+ ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error)
+ // Updates the permission.
+ UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*Permission, error)
+ // Deletes the permission.
+ DeletePermission(ctx context.Context, in *DeletePermissionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ // 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.
+ TransferOwnership(ctx context.Context, in *TransferOwnershipRequest, opts ...grpc.CallOption) (*TransferOwnershipResponse, error)
+}
+
+type permissionServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewPermissionServiceClient(cc grpc.ClientConnInterface) PermissionServiceClient {
+ return &permissionServiceClient{cc}
+}
+
+func (c *permissionServiceClient) CreatePermission(ctx context.Context, in *CreatePermissionRequest, opts ...grpc.CallOption) (*Permission, error) {
+ out := new(Permission)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.PermissionService/CreatePermission", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *permissionServiceClient) GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*Permission, error) {
+ out := new(Permission)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.PermissionService/GetPermission", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *permissionServiceClient) ListPermissions(ctx context.Context, in *ListPermissionsRequest, opts ...grpc.CallOption) (*ListPermissionsResponse, error) {
+ out := new(ListPermissionsResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.PermissionService/ListPermissions", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *permissionServiceClient) UpdatePermission(ctx context.Context, in *UpdatePermissionRequest, opts ...grpc.CallOption) (*Permission, error) {
+ out := new(Permission)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.PermissionService/UpdatePermission", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *permissionServiceClient) DeletePermission(ctx context.Context, in *DeletePermissionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.PermissionService/DeletePermission", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *permissionServiceClient) TransferOwnership(ctx context.Context, in *TransferOwnershipRequest, opts ...grpc.CallOption) (*TransferOwnershipResponse, error) {
+ out := new(TransferOwnershipResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.PermissionService/TransferOwnership", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// PermissionServiceServer is the server API for PermissionService service.
+type PermissionServiceServer interface {
+ // Create a permission to a specific resource.
+ CreatePermission(context.Context, *CreatePermissionRequest) (*Permission, error)
+ // Gets information about a specific Permission.
+ GetPermission(context.Context, *GetPermissionRequest) (*Permission, error)
+ // Lists permissions for the specific resource.
+ ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error)
+ // Updates the permission.
+ UpdatePermission(context.Context, *UpdatePermissionRequest) (*Permission, error)
+ // Deletes the permission.
+ DeletePermission(context.Context, *DeletePermissionRequest) (*emptypb.Empty, error)
+ // 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.
+ TransferOwnership(context.Context, *TransferOwnershipRequest) (*TransferOwnershipResponse, error)
+}
+
+// UnimplementedPermissionServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedPermissionServiceServer struct {
+}
+
+func (*UnimplementedPermissionServiceServer) CreatePermission(context.Context, *CreatePermissionRequest) (*Permission, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreatePermission not implemented")
+}
+func (*UnimplementedPermissionServiceServer) GetPermission(context.Context, *GetPermissionRequest) (*Permission, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetPermission not implemented")
+}
+func (*UnimplementedPermissionServiceServer) ListPermissions(context.Context, *ListPermissionsRequest) (*ListPermissionsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListPermissions not implemented")
+}
+func (*UnimplementedPermissionServiceServer) UpdatePermission(context.Context, *UpdatePermissionRequest) (*Permission, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdatePermission not implemented")
+}
+func (*UnimplementedPermissionServiceServer) DeletePermission(context.Context, *DeletePermissionRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeletePermission not implemented")
+}
+func (*UnimplementedPermissionServiceServer) TransferOwnership(context.Context, *TransferOwnershipRequest) (*TransferOwnershipResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method TransferOwnership not implemented")
+}
+
+func RegisterPermissionServiceServer(s *grpc.Server, srv PermissionServiceServer) {
+ s.RegisterService(&_PermissionService_serviceDesc, srv)
+}
+
+func _PermissionService_CreatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreatePermissionRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PermissionServiceServer).CreatePermission(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.PermissionService/CreatePermission",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PermissionServiceServer).CreatePermission(ctx, req.(*CreatePermissionRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _PermissionService_GetPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetPermissionRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PermissionServiceServer).GetPermission(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.PermissionService/GetPermission",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PermissionServiceServer).GetPermission(ctx, req.(*GetPermissionRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _PermissionService_ListPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListPermissionsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PermissionServiceServer).ListPermissions(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.PermissionService/ListPermissions",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PermissionServiceServer).ListPermissions(ctx, req.(*ListPermissionsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _PermissionService_UpdatePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdatePermissionRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PermissionServiceServer).UpdatePermission(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.PermissionService/UpdatePermission",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PermissionServiceServer).UpdatePermission(ctx, req.(*UpdatePermissionRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _PermissionService_DeletePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeletePermissionRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PermissionServiceServer).DeletePermission(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.PermissionService/DeletePermission",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PermissionServiceServer).DeletePermission(ctx, req.(*DeletePermissionRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _PermissionService_TransferOwnership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(TransferOwnershipRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PermissionServiceServer).TransferOwnership(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.PermissionService/TransferOwnership",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PermissionServiceServer).TransferOwnership(ctx, req.(*TransferOwnershipRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _PermissionService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "google.ai.generativelanguage.v1beta.PermissionService",
+ HandlerType: (*PermissionServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "CreatePermission",
+ Handler: _PermissionService_CreatePermission_Handler,
+ },
+ {
+ MethodName: "GetPermission",
+ Handler: _PermissionService_GetPermission_Handler,
+ },
+ {
+ MethodName: "ListPermissions",
+ Handler: _PermissionService_ListPermissions_Handler,
+ },
+ {
+ MethodName: "UpdatePermission",
+ Handler: _PermissionService_UpdatePermission_Handler,
+ },
+ {
+ MethodName: "DeletePermission",
+ Handler: _PermissionService_DeletePermission_Handler,
+ },
+ {
+ MethodName: "TransferOwnership",
+ Handler: _PermissionService_TransferOwnership_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "google/ai/generativelanguage/v1beta/permission_service.proto",
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever.pb.go
new file mode 100644
index 000000000..57c598100
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever.pb.go
@@ -0,0 +1,1193 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/retriever.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Defines the valid operators that can be applied to a key-value pair.
+type Condition_Operator int32
+
+const (
+ // The default value. This value is unused.
+ Condition_OPERATOR_UNSPECIFIED Condition_Operator = 0
+ // Supported by numeric.
+ Condition_LESS Condition_Operator = 1
+ // Supported by numeric.
+ Condition_LESS_EQUAL Condition_Operator = 2
+ // Supported by numeric & string.
+ Condition_EQUAL Condition_Operator = 3
+ // Supported by numeric.
+ Condition_GREATER_EQUAL Condition_Operator = 4
+ // Supported by numeric.
+ Condition_GREATER Condition_Operator = 5
+ // Supported by numeric & string.
+ Condition_NOT_EQUAL Condition_Operator = 6
+ // Supported by string only when `CustomMetadata` value type for the given
+ // key has a `string_list_value`.
+ Condition_INCLUDES Condition_Operator = 7
+ // Supported by string only when `CustomMetadata` value type for the given
+ // key has a `string_list_value`.
+ Condition_EXCLUDES Condition_Operator = 8
+)
+
+// Enum value maps for Condition_Operator.
+var (
+ Condition_Operator_name = map[int32]string{
+ 0: "OPERATOR_UNSPECIFIED",
+ 1: "LESS",
+ 2: "LESS_EQUAL",
+ 3: "EQUAL",
+ 4: "GREATER_EQUAL",
+ 5: "GREATER",
+ 6: "NOT_EQUAL",
+ 7: "INCLUDES",
+ 8: "EXCLUDES",
+ }
+ Condition_Operator_value = map[string]int32{
+ "OPERATOR_UNSPECIFIED": 0,
+ "LESS": 1,
+ "LESS_EQUAL": 2,
+ "EQUAL": 3,
+ "GREATER_EQUAL": 4,
+ "GREATER": 5,
+ "NOT_EQUAL": 6,
+ "INCLUDES": 7,
+ "EXCLUDES": 8,
+ }
+)
+
+func (x Condition_Operator) Enum() *Condition_Operator {
+ p := new(Condition_Operator)
+ *p = x
+ return p
+}
+
+func (x Condition_Operator) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Condition_Operator) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_enumTypes[0].Descriptor()
+}
+
+func (Condition_Operator) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_retriever_proto_enumTypes[0]
+}
+
+func (x Condition_Operator) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Condition_Operator.Descriptor instead.
+func (Condition_Operator) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{5, 0}
+}
+
+// States for the lifecycle of a `Chunk`.
+type Chunk_State int32
+
+const (
+ // The default value. This value is used if the state is omitted.
+ Chunk_STATE_UNSPECIFIED Chunk_State = 0
+ // `Chunk` is being processed (embedding and vector storage).
+ Chunk_STATE_PENDING_PROCESSING Chunk_State = 1
+ // `Chunk` is processed and available for querying.
+ Chunk_STATE_ACTIVE Chunk_State = 2
+ // `Chunk` failed processing.
+ Chunk_STATE_FAILED Chunk_State = 10
+)
+
+// Enum value maps for Chunk_State.
+var (
+ Chunk_State_name = map[int32]string{
+ 0: "STATE_UNSPECIFIED",
+ 1: "STATE_PENDING_PROCESSING",
+ 2: "STATE_ACTIVE",
+ 10: "STATE_FAILED",
+ }
+ Chunk_State_value = map[string]int32{
+ "STATE_UNSPECIFIED": 0,
+ "STATE_PENDING_PROCESSING": 1,
+ "STATE_ACTIVE": 2,
+ "STATE_FAILED": 10,
+ }
+)
+
+func (x Chunk_State) Enum() *Chunk_State {
+ p := new(Chunk_State)
+ *p = x
+ return p
+}
+
+func (x Chunk_State) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Chunk_State) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_enumTypes[1].Descriptor()
+}
+
+func (Chunk_State) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_retriever_proto_enumTypes[1]
+}
+
+func (x Chunk_State) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Chunk_State.Descriptor instead.
+func (Chunk_State) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{6, 0}
+}
+
+// A `Corpus` is a collection of `Document`s.
+// A project can create up to 5 corpora.
+type Corpus struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // 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"
+ DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
+ // Output only. The Timestamp of when the `Corpus` was created.
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ // Output only. The Timestamp of when the `Corpus` was last updated.
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+}
+
+func (x *Corpus) Reset() {
+ *x = Corpus{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Corpus) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Corpus) ProtoMessage() {}
+
+func (x *Corpus) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_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 Corpus.ProtoReflect.Descriptor instead.
+func (*Corpus) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Corpus) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Corpus) GetDisplayName() string {
+ if x != nil {
+ return x.DisplayName
+ }
+ return ""
+}
+
+func (x *Corpus) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *Corpus) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+// A `Document` is a collection of `Chunk`s.
+// A `Corpus` can have a maximum of 10,000 `Document`s.
+type Document struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // 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"
+ DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
+ // Optional. User provided custom metadata stored as key-value pairs used for
+ // querying. A `Document` can have a maximum of 20 `CustomMetadata`.
+ CustomMetadata []*CustomMetadata `protobuf:"bytes,3,rep,name=custom_metadata,json=customMetadata,proto3" json:"custom_metadata,omitempty"`
+ // Output only. The Timestamp of when the `Document` was last updated.
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ // Output only. The Timestamp of when the `Document` was created.
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+}
+
+func (x *Document) Reset() {
+ *x = Document{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Document) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Document) ProtoMessage() {}
+
+func (x *Document) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[1]
+ 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 Document.ProtoReflect.Descriptor instead.
+func (*Document) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *Document) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Document) GetDisplayName() string {
+ if x != nil {
+ return x.DisplayName
+ }
+ return ""
+}
+
+func (x *Document) GetCustomMetadata() []*CustomMetadata {
+ if x != nil {
+ return x.CustomMetadata
+ }
+ return nil
+}
+
+func (x *Document) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+func (x *Document) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+// User provided string values assigned to a single metadata key.
+type StringList struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The string values of the metadata to store.
+ Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
+}
+
+func (x *StringList) Reset() {
+ *x = StringList{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *StringList) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*StringList) ProtoMessage() {}
+
+func (x *StringList) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[2]
+ 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 StringList.ProtoReflect.Descriptor instead.
+func (*StringList) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *StringList) GetValues() []string {
+ if x != nil {
+ return x.Values
+ }
+ return nil
+}
+
+// User provided metadata stored as key-value pairs.
+type CustomMetadata struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Types that are assignable to Value:
+ //
+ // *CustomMetadata_StringValue
+ // *CustomMetadata_StringListValue
+ // *CustomMetadata_NumericValue
+ Value isCustomMetadata_Value `protobuf_oneof:"value"`
+ // Required. The key of the metadata to store.
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+}
+
+func (x *CustomMetadata) Reset() {
+ *x = CustomMetadata{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CustomMetadata) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CustomMetadata) ProtoMessage() {}
+
+func (x *CustomMetadata) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[3]
+ 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 CustomMetadata.ProtoReflect.Descriptor instead.
+func (*CustomMetadata) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{3}
+}
+
+func (m *CustomMetadata) GetValue() isCustomMetadata_Value {
+ if m != nil {
+ return m.Value
+ }
+ return nil
+}
+
+func (x *CustomMetadata) GetStringValue() string {
+ if x, ok := x.GetValue().(*CustomMetadata_StringValue); ok {
+ return x.StringValue
+ }
+ return ""
+}
+
+func (x *CustomMetadata) GetStringListValue() *StringList {
+ if x, ok := x.GetValue().(*CustomMetadata_StringListValue); ok {
+ return x.StringListValue
+ }
+ return nil
+}
+
+func (x *CustomMetadata) GetNumericValue() float32 {
+ if x, ok := x.GetValue().(*CustomMetadata_NumericValue); ok {
+ return x.NumericValue
+ }
+ return 0
+}
+
+func (x *CustomMetadata) GetKey() string {
+ if x != nil {
+ return x.Key
+ }
+ return ""
+}
+
+type isCustomMetadata_Value interface {
+ isCustomMetadata_Value()
+}
+
+type CustomMetadata_StringValue struct {
+ // The string value of the metadata to store.
+ StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof"`
+}
+
+type CustomMetadata_StringListValue struct {
+ // The StringList value of the metadata to store.
+ StringListValue *StringList `protobuf:"bytes,6,opt,name=string_list_value,json=stringListValue,proto3,oneof"`
+}
+
+type CustomMetadata_NumericValue struct {
+ // The numeric value of the metadata to store.
+ NumericValue float32 `protobuf:"fixed32,7,opt,name=numeric_value,json=numericValue,proto3,oneof"`
+}
+
+func (*CustomMetadata_StringValue) isCustomMetadata_Value() {}
+
+func (*CustomMetadata_StringListValue) isCustomMetadata_Value() {}
+
+func (*CustomMetadata_NumericValue) isCustomMetadata_Value() {}
+
+// 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 MetadataFilter struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The key of the metadata to filter on.
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+ // Required. The `Condition`s for the given key that will trigger this filter.
+ // Multiple `Condition`s are joined by logical ORs.
+ Conditions []*Condition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"`
+}
+
+func (x *MetadataFilter) Reset() {
+ *x = MetadataFilter{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *MetadataFilter) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*MetadataFilter) ProtoMessage() {}
+
+func (x *MetadataFilter) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[4]
+ 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 MetadataFilter.ProtoReflect.Descriptor instead.
+func (*MetadataFilter) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *MetadataFilter) GetKey() string {
+ if x != nil {
+ return x.Key
+ }
+ return ""
+}
+
+func (x *MetadataFilter) GetConditions() []*Condition {
+ if x != nil {
+ return x.Conditions
+ }
+ return nil
+}
+
+// Filter condition applicable to a single key.
+type Condition struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The value type must be consistent with the value type defined in the field
+ // for the corresponding key. If the value types are not consistent, the
+ // result will be an empty set. When the `CustomMetadata` has a `StringList`
+ // value type, the filtering condition should use `string_value` paired with
+ // an INCLUDES/EXCLUDES operation, otherwise the result will also be an empty
+ // set.
+ //
+ // Types that are assignable to Value:
+ //
+ // *Condition_StringValue
+ // *Condition_NumericValue
+ Value isCondition_Value `protobuf_oneof:"value"`
+ // Required. Operator applied to the given key-value pair to trigger the
+ // condition.
+ Operation Condition_Operator `protobuf:"varint,5,opt,name=operation,proto3,enum=google.ai.generativelanguage.v1beta.Condition_Operator" json:"operation,omitempty"`
+}
+
+func (x *Condition) Reset() {
+ *x = Condition{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Condition) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Condition) ProtoMessage() {}
+
+func (x *Condition) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[5]
+ 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 Condition.ProtoReflect.Descriptor instead.
+func (*Condition) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{5}
+}
+
+func (m *Condition) GetValue() isCondition_Value {
+ if m != nil {
+ return m.Value
+ }
+ return nil
+}
+
+func (x *Condition) GetStringValue() string {
+ if x, ok := x.GetValue().(*Condition_StringValue); ok {
+ return x.StringValue
+ }
+ return ""
+}
+
+func (x *Condition) GetNumericValue() float32 {
+ if x, ok := x.GetValue().(*Condition_NumericValue); ok {
+ return x.NumericValue
+ }
+ return 0
+}
+
+func (x *Condition) GetOperation() Condition_Operator {
+ if x != nil {
+ return x.Operation
+ }
+ return Condition_OPERATOR_UNSPECIFIED
+}
+
+type isCondition_Value interface {
+ isCondition_Value()
+}
+
+type Condition_StringValue struct {
+ // The string value to filter the metadata on.
+ StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"`
+}
+
+type Condition_NumericValue struct {
+ // The numeric value to filter the metadata on.
+ NumericValue float32 `protobuf:"fixed32,6,opt,name=numeric_value,json=numericValue,proto3,oneof"`
+}
+
+func (*Condition_StringValue) isCondition_Value() {}
+
+func (*Condition_NumericValue) isCondition_Value() {}
+
+// 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 Chunk struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Required. The content for the `Chunk`, such as the text string.
+ // The maximum number of tokens per chunk is 2043.
+ Data *ChunkData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
+ // Optional. User provided custom metadata stored as key-value pairs.
+ // The maximum number of `CustomMetadata` per chunk is 20.
+ CustomMetadata []*CustomMetadata `protobuf:"bytes,3,rep,name=custom_metadata,json=customMetadata,proto3" json:"custom_metadata,omitempty"`
+ // Output only. The Timestamp of when the `Chunk` was created.
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ // Output only. The Timestamp of when the `Chunk` was last updated.
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ // Output only. Current state of the `Chunk`.
+ State Chunk_State `protobuf:"varint,6,opt,name=state,proto3,enum=google.ai.generativelanguage.v1beta.Chunk_State" json:"state,omitempty"`
+}
+
+func (x *Chunk) Reset() {
+ *x = Chunk{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Chunk) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Chunk) ProtoMessage() {}
+
+func (x *Chunk) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[6]
+ 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 Chunk.ProtoReflect.Descriptor instead.
+func (*Chunk) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *Chunk) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Chunk) GetData() *ChunkData {
+ if x != nil {
+ return x.Data
+ }
+ return nil
+}
+
+func (x *Chunk) GetCustomMetadata() []*CustomMetadata {
+ if x != nil {
+ return x.CustomMetadata
+ }
+ return nil
+}
+
+func (x *Chunk) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *Chunk) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+func (x *Chunk) GetState() Chunk_State {
+ if x != nil {
+ return x.State
+ }
+ return Chunk_STATE_UNSPECIFIED
+}
+
+// Extracted data that represents the `Chunk` content.
+type ChunkData struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Types that are assignable to Data:
+ //
+ // *ChunkData_StringValue
+ Data isChunkData_Data `protobuf_oneof:"data"`
+}
+
+func (x *ChunkData) Reset() {
+ *x = ChunkData{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ChunkData) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ChunkData) ProtoMessage() {}
+
+func (x *ChunkData) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[7]
+ 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 ChunkData.ProtoReflect.Descriptor instead.
+func (*ChunkData) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP(), []int{7}
+}
+
+func (m *ChunkData) GetData() isChunkData_Data {
+ if m != nil {
+ return m.Data
+ }
+ return nil
+}
+
+func (x *ChunkData) GetStringValue() string {
+ if x, ok := x.GetData().(*ChunkData_StringValue); ok {
+ return x.StringValue
+ }
+ return ""
+}
+
+type isChunkData_Data interface {
+ isChunkData_Data()
+}
+
+type ChunkData_StringValue struct {
+ // The `Chunk` content as a string.
+ // The maximum number of tokens per chunk is 2043.
+ StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"`
+}
+
+func (*ChunkData_StringValue) isChunkData_Data() {}
+
+var File_google_ai_generativelanguage_v1beta_retriever_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_retriever_proto_rawDesc = []byte{
+ 0x0a, 0x33, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68,
+ 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
+ 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x72, 0x70,
+ 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x06, 0xe0, 0x41, 0x08, 0xe0, 0x41, 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26,
+ 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c,
+ 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+ 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a,
+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x50, 0xea, 0x41, 0x4d, 0x0a,
+ 0x28, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,
+ 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x12, 0x10, 0x63, 0x6f, 0x72, 0x70, 0x6f,
+ 0x72, 0x61, 0x2f, 0x7b, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x7d, 0x2a, 0x07, 0x63, 0x6f, 0x72,
+ 0x70, 0x6f, 0x72, 0x61, 0x32, 0x06, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x22, 0xa2, 0x03, 0x0a,
+ 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x08, 0xe0, 0x41, 0x05, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
+ 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x61, 0x0a,
+ 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
+ 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x75, 0x73,
+ 0x74, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x52, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
+ 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
+ 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
+ 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69,
+ 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d,
+ 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
+ 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x6b, 0xea, 0x41, 0x68, 0x0a, 0x2a, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x7b,
+ 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x2f, 0x7b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7d, 0x2a, 0x09, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x32, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x22, 0x24, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12,
+ 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
+ 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xdb, 0x01, 0x0a, 0x0e, 0x43, 0x75, 0x73, 0x74,
+ 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12,
+ 0x5d, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76,
+ 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25,
+ 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
+ 0x07, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63,
+ 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x15, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x07, 0x0a, 0x05,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x7c, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+ 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x53,
+ 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x73, 0x22, 0xd3, 0x02, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75,
+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69,
+ 0x63, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52,
+ 0x0c, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x5a, 0x0a,
+ 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e,
+ 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09,
+ 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x01, 0x0a, 0x08, 0x4f, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54,
+ 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45,
+ 0x53, 0x53, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51,
+ 0x55, 0x41, 0x4c, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52,
+ 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x52, 0x45, 0x41,
+ 0x54, 0x45, 0x52, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x45, 0x51, 0x55,
+ 0x41, 0x4c, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x45, 0x53,
+ 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x43, 0x4c, 0x55, 0x44, 0x45, 0x53, 0x10, 0x08,
+ 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf5, 0x04, 0x0a, 0x05, 0x43, 0x68,
+ 0x75, 0x6e, 0x6b, 0x12, 0x1a, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x06, 0xe0, 0x41, 0x08, 0xe0, 0x41, 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
+ 0x47, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x61, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74,
+ 0x6f, 0x6d, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d, 0x65,
+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x63, 0x75, 0x73,
+ 0x74, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x0b, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41,
+ 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a,
+ 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03,
+ 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
+ 0x4b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x60, 0x0a, 0x05,
+ 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18,
+ 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x52,
+ 0x4f, 0x43, 0x45, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54,
+ 0x41, 0x54, 0x45, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c,
+ 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x0a, 0x3a, 0x71,
+ 0xea, 0x41, 0x6e, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x34, 0x63, 0x6f,
+ 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x7b, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x7d, 0x2f, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x7b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x7d, 0x2f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x2f, 0x7b, 0x63, 0x68, 0x75, 0x6e,
+ 0x6b, 0x7d, 0x2a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x32, 0x05, 0x63, 0x68, 0x75, 0x6e,
+ 0x6b, 0x22, 0x38, 0x0a, 0x09, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x23,
+ 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x9a, 0x01, 0x0a, 0x27,
+ 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x0e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76,
+ 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61,
+ 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescData = file_google_ai_generativelanguage_v1beta_retriever_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_retriever_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_retriever_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
+var file_google_ai_generativelanguage_v1beta_retriever_proto_goTypes = []interface{}{
+ (Condition_Operator)(0), // 0: google.ai.generativelanguage.v1beta.Condition.Operator
+ (Chunk_State)(0), // 1: google.ai.generativelanguage.v1beta.Chunk.State
+ (*Corpus)(nil), // 2: google.ai.generativelanguage.v1beta.Corpus
+ (*Document)(nil), // 3: google.ai.generativelanguage.v1beta.Document
+ (*StringList)(nil), // 4: google.ai.generativelanguage.v1beta.StringList
+ (*CustomMetadata)(nil), // 5: google.ai.generativelanguage.v1beta.CustomMetadata
+ (*MetadataFilter)(nil), // 6: google.ai.generativelanguage.v1beta.MetadataFilter
+ (*Condition)(nil), // 7: google.ai.generativelanguage.v1beta.Condition
+ (*Chunk)(nil), // 8: google.ai.generativelanguage.v1beta.Chunk
+ (*ChunkData)(nil), // 9: google.ai.generativelanguage.v1beta.ChunkData
+ (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp
+}
+var file_google_ai_generativelanguage_v1beta_retriever_proto_depIdxs = []int32{
+ 10, // 0: google.ai.generativelanguage.v1beta.Corpus.create_time:type_name -> google.protobuf.Timestamp
+ 10, // 1: google.ai.generativelanguage.v1beta.Corpus.update_time:type_name -> google.protobuf.Timestamp
+ 5, // 2: google.ai.generativelanguage.v1beta.Document.custom_metadata:type_name -> google.ai.generativelanguage.v1beta.CustomMetadata
+ 10, // 3: google.ai.generativelanguage.v1beta.Document.update_time:type_name -> google.protobuf.Timestamp
+ 10, // 4: google.ai.generativelanguage.v1beta.Document.create_time:type_name -> google.protobuf.Timestamp
+ 4, // 5: google.ai.generativelanguage.v1beta.CustomMetadata.string_list_value:type_name -> google.ai.generativelanguage.v1beta.StringList
+ 7, // 6: google.ai.generativelanguage.v1beta.MetadataFilter.conditions:type_name -> google.ai.generativelanguage.v1beta.Condition
+ 0, // 7: google.ai.generativelanguage.v1beta.Condition.operation:type_name -> google.ai.generativelanguage.v1beta.Condition.Operator
+ 9, // 8: google.ai.generativelanguage.v1beta.Chunk.data:type_name -> google.ai.generativelanguage.v1beta.ChunkData
+ 5, // 9: google.ai.generativelanguage.v1beta.Chunk.custom_metadata:type_name -> google.ai.generativelanguage.v1beta.CustomMetadata
+ 10, // 10: google.ai.generativelanguage.v1beta.Chunk.create_time:type_name -> google.protobuf.Timestamp
+ 10, // 11: google.ai.generativelanguage.v1beta.Chunk.update_time:type_name -> google.protobuf.Timestamp
+ 1, // 12: google.ai.generativelanguage.v1beta.Chunk.state:type_name -> google.ai.generativelanguage.v1beta.Chunk.State
+ 13, // [13:13] is the sub-list for method output_type
+ 13, // [13:13] is the sub-list for method input_type
+ 13, // [13:13] is the sub-list for extension type_name
+ 13, // [13:13] is the sub-list for extension extendee
+ 0, // [0:13] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_retriever_proto_init() }
+func file_google_ai_generativelanguage_v1beta_retriever_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_retriever_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Corpus); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Document); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*StringList); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CustomMetadata); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*MetadataFilter); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Condition); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Chunk); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ChunkData); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[3].OneofWrappers = []interface{}{
+ (*CustomMetadata_StringValue)(nil),
+ (*CustomMetadata_StringListValue)(nil),
+ (*CustomMetadata_NumericValue)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[5].OneofWrappers = []interface{}{
+ (*Condition_StringValue)(nil),
+ (*Condition_NumericValue)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes[7].OneofWrappers = []interface{}{
+ (*ChunkData_StringValue)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_retriever_proto_rawDesc,
+ NumEnums: 2,
+ NumMessages: 8,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_retriever_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_retriever_proto_depIdxs,
+ EnumInfos: file_google_ai_generativelanguage_v1beta_retriever_proto_enumTypes,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_retriever_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_retriever_proto = out.File
+ file_google_ai_generativelanguage_v1beta_retriever_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_retriever_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_retriever_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever_service.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever_service.pb.go
new file mode 100644
index 000000000..4a6ff2d76
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/retriever_service.pb.go
@@ -0,0 +1,3589 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/retriever_service.proto
+
+package generativelanguagepb
+
+import (
+ context "context"
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Request to create a `Corpus`.
+type CreateCorpusRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The `Corpus` to create.
+ Corpus *Corpus `protobuf:"bytes,1,opt,name=corpus,proto3" json:"corpus,omitempty"`
+}
+
+func (x *CreateCorpusRequest) Reset() {
+ *x = CreateCorpusRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateCorpusRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateCorpusRequest) ProtoMessage() {}
+
+func (x *CreateCorpusRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_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 CreateCorpusRequest.ProtoReflect.Descriptor instead.
+func (*CreateCorpusRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CreateCorpusRequest) GetCorpus() *Corpus {
+ if x != nil {
+ return x.Corpus
+ }
+ return nil
+}
+
+// Request for getting information about a specific `Corpus`.
+type GetCorpusRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Corpus`.
+ // Example: `corpora/my-corpus-123`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetCorpusRequest) Reset() {
+ *x = GetCorpusRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetCorpusRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetCorpusRequest) ProtoMessage() {}
+
+func (x *GetCorpusRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[1]
+ 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 GetCorpusRequest.ProtoReflect.Descriptor instead.
+func (*GetCorpusRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GetCorpusRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request to update a `Corpus`.
+type UpdateCorpusRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The `Corpus` to update.
+ Corpus *Corpus `protobuf:"bytes,1,opt,name=corpus,proto3" json:"corpus,omitempty"`
+ // Required. The list of fields to update.
+ // Currently, this only supports updating `display_name`.
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateCorpusRequest) Reset() {
+ *x = UpdateCorpusRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateCorpusRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateCorpusRequest) ProtoMessage() {}
+
+func (x *UpdateCorpusRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[2]
+ 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 UpdateCorpusRequest.ProtoReflect.Descriptor instead.
+func (*UpdateCorpusRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *UpdateCorpusRequest) GetCorpus() *Corpus {
+ if x != nil {
+ return x.Corpus
+ }
+ return nil
+}
+
+func (x *UpdateCorpusRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+// Request to delete a `Corpus`.
+type DeleteCorpusRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the `Corpus`.
+ // Example: `corpora/my-corpus-123`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // 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.
+ Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"`
+}
+
+func (x *DeleteCorpusRequest) Reset() {
+ *x = DeleteCorpusRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteCorpusRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteCorpusRequest) ProtoMessage() {}
+
+func (x *DeleteCorpusRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[3]
+ 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 DeleteCorpusRequest.ProtoReflect.Descriptor instead.
+func (*DeleteCorpusRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *DeleteCorpusRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *DeleteCorpusRequest) GetForce() bool {
+ if x != nil {
+ return x.Force
+ }
+ return false
+}
+
+// Request for listing `Corpora`.
+type ListCorporaRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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.
+ PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // 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.
+ PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *ListCorporaRequest) Reset() {
+ *x = ListCorporaRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListCorporaRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListCorporaRequest) ProtoMessage() {}
+
+func (x *ListCorporaRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[4]
+ 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 ListCorporaRequest.ProtoReflect.Descriptor instead.
+func (*ListCorporaRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *ListCorporaRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListCorporaRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+// Response from `ListCorpora` containing a paginated list of `Corpora`.
+// The results are sorted by ascending `corpus.create_time`.
+type ListCorporaResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The returned corpora.
+ Corpora []*Corpus `protobuf:"bytes,1,rep,name=corpora,proto3" json:"corpora,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no more pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListCorporaResponse) Reset() {
+ *x = ListCorporaResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListCorporaResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListCorporaResponse) ProtoMessage() {}
+
+func (x *ListCorporaResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[5]
+ 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 ListCorporaResponse.ProtoReflect.Descriptor instead.
+func (*ListCorporaResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *ListCorporaResponse) GetCorpora() []*Corpus {
+ if x != nil {
+ return x.Corpora
+ }
+ return nil
+}
+
+func (x *ListCorporaResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+// Request for querying a `Corpus`.
+type QueryCorpusRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Corpus` to query.
+ // Example: `corpora/my-corpus-123`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Required. Query string to perform semantic search.
+ Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
+ // 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 >= 2020 OR year < 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 > 2015 AND year <= 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.
+ MetadataFilters []*MetadataFilter `protobuf:"bytes,3,rep,name=metadata_filters,json=metadataFilters,proto3" json:"metadata_filters,omitempty"`
+ // 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.
+ ResultsCount int32 `protobuf:"varint,4,opt,name=results_count,json=resultsCount,proto3" json:"results_count,omitempty"`
+}
+
+func (x *QueryCorpusRequest) Reset() {
+ *x = QueryCorpusRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *QueryCorpusRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*QueryCorpusRequest) ProtoMessage() {}
+
+func (x *QueryCorpusRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[6]
+ 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 QueryCorpusRequest.ProtoReflect.Descriptor instead.
+func (*QueryCorpusRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *QueryCorpusRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *QueryCorpusRequest) GetQuery() string {
+ if x != nil {
+ return x.Query
+ }
+ return ""
+}
+
+func (x *QueryCorpusRequest) GetMetadataFilters() []*MetadataFilter {
+ if x != nil {
+ return x.MetadataFilters
+ }
+ return nil
+}
+
+func (x *QueryCorpusRequest) GetResultsCount() int32 {
+ if x != nil {
+ return x.ResultsCount
+ }
+ return 0
+}
+
+// Response from `QueryCorpus` containing a list of relevant chunks.
+type QueryCorpusResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The relevant chunks.
+ RelevantChunks []*RelevantChunk `protobuf:"bytes,1,rep,name=relevant_chunks,json=relevantChunks,proto3" json:"relevant_chunks,omitempty"`
+}
+
+func (x *QueryCorpusResponse) Reset() {
+ *x = QueryCorpusResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *QueryCorpusResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*QueryCorpusResponse) ProtoMessage() {}
+
+func (x *QueryCorpusResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[7]
+ 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 QueryCorpusResponse.ProtoReflect.Descriptor instead.
+func (*QueryCorpusResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *QueryCorpusResponse) GetRelevantChunks() []*RelevantChunk {
+ if x != nil {
+ return x.RelevantChunks
+ }
+ return nil
+}
+
+// The information for a chunk relevant to a query.
+type RelevantChunk struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // `Chunk` relevance to the query.
+ ChunkRelevanceScore float32 `protobuf:"fixed32,1,opt,name=chunk_relevance_score,json=chunkRelevanceScore,proto3" json:"chunk_relevance_score,omitempty"`
+ // `Chunk` associated with the query.
+ Chunk *Chunk `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"`
+}
+
+func (x *RelevantChunk) Reset() {
+ *x = RelevantChunk{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RelevantChunk) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RelevantChunk) ProtoMessage() {}
+
+func (x *RelevantChunk) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[8]
+ 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 RelevantChunk.ProtoReflect.Descriptor instead.
+func (*RelevantChunk) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *RelevantChunk) GetChunkRelevanceScore() float32 {
+ if x != nil {
+ return x.ChunkRelevanceScore
+ }
+ return 0
+}
+
+func (x *RelevantChunk) GetChunk() *Chunk {
+ if x != nil {
+ return x.Chunk
+ }
+ return nil
+}
+
+// Request to create a `Document`.
+type CreateDocumentRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Corpus` where this `Document` will be created.
+ // Example: `corpora/my-corpus-123`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // Required. The `Document` to create.
+ Document *Document `protobuf:"bytes,2,opt,name=document,proto3" json:"document,omitempty"`
+}
+
+func (x *CreateDocumentRequest) Reset() {
+ *x = CreateDocumentRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateDocumentRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateDocumentRequest) ProtoMessage() {}
+
+func (x *CreateDocumentRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[9]
+ 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 CreateDocumentRequest.ProtoReflect.Descriptor instead.
+func (*CreateDocumentRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *CreateDocumentRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *CreateDocumentRequest) GetDocument() *Document {
+ if x != nil {
+ return x.Document
+ }
+ return nil
+}
+
+// Request for getting information about a specific `Document`.
+type GetDocumentRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Document` to retrieve.
+ // Example: `corpora/my-corpus-123/documents/the-doc-abc`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetDocumentRequest) Reset() {
+ *x = GetDocumentRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetDocumentRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetDocumentRequest) ProtoMessage() {}
+
+func (x *GetDocumentRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[10]
+ 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 GetDocumentRequest.ProtoReflect.Descriptor instead.
+func (*GetDocumentRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *GetDocumentRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request to update a `Document`.
+type UpdateDocumentRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The `Document` to update.
+ Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
+ // Required. The list of fields to update.
+ // Currently, this only supports updating `display_name` and
+ // `custom_metadata`.
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateDocumentRequest) Reset() {
+ *x = UpdateDocumentRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateDocumentRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateDocumentRequest) ProtoMessage() {}
+
+func (x *UpdateDocumentRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[11]
+ 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 UpdateDocumentRequest.ProtoReflect.Descriptor instead.
+func (*UpdateDocumentRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{11}
+}
+
+func (x *UpdateDocumentRequest) GetDocument() *Document {
+ if x != nil {
+ return x.Document
+ }
+ return nil
+}
+
+func (x *UpdateDocumentRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+// Request to delete a `Document`.
+type DeleteDocumentRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the `Document` to delete.
+ // Example: `corpora/my-corpus-123/documents/the-doc-abc`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // 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.
+ Force bool `protobuf:"varint,2,opt,name=force,proto3" json:"force,omitempty"`
+}
+
+func (x *DeleteDocumentRequest) Reset() {
+ *x = DeleteDocumentRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteDocumentRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteDocumentRequest) ProtoMessage() {}
+
+func (x *DeleteDocumentRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[12]
+ 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 DeleteDocumentRequest.ProtoReflect.Descriptor instead.
+func (*DeleteDocumentRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{12}
+}
+
+func (x *DeleteDocumentRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *DeleteDocumentRequest) GetForce() bool {
+ if x != nil {
+ return x.Force
+ }
+ return false
+}
+
+// Request for listing `Document`s.
+type ListDocumentsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Corpus` containing `Document`s.
+ // Example: `corpora/my-corpus-123`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // 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.
+ PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // 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.
+ PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *ListDocumentsRequest) Reset() {
+ *x = ListDocumentsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[13]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListDocumentsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListDocumentsRequest) ProtoMessage() {}
+
+func (x *ListDocumentsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[13]
+ 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 ListDocumentsRequest.ProtoReflect.Descriptor instead.
+func (*ListDocumentsRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *ListDocumentsRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *ListDocumentsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListDocumentsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+// Response from `ListDocuments` containing a paginated list of `Document`s.
+// The `Document`s are sorted by ascending `document.create_time`.
+type ListDocumentsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The returned `Document`s.
+ Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no more pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListDocumentsResponse) Reset() {
+ *x = ListDocumentsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[14]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListDocumentsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListDocumentsResponse) ProtoMessage() {}
+
+func (x *ListDocumentsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[14]
+ 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 ListDocumentsResponse.ProtoReflect.Descriptor instead.
+func (*ListDocumentsResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{14}
+}
+
+func (x *ListDocumentsResponse) GetDocuments() []*Document {
+ if x != nil {
+ return x.Documents
+ }
+ return nil
+}
+
+func (x *ListDocumentsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+// Request for querying a `Document`.
+type QueryDocumentRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Document` to query.
+ // Example: `corpora/my-corpus-123/documents/the-doc-abc`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Required. Query string to perform semantic search.
+ Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
+ // 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.
+ ResultsCount int32 `protobuf:"varint,3,opt,name=results_count,json=resultsCount,proto3" json:"results_count,omitempty"`
+ // 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 >= 2020 OR year < 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 > 2015 AND year <= 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.
+ MetadataFilters []*MetadataFilter `protobuf:"bytes,4,rep,name=metadata_filters,json=metadataFilters,proto3" json:"metadata_filters,omitempty"`
+}
+
+func (x *QueryDocumentRequest) Reset() {
+ *x = QueryDocumentRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[15]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *QueryDocumentRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*QueryDocumentRequest) ProtoMessage() {}
+
+func (x *QueryDocumentRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[15]
+ 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 QueryDocumentRequest.ProtoReflect.Descriptor instead.
+func (*QueryDocumentRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{15}
+}
+
+func (x *QueryDocumentRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *QueryDocumentRequest) GetQuery() string {
+ if x != nil {
+ return x.Query
+ }
+ return ""
+}
+
+func (x *QueryDocumentRequest) GetResultsCount() int32 {
+ if x != nil {
+ return x.ResultsCount
+ }
+ return 0
+}
+
+func (x *QueryDocumentRequest) GetMetadataFilters() []*MetadataFilter {
+ if x != nil {
+ return x.MetadataFilters
+ }
+ return nil
+}
+
+// Response from `QueryDocument` containing a list of relevant chunks.
+type QueryDocumentResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The returned relevant chunks.
+ RelevantChunks []*RelevantChunk `protobuf:"bytes,1,rep,name=relevant_chunks,json=relevantChunks,proto3" json:"relevant_chunks,omitempty"`
+}
+
+func (x *QueryDocumentResponse) Reset() {
+ *x = QueryDocumentResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[16]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *QueryDocumentResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*QueryDocumentResponse) ProtoMessage() {}
+
+func (x *QueryDocumentResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[16]
+ 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 QueryDocumentResponse.ProtoReflect.Descriptor instead.
+func (*QueryDocumentResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{16}
+}
+
+func (x *QueryDocumentResponse) GetRelevantChunks() []*RelevantChunk {
+ if x != nil {
+ return x.RelevantChunks
+ }
+ return nil
+}
+
+// Request to create a `Chunk`.
+type CreateChunkRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Document` where this `Chunk` will be created.
+ // Example: `corpora/my-corpus-123/documents/the-doc-abc`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // Required. The `Chunk` to create.
+ Chunk *Chunk `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"`
+}
+
+func (x *CreateChunkRequest) Reset() {
+ *x = CreateChunkRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[17]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateChunkRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateChunkRequest) ProtoMessage() {}
+
+func (x *CreateChunkRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[17]
+ 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 CreateChunkRequest.ProtoReflect.Descriptor instead.
+func (*CreateChunkRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{17}
+}
+
+func (x *CreateChunkRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *CreateChunkRequest) GetChunk() *Chunk {
+ if x != nil {
+ return x.Chunk
+ }
+ return nil
+}
+
+// Request to batch create `Chunk`s.
+type BatchCreateChunksRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // Required. The request messages specifying the `Chunk`s to create.
+ // A maximum of 100 `Chunk`s can be created in a batch.
+ Requests []*CreateChunkRequest `protobuf:"bytes,2,rep,name=requests,proto3" json:"requests,omitempty"`
+}
+
+func (x *BatchCreateChunksRequest) Reset() {
+ *x = BatchCreateChunksRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[18]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchCreateChunksRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchCreateChunksRequest) ProtoMessage() {}
+
+func (x *BatchCreateChunksRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[18]
+ 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 BatchCreateChunksRequest.ProtoReflect.Descriptor instead.
+func (*BatchCreateChunksRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{18}
+}
+
+func (x *BatchCreateChunksRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *BatchCreateChunksRequest) GetRequests() []*CreateChunkRequest {
+ if x != nil {
+ return x.Requests
+ }
+ return nil
+}
+
+// Response from `BatchCreateChunks` containing a list of created `Chunk`s.
+type BatchCreateChunksResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // `Chunk`s created.
+ Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"`
+}
+
+func (x *BatchCreateChunksResponse) Reset() {
+ *x = BatchCreateChunksResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[19]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchCreateChunksResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchCreateChunksResponse) ProtoMessage() {}
+
+func (x *BatchCreateChunksResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[19]
+ 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 BatchCreateChunksResponse.ProtoReflect.Descriptor instead.
+func (*BatchCreateChunksResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{19}
+}
+
+func (x *BatchCreateChunksResponse) GetChunks() []*Chunk {
+ if x != nil {
+ return x.Chunks
+ }
+ return nil
+}
+
+// Request for getting information about a specific `Chunk`.
+type GetChunkRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Chunk` to retrieve.
+ // Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetChunkRequest) Reset() {
+ *x = GetChunkRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[20]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetChunkRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetChunkRequest) ProtoMessage() {}
+
+func (x *GetChunkRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[20]
+ 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 GetChunkRequest.ProtoReflect.Descriptor instead.
+func (*GetChunkRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{20}
+}
+
+func (x *GetChunkRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request to update a `Chunk`.
+type UpdateChunkRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The `Chunk` to update.
+ Chunk *Chunk `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"`
+ // Required. The list of fields to update.
+ // Currently, this only supports updating `custom_metadata` and `data`.
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateChunkRequest) Reset() {
+ *x = UpdateChunkRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[21]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateChunkRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateChunkRequest) ProtoMessage() {}
+
+func (x *UpdateChunkRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[21]
+ 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 UpdateChunkRequest.ProtoReflect.Descriptor instead.
+func (*UpdateChunkRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{21}
+}
+
+func (x *UpdateChunkRequest) GetChunk() *Chunk {
+ if x != nil {
+ return x.Chunk
+ }
+ return nil
+}
+
+func (x *UpdateChunkRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+// Request to batch update `Chunk`s.
+type BatchUpdateChunksRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // Required. The request messages specifying the `Chunk`s to update.
+ // A maximum of 100 `Chunk`s can be updated in a batch.
+ Requests []*UpdateChunkRequest `protobuf:"bytes,2,rep,name=requests,proto3" json:"requests,omitempty"`
+}
+
+func (x *BatchUpdateChunksRequest) Reset() {
+ *x = BatchUpdateChunksRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[22]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchUpdateChunksRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchUpdateChunksRequest) ProtoMessage() {}
+
+func (x *BatchUpdateChunksRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[22]
+ 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 BatchUpdateChunksRequest.ProtoReflect.Descriptor instead.
+func (*BatchUpdateChunksRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{22}
+}
+
+func (x *BatchUpdateChunksRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *BatchUpdateChunksRequest) GetRequests() []*UpdateChunkRequest {
+ if x != nil {
+ return x.Requests
+ }
+ return nil
+}
+
+// Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.
+type BatchUpdateChunksResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // `Chunk`s updated.
+ Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"`
+}
+
+func (x *BatchUpdateChunksResponse) Reset() {
+ *x = BatchUpdateChunksResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[23]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchUpdateChunksResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchUpdateChunksResponse) ProtoMessage() {}
+
+func (x *BatchUpdateChunksResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[23]
+ 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 BatchUpdateChunksResponse.ProtoReflect.Descriptor instead.
+func (*BatchUpdateChunksResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{23}
+}
+
+func (x *BatchUpdateChunksResponse) GetChunks() []*Chunk {
+ if x != nil {
+ return x.Chunks
+ }
+ return nil
+}
+
+// Request to delete a `Chunk`.
+type DeleteChunkRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The resource name of the `Chunk` to delete.
+ // Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *DeleteChunkRequest) Reset() {
+ *x = DeleteChunkRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[24]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteChunkRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteChunkRequest) ProtoMessage() {}
+
+func (x *DeleteChunkRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[24]
+ 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 DeleteChunkRequest.ProtoReflect.Descriptor instead.
+func (*DeleteChunkRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{24}
+}
+
+func (x *DeleteChunkRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+// Request to batch delete `Chunk`s.
+type BatchDeleteChunksRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // Required. The request messages specifying the `Chunk`s to delete.
+ Requests []*DeleteChunkRequest `protobuf:"bytes,2,rep,name=requests,proto3" json:"requests,omitempty"`
+}
+
+func (x *BatchDeleteChunksRequest) Reset() {
+ *x = BatchDeleteChunksRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[25]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchDeleteChunksRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchDeleteChunksRequest) ProtoMessage() {}
+
+func (x *BatchDeleteChunksRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[25]
+ 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 BatchDeleteChunksRequest.ProtoReflect.Descriptor instead.
+func (*BatchDeleteChunksRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{25}
+}
+
+func (x *BatchDeleteChunksRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *BatchDeleteChunksRequest) GetRequests() []*DeleteChunkRequest {
+ if x != nil {
+ return x.Requests
+ }
+ return nil
+}
+
+// Request for listing `Chunk`s.
+type ListChunksRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Document` containing `Chunk`s.
+ // Example: `corpora/my-corpus-123/documents/the-doc-abc`
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // 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.
+ PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // 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.
+ PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *ListChunksRequest) Reset() {
+ *x = ListChunksRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[26]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListChunksRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListChunksRequest) ProtoMessage() {}
+
+func (x *ListChunksRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[26]
+ 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 ListChunksRequest.ProtoReflect.Descriptor instead.
+func (*ListChunksRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{26}
+}
+
+func (x *ListChunksRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *ListChunksRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListChunksRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+// Response from `ListChunks` containing a paginated list of `Chunk`s.
+// The `Chunk`s are sorted by ascending `chunk.create_time`.
+type ListChunksResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The returned `Chunk`s.
+ Chunks []*Chunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no more pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *ListChunksResponse) Reset() {
+ *x = ListChunksResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[27]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ListChunksResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListChunksResponse) ProtoMessage() {}
+
+func (x *ListChunksResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[27]
+ 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 ListChunksResponse.ProtoReflect.Descriptor instead.
+func (*ListChunksResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP(), []int{27}
+}
+
+func (x *ListChunksResponse) GetChunks() []*Chunk {
+ if x != nil {
+ return x.Chunks
+ }
+ return nil
+}
+
+func (x *ListChunksResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+var File_google_ai_generativelanguage_v1beta_retriever_service_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDesc = []byte{
+ 0x0a, 0x3b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x5f,
+ 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x1a, 0x33, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65,
+ 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
+ 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64,
+ 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+ 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74,
+ 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d,
+ 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x13, 0x43, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x12, 0x48, 0x0a, 0x06, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x06, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x22, 0x58, 0x0a, 0x10, 0x47, 0x65,
+ 0x74, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44,
+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xe0, 0x41,
+ 0x02, 0xfa, 0x41, 0x2a, 0x0a, 0x28, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61,
+ 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43,
+ 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x06,
+ 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06,
+ 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69,
+ 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x76, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x44, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xe0,
+ 0x41, 0x02, 0xfa, 0x41, 0x2a, 0x0a, 0x28, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65,
+ 0x22, 0x5a, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73,
+ 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08,
+ 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65,
+ 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
+ 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x84, 0x01, 0x0a,
+ 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x18,
+ 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x72, 0x70,
+ 0x75, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x12, 0x26, 0x0a, 0x0f, 0x6e,
+ 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f,
+ 0x6b, 0x65, 0x6e, 0x22, 0x84, 0x02, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x72,
+ 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2a,
+ 0x0a, 0x28, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+ 0x12, 0x19, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x63, 0x0a, 0x10, 0x6d,
+ 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18,
+ 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61,
+ 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52,
+ 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73,
+ 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e,
+ 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65,
+ 0x73, 0x75, 0x6c, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x72, 0x0a, 0x13, 0x51, 0x75,
+ 0x65, 0x72, 0x79, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x12, 0x5b, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x5f, 0x63, 0x68,
+ 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x0e,
+ 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x85,
+ 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b,
+ 0x12, 0x32, 0x0a, 0x15, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61,
+ 0x6e, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52,
+ 0x13, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x53,
+ 0x63, 0x6f, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52,
+ 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0xb3, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x12, 0x4a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x32, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x12, 0x2a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x08,
+ 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x5c, 0x0a, 0x12,
+ 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x32, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x0a, 0x2a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x15, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
+ 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c,
+ 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x7a, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0,
+ 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x0a, 0x2a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x66, 0x6f, 0x72,
+ 0x63, 0x65, 0x22, 0xa8, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a, 0x06, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0, 0x41, 0x02,
+ 0xfa, 0x41, 0x2c, 0x12, 0x2a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52,
+ 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f,
+ 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52,
+ 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67,
+ 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8c, 0x01,
+ 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67,
+ 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e,
+ 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x88, 0x02, 0x0a,
+ 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x32, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x2c, 0x0a, 0x2a, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a,
+ 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
+ 0x02, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x75,
+ 0x6c, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42,
+ 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x43, 0x6f, 0x75,
+ 0x6e, 0x74, 0x12, 0x63, 0x0a, 0x10, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65,
+ 0x72, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
+ 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x74, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79,
+ 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x12, 0x5b, 0x0a, 0x0f, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x5f, 0x63, 0x68, 0x75,
+ 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x52, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x0e, 0x72,
+ 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0xa4, 0x01,
+ 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x12, 0x27, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
+ 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x45, 0x0a,
+ 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x63,
+ 0x68, 0x75, 0x6e, 0x6b, 0x22, 0xbd, 0x01, 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x47, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x29, 0x12, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x68, 0x75,
+ 0x6e, 0x6b, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x58, 0x0a, 0x08, 0x72, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x73, 0x22, 0x5f, 0x0a, 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x12, 0x42, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63,
+ 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x56, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e,
+ 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x9d, 0x01,
+ 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x40, 0x0a, 0x0b, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41,
+ 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0xbd, 0x01,
+ 0x0a, 0x18, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75,
+ 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x06, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x01, 0xfa,
+ 0x41, 0x29, 0x12, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x12, 0x58, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18,
+ 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x03,
+ 0xe0, 0x41, 0x02, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0x5f, 0x0a,
+ 0x19, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e,
+ 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x06, 0x63, 0x68,
+ 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x59,
+ 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x68,
+ 0x75, 0x6e, 0x6b, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xbd, 0x01, 0x0a, 0x18, 0x42, 0x61,
+ 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x29, 0x12, 0x27,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12,
+ 0x58, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68,
+ 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x11, 0x4c, 0x69,
+ 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x47, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x12, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x68, 0x75, 0x6e, 0x6b,
+ 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65,
+ 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61,
+ 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
+ 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80,
+ 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18,
+ 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e,
+ 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78,
+ 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x32, 0xf4, 0x1c, 0x0a, 0x10, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x22, 0x28,
+ 0xda, 0x41, 0x06, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a,
+ 0x06, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2f, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x12, 0x98, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74,
+ 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74,
+ 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x22, 0x27, 0xda, 0x41, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61,
+ 0x2f, 0x2a, 0x7d, 0x12, 0xbb, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f,
+ 0x72, 0x70, 0x75, 0x73, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x22, 0x44, 0xda, 0x41, 0x12,
+ 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,
+ 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x06, 0x63, 0x6f, 0x72, 0x70, 0x75, 0x73,
+ 0x32, 0x1f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x63, 0x6f, 0x72, 0x70, 0x75,
+ 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a,
+ 0x7d, 0x12, 0x89, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x72, 0x70,
+ 0x75, 0x73, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43,
+ 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
+ 0x6d, 0x70, 0x74, 0x79, 0x22, 0x27, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x7d, 0x12, 0x99, 0x01,
+ 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x12, 0x37, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73,
+ 0x74, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x12, 0xab, 0x01, 0x0a, 0x0b, 0x51, 0x75,
+ 0x65, 0x72, 0x79, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f,
+ 0x72, 0x70, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a,
+ 0x7d, 0x3a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0xc5, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x48, 0xda, 0x41, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x2c, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x3a,
+ 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f,
+ 0x72, 0x61, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12,
+ 0xaa, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12,
+ 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f,
+ 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f,
+ 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xd3, 0x01, 0x0a,
+ 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12,
+ 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x56, 0xda, 0x41, 0x14, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
+ 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x3a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x32, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70,
+ 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f,
+ 0x2a, 0x7d, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x2a, 0x24, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f,
+ 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xbd,
+ 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72,
+ 0x61, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0xbd,
+ 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x12, 0x39, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a,
+ 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0xbf,
+ 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x37,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68,
+ 0x75, 0x6e, 0x6b, 0x22, 0x4b, 0xda, 0x41, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x63,
+ 0x68, 0x75, 0x6e, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a, 0x05, 0x63, 0x68, 0x75, 0x6e,
+ 0x6b, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73,
+ 0x12, 0xd8, 0x01, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x3d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74,
+ 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63,
+ 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a,
+ 0x22, 0x39, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x3a,
+ 0x62, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0xaa, 0x01, 0x0a, 0x08,
+ 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47,
+ 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x3c, 0xda, 0x41, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61,
+ 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63,
+ 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xca, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c,
+ 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x56, 0xda,
+ 0x41, 0x11, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
+ 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3c, 0x3a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b,
+ 0x32, 0x33, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x63, 0x68, 0x75, 0x6e, 0x6b,
+ 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f,
+ 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x68, 0x75, 0x6e,
+ 0x6b, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xd8, 0x01, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x3d, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74,
+ 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75,
+ 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e,
+ 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a,
+ 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x68,
+ 0x75, 0x6e, 0x6b, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x12, 0x9c, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b,
+ 0x12, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x75,
+ 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
+ 0x79, 0x22, 0x3c, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f,
+ 0x2a, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x2f, 0x2a, 0x7d, 0x12,
+ 0xb0, 0x01, 0x0a, 0x11, 0x42, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43,
+ 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x3d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61,
+ 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63,
+ 0x68, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x44, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x3e, 0x3a, 0x01, 0x2a, 0x22, 0x39, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61,
+ 0x2f, 0x2a, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f,
+ 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x12, 0xbd, 0x01, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b,
+ 0x73, 0x12, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e,
+ 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x3e, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x2f, 0x2a, 0x2f, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x68, 0x75, 0x6e,
+ 0x6b, 0x73, 0x1a, 0x24, 0xca, 0x41, 0x21, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0xa1, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x42, 0x15, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x72, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63,
+ 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
+ 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescData = file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes = make([]protoimpl.MessageInfo, 28)
+var file_google_ai_generativelanguage_v1beta_retriever_service_proto_goTypes = []interface{}{
+ (*CreateCorpusRequest)(nil), // 0: google.ai.generativelanguage.v1beta.CreateCorpusRequest
+ (*GetCorpusRequest)(nil), // 1: google.ai.generativelanguage.v1beta.GetCorpusRequest
+ (*UpdateCorpusRequest)(nil), // 2: google.ai.generativelanguage.v1beta.UpdateCorpusRequest
+ (*DeleteCorpusRequest)(nil), // 3: google.ai.generativelanguage.v1beta.DeleteCorpusRequest
+ (*ListCorporaRequest)(nil), // 4: google.ai.generativelanguage.v1beta.ListCorporaRequest
+ (*ListCorporaResponse)(nil), // 5: google.ai.generativelanguage.v1beta.ListCorporaResponse
+ (*QueryCorpusRequest)(nil), // 6: google.ai.generativelanguage.v1beta.QueryCorpusRequest
+ (*QueryCorpusResponse)(nil), // 7: google.ai.generativelanguage.v1beta.QueryCorpusResponse
+ (*RelevantChunk)(nil), // 8: google.ai.generativelanguage.v1beta.RelevantChunk
+ (*CreateDocumentRequest)(nil), // 9: google.ai.generativelanguage.v1beta.CreateDocumentRequest
+ (*GetDocumentRequest)(nil), // 10: google.ai.generativelanguage.v1beta.GetDocumentRequest
+ (*UpdateDocumentRequest)(nil), // 11: google.ai.generativelanguage.v1beta.UpdateDocumentRequest
+ (*DeleteDocumentRequest)(nil), // 12: google.ai.generativelanguage.v1beta.DeleteDocumentRequest
+ (*ListDocumentsRequest)(nil), // 13: google.ai.generativelanguage.v1beta.ListDocumentsRequest
+ (*ListDocumentsResponse)(nil), // 14: google.ai.generativelanguage.v1beta.ListDocumentsResponse
+ (*QueryDocumentRequest)(nil), // 15: google.ai.generativelanguage.v1beta.QueryDocumentRequest
+ (*QueryDocumentResponse)(nil), // 16: google.ai.generativelanguage.v1beta.QueryDocumentResponse
+ (*CreateChunkRequest)(nil), // 17: google.ai.generativelanguage.v1beta.CreateChunkRequest
+ (*BatchCreateChunksRequest)(nil), // 18: google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
+ (*BatchCreateChunksResponse)(nil), // 19: google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
+ (*GetChunkRequest)(nil), // 20: google.ai.generativelanguage.v1beta.GetChunkRequest
+ (*UpdateChunkRequest)(nil), // 21: google.ai.generativelanguage.v1beta.UpdateChunkRequest
+ (*BatchUpdateChunksRequest)(nil), // 22: google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
+ (*BatchUpdateChunksResponse)(nil), // 23: google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
+ (*DeleteChunkRequest)(nil), // 24: google.ai.generativelanguage.v1beta.DeleteChunkRequest
+ (*BatchDeleteChunksRequest)(nil), // 25: google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
+ (*ListChunksRequest)(nil), // 26: google.ai.generativelanguage.v1beta.ListChunksRequest
+ (*ListChunksResponse)(nil), // 27: google.ai.generativelanguage.v1beta.ListChunksResponse
+ (*Corpus)(nil), // 28: google.ai.generativelanguage.v1beta.Corpus
+ (*fieldmaskpb.FieldMask)(nil), // 29: google.protobuf.FieldMask
+ (*MetadataFilter)(nil), // 30: google.ai.generativelanguage.v1beta.MetadataFilter
+ (*Chunk)(nil), // 31: google.ai.generativelanguage.v1beta.Chunk
+ (*Document)(nil), // 32: google.ai.generativelanguage.v1beta.Document
+ (*emptypb.Empty)(nil), // 33: google.protobuf.Empty
+}
+var file_google_ai_generativelanguage_v1beta_retriever_service_proto_depIdxs = []int32{
+ 28, // 0: google.ai.generativelanguage.v1beta.CreateCorpusRequest.corpus:type_name -> google.ai.generativelanguage.v1beta.Corpus
+ 28, // 1: google.ai.generativelanguage.v1beta.UpdateCorpusRequest.corpus:type_name -> google.ai.generativelanguage.v1beta.Corpus
+ 29, // 2: google.ai.generativelanguage.v1beta.UpdateCorpusRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 28, // 3: google.ai.generativelanguage.v1beta.ListCorporaResponse.corpora:type_name -> google.ai.generativelanguage.v1beta.Corpus
+ 30, // 4: google.ai.generativelanguage.v1beta.QueryCorpusRequest.metadata_filters:type_name -> google.ai.generativelanguage.v1beta.MetadataFilter
+ 8, // 5: google.ai.generativelanguage.v1beta.QueryCorpusResponse.relevant_chunks:type_name -> google.ai.generativelanguage.v1beta.RelevantChunk
+ 31, // 6: google.ai.generativelanguage.v1beta.RelevantChunk.chunk:type_name -> google.ai.generativelanguage.v1beta.Chunk
+ 32, // 7: google.ai.generativelanguage.v1beta.CreateDocumentRequest.document:type_name -> google.ai.generativelanguage.v1beta.Document
+ 32, // 8: google.ai.generativelanguage.v1beta.UpdateDocumentRequest.document:type_name -> google.ai.generativelanguage.v1beta.Document
+ 29, // 9: google.ai.generativelanguage.v1beta.UpdateDocumentRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 32, // 10: google.ai.generativelanguage.v1beta.ListDocumentsResponse.documents:type_name -> google.ai.generativelanguage.v1beta.Document
+ 30, // 11: google.ai.generativelanguage.v1beta.QueryDocumentRequest.metadata_filters:type_name -> google.ai.generativelanguage.v1beta.MetadataFilter
+ 8, // 12: google.ai.generativelanguage.v1beta.QueryDocumentResponse.relevant_chunks:type_name -> google.ai.generativelanguage.v1beta.RelevantChunk
+ 31, // 13: google.ai.generativelanguage.v1beta.CreateChunkRequest.chunk:type_name -> google.ai.generativelanguage.v1beta.Chunk
+ 17, // 14: google.ai.generativelanguage.v1beta.BatchCreateChunksRequest.requests:type_name -> google.ai.generativelanguage.v1beta.CreateChunkRequest
+ 31, // 15: google.ai.generativelanguage.v1beta.BatchCreateChunksResponse.chunks:type_name -> google.ai.generativelanguage.v1beta.Chunk
+ 31, // 16: google.ai.generativelanguage.v1beta.UpdateChunkRequest.chunk:type_name -> google.ai.generativelanguage.v1beta.Chunk
+ 29, // 17: google.ai.generativelanguage.v1beta.UpdateChunkRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 21, // 18: google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest.requests:type_name -> google.ai.generativelanguage.v1beta.UpdateChunkRequest
+ 31, // 19: google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse.chunks:type_name -> google.ai.generativelanguage.v1beta.Chunk
+ 24, // 20: google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest.requests:type_name -> google.ai.generativelanguage.v1beta.DeleteChunkRequest
+ 31, // 21: google.ai.generativelanguage.v1beta.ListChunksResponse.chunks:type_name -> google.ai.generativelanguage.v1beta.Chunk
+ 0, // 22: google.ai.generativelanguage.v1beta.RetrieverService.CreateCorpus:input_type -> google.ai.generativelanguage.v1beta.CreateCorpusRequest
+ 1, // 23: google.ai.generativelanguage.v1beta.RetrieverService.GetCorpus:input_type -> google.ai.generativelanguage.v1beta.GetCorpusRequest
+ 2, // 24: google.ai.generativelanguage.v1beta.RetrieverService.UpdateCorpus:input_type -> google.ai.generativelanguage.v1beta.UpdateCorpusRequest
+ 3, // 25: google.ai.generativelanguage.v1beta.RetrieverService.DeleteCorpus:input_type -> google.ai.generativelanguage.v1beta.DeleteCorpusRequest
+ 4, // 26: google.ai.generativelanguage.v1beta.RetrieverService.ListCorpora:input_type -> google.ai.generativelanguage.v1beta.ListCorporaRequest
+ 6, // 27: google.ai.generativelanguage.v1beta.RetrieverService.QueryCorpus:input_type -> google.ai.generativelanguage.v1beta.QueryCorpusRequest
+ 9, // 28: google.ai.generativelanguage.v1beta.RetrieverService.CreateDocument:input_type -> google.ai.generativelanguage.v1beta.CreateDocumentRequest
+ 10, // 29: google.ai.generativelanguage.v1beta.RetrieverService.GetDocument:input_type -> google.ai.generativelanguage.v1beta.GetDocumentRequest
+ 11, // 30: google.ai.generativelanguage.v1beta.RetrieverService.UpdateDocument:input_type -> google.ai.generativelanguage.v1beta.UpdateDocumentRequest
+ 12, // 31: google.ai.generativelanguage.v1beta.RetrieverService.DeleteDocument:input_type -> google.ai.generativelanguage.v1beta.DeleteDocumentRequest
+ 13, // 32: google.ai.generativelanguage.v1beta.RetrieverService.ListDocuments:input_type -> google.ai.generativelanguage.v1beta.ListDocumentsRequest
+ 15, // 33: google.ai.generativelanguage.v1beta.RetrieverService.QueryDocument:input_type -> google.ai.generativelanguage.v1beta.QueryDocumentRequest
+ 17, // 34: google.ai.generativelanguage.v1beta.RetrieverService.CreateChunk:input_type -> google.ai.generativelanguage.v1beta.CreateChunkRequest
+ 18, // 35: google.ai.generativelanguage.v1beta.RetrieverService.BatchCreateChunks:input_type -> google.ai.generativelanguage.v1beta.BatchCreateChunksRequest
+ 20, // 36: google.ai.generativelanguage.v1beta.RetrieverService.GetChunk:input_type -> google.ai.generativelanguage.v1beta.GetChunkRequest
+ 21, // 37: google.ai.generativelanguage.v1beta.RetrieverService.UpdateChunk:input_type -> google.ai.generativelanguage.v1beta.UpdateChunkRequest
+ 22, // 38: google.ai.generativelanguage.v1beta.RetrieverService.BatchUpdateChunks:input_type -> google.ai.generativelanguage.v1beta.BatchUpdateChunksRequest
+ 24, // 39: google.ai.generativelanguage.v1beta.RetrieverService.DeleteChunk:input_type -> google.ai.generativelanguage.v1beta.DeleteChunkRequest
+ 25, // 40: google.ai.generativelanguage.v1beta.RetrieverService.BatchDeleteChunks:input_type -> google.ai.generativelanguage.v1beta.BatchDeleteChunksRequest
+ 26, // 41: google.ai.generativelanguage.v1beta.RetrieverService.ListChunks:input_type -> google.ai.generativelanguage.v1beta.ListChunksRequest
+ 28, // 42: google.ai.generativelanguage.v1beta.RetrieverService.CreateCorpus:output_type -> google.ai.generativelanguage.v1beta.Corpus
+ 28, // 43: google.ai.generativelanguage.v1beta.RetrieverService.GetCorpus:output_type -> google.ai.generativelanguage.v1beta.Corpus
+ 28, // 44: google.ai.generativelanguage.v1beta.RetrieverService.UpdateCorpus:output_type -> google.ai.generativelanguage.v1beta.Corpus
+ 33, // 45: google.ai.generativelanguage.v1beta.RetrieverService.DeleteCorpus:output_type -> google.protobuf.Empty
+ 5, // 46: google.ai.generativelanguage.v1beta.RetrieverService.ListCorpora:output_type -> google.ai.generativelanguage.v1beta.ListCorporaResponse
+ 7, // 47: google.ai.generativelanguage.v1beta.RetrieverService.QueryCorpus:output_type -> google.ai.generativelanguage.v1beta.QueryCorpusResponse
+ 32, // 48: google.ai.generativelanguage.v1beta.RetrieverService.CreateDocument:output_type -> google.ai.generativelanguage.v1beta.Document
+ 32, // 49: google.ai.generativelanguage.v1beta.RetrieverService.GetDocument:output_type -> google.ai.generativelanguage.v1beta.Document
+ 32, // 50: google.ai.generativelanguage.v1beta.RetrieverService.UpdateDocument:output_type -> google.ai.generativelanguage.v1beta.Document
+ 33, // 51: google.ai.generativelanguage.v1beta.RetrieverService.DeleteDocument:output_type -> google.protobuf.Empty
+ 14, // 52: google.ai.generativelanguage.v1beta.RetrieverService.ListDocuments:output_type -> google.ai.generativelanguage.v1beta.ListDocumentsResponse
+ 16, // 53: google.ai.generativelanguage.v1beta.RetrieverService.QueryDocument:output_type -> google.ai.generativelanguage.v1beta.QueryDocumentResponse
+ 31, // 54: google.ai.generativelanguage.v1beta.RetrieverService.CreateChunk:output_type -> google.ai.generativelanguage.v1beta.Chunk
+ 19, // 55: google.ai.generativelanguage.v1beta.RetrieverService.BatchCreateChunks:output_type -> google.ai.generativelanguage.v1beta.BatchCreateChunksResponse
+ 31, // 56: google.ai.generativelanguage.v1beta.RetrieverService.GetChunk:output_type -> google.ai.generativelanguage.v1beta.Chunk
+ 31, // 57: google.ai.generativelanguage.v1beta.RetrieverService.UpdateChunk:output_type -> google.ai.generativelanguage.v1beta.Chunk
+ 23, // 58: google.ai.generativelanguage.v1beta.RetrieverService.BatchUpdateChunks:output_type -> google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse
+ 33, // 59: google.ai.generativelanguage.v1beta.RetrieverService.DeleteChunk:output_type -> google.protobuf.Empty
+ 33, // 60: google.ai.generativelanguage.v1beta.RetrieverService.BatchDeleteChunks:output_type -> google.protobuf.Empty
+ 27, // 61: google.ai.generativelanguage.v1beta.RetrieverService.ListChunks:output_type -> google.ai.generativelanguage.v1beta.ListChunksResponse
+ 42, // [42:62] is the sub-list for method output_type
+ 22, // [22:42] is the sub-list for method input_type
+ 22, // [22:22] is the sub-list for extension type_name
+ 22, // [22:22] is the sub-list for extension extendee
+ 0, // [0:22] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_retriever_service_proto_init() }
+func file_google_ai_generativelanguage_v1beta_retriever_service_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_retriever_service_proto != nil {
+ return
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateCorpusRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetCorpusRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateCorpusRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteCorpusRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListCorporaRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListCorporaResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*QueryCorpusRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*QueryCorpusResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*RelevantChunk); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateDocumentRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetDocumentRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateDocumentRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteDocumentRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListDocumentsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListDocumentsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*QueryDocumentRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*QueryDocumentResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateChunkRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchCreateChunksRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchCreateChunksResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetChunkRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateChunkRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchUpdateChunksRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchUpdateChunksResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteChunkRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchDeleteChunksRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListChunksRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ListChunksResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 28,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_retriever_service_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_retriever_service_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_retriever_service_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_retriever_service_proto = out.File
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_retriever_service_proto_depIdxs = nil
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConnInterface
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion6
+
+// RetrieverServiceClient is the client API for RetrieverService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type RetrieverServiceClient interface {
+ // Creates an empty `Corpus`.
+ CreateCorpus(ctx context.Context, in *CreateCorpusRequest, opts ...grpc.CallOption) (*Corpus, error)
+ // Gets information about a specific `Corpus`.
+ GetCorpus(ctx context.Context, in *GetCorpusRequest, opts ...grpc.CallOption) (*Corpus, error)
+ // Updates a `Corpus`.
+ UpdateCorpus(ctx context.Context, in *UpdateCorpusRequest, opts ...grpc.CallOption) (*Corpus, error)
+ // Deletes a `Corpus`.
+ DeleteCorpus(ctx context.Context, in *DeleteCorpusRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ // Lists all `Corpora` owned by the user.
+ ListCorpora(ctx context.Context, in *ListCorporaRequest, opts ...grpc.CallOption) (*ListCorporaResponse, error)
+ // Performs semantic search over a `Corpus`.
+ QueryCorpus(ctx context.Context, in *QueryCorpusRequest, opts ...grpc.CallOption) (*QueryCorpusResponse, error)
+ // Creates an empty `Document`.
+ CreateDocument(ctx context.Context, in *CreateDocumentRequest, opts ...grpc.CallOption) (*Document, error)
+ // Gets information about a specific `Document`.
+ GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error)
+ // Updates a `Document`.
+ UpdateDocument(ctx context.Context, in *UpdateDocumentRequest, opts ...grpc.CallOption) (*Document, error)
+ // Deletes a `Document`.
+ DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ // Lists all `Document`s in a `Corpus`.
+ ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error)
+ // Performs semantic search over a `Document`.
+ QueryDocument(ctx context.Context, in *QueryDocumentRequest, opts ...grpc.CallOption) (*QueryDocumentResponse, error)
+ // Creates a `Chunk`.
+ CreateChunk(ctx context.Context, in *CreateChunkRequest, opts ...grpc.CallOption) (*Chunk, error)
+ // Batch create `Chunk`s.
+ BatchCreateChunks(ctx context.Context, in *BatchCreateChunksRequest, opts ...grpc.CallOption) (*BatchCreateChunksResponse, error)
+ // Gets information about a specific `Chunk`.
+ GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*Chunk, error)
+ // Updates a `Chunk`.
+ UpdateChunk(ctx context.Context, in *UpdateChunkRequest, opts ...grpc.CallOption) (*Chunk, error)
+ // Batch update `Chunk`s.
+ BatchUpdateChunks(ctx context.Context, in *BatchUpdateChunksRequest, opts ...grpc.CallOption) (*BatchUpdateChunksResponse, error)
+ // Deletes a `Chunk`.
+ DeleteChunk(ctx context.Context, in *DeleteChunkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ // Batch delete `Chunk`s.
+ BatchDeleteChunks(ctx context.Context, in *BatchDeleteChunksRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ // Lists all `Chunk`s in a `Document`.
+ ListChunks(ctx context.Context, in *ListChunksRequest, opts ...grpc.CallOption) (*ListChunksResponse, error)
+}
+
+type retrieverServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewRetrieverServiceClient(cc grpc.ClientConnInterface) RetrieverServiceClient {
+ return &retrieverServiceClient{cc}
+}
+
+func (c *retrieverServiceClient) CreateCorpus(ctx context.Context, in *CreateCorpusRequest, opts ...grpc.CallOption) (*Corpus, error) {
+ out := new(Corpus)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/CreateCorpus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) GetCorpus(ctx context.Context, in *GetCorpusRequest, opts ...grpc.CallOption) (*Corpus, error) {
+ out := new(Corpus)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/GetCorpus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) UpdateCorpus(ctx context.Context, in *UpdateCorpusRequest, opts ...grpc.CallOption) (*Corpus, error) {
+ out := new(Corpus)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/UpdateCorpus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) DeleteCorpus(ctx context.Context, in *DeleteCorpusRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/DeleteCorpus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) ListCorpora(ctx context.Context, in *ListCorporaRequest, opts ...grpc.CallOption) (*ListCorporaResponse, error) {
+ out := new(ListCorporaResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/ListCorpora", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) QueryCorpus(ctx context.Context, in *QueryCorpusRequest, opts ...grpc.CallOption) (*QueryCorpusResponse, error) {
+ out := new(QueryCorpusResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/QueryCorpus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) CreateDocument(ctx context.Context, in *CreateDocumentRequest, opts ...grpc.CallOption) (*Document, error) {
+ out := new(Document)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/CreateDocument", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error) {
+ out := new(Document)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/GetDocument", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) UpdateDocument(ctx context.Context, in *UpdateDocumentRequest, opts ...grpc.CallOption) (*Document, error) {
+ out := new(Document)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/UpdateDocument", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/DeleteDocument", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error) {
+ out := new(ListDocumentsResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/ListDocuments", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) QueryDocument(ctx context.Context, in *QueryDocumentRequest, opts ...grpc.CallOption) (*QueryDocumentResponse, error) {
+ out := new(QueryDocumentResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/QueryDocument", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) CreateChunk(ctx context.Context, in *CreateChunkRequest, opts ...grpc.CallOption) (*Chunk, error) {
+ out := new(Chunk)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/CreateChunk", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) BatchCreateChunks(ctx context.Context, in *BatchCreateChunksRequest, opts ...grpc.CallOption) (*BatchCreateChunksResponse, error) {
+ out := new(BatchCreateChunksResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/BatchCreateChunks", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*Chunk, error) {
+ out := new(Chunk)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/GetChunk", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) UpdateChunk(ctx context.Context, in *UpdateChunkRequest, opts ...grpc.CallOption) (*Chunk, error) {
+ out := new(Chunk)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/UpdateChunk", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) BatchUpdateChunks(ctx context.Context, in *BatchUpdateChunksRequest, opts ...grpc.CallOption) (*BatchUpdateChunksResponse, error) {
+ out := new(BatchUpdateChunksResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/BatchUpdateChunks", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) DeleteChunk(ctx context.Context, in *DeleteChunkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/DeleteChunk", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) BatchDeleteChunks(ctx context.Context, in *BatchDeleteChunksRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/BatchDeleteChunks", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *retrieverServiceClient) ListChunks(ctx context.Context, in *ListChunksRequest, opts ...grpc.CallOption) (*ListChunksResponse, error) {
+ out := new(ListChunksResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.RetrieverService/ListChunks", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// RetrieverServiceServer is the server API for RetrieverService service.
+type RetrieverServiceServer interface {
+ // Creates an empty `Corpus`.
+ CreateCorpus(context.Context, *CreateCorpusRequest) (*Corpus, error)
+ // Gets information about a specific `Corpus`.
+ GetCorpus(context.Context, *GetCorpusRequest) (*Corpus, error)
+ // Updates a `Corpus`.
+ UpdateCorpus(context.Context, *UpdateCorpusRequest) (*Corpus, error)
+ // Deletes a `Corpus`.
+ DeleteCorpus(context.Context, *DeleteCorpusRequest) (*emptypb.Empty, error)
+ // Lists all `Corpora` owned by the user.
+ ListCorpora(context.Context, *ListCorporaRequest) (*ListCorporaResponse, error)
+ // Performs semantic search over a `Corpus`.
+ QueryCorpus(context.Context, *QueryCorpusRequest) (*QueryCorpusResponse, error)
+ // Creates an empty `Document`.
+ CreateDocument(context.Context, *CreateDocumentRequest) (*Document, error)
+ // Gets information about a specific `Document`.
+ GetDocument(context.Context, *GetDocumentRequest) (*Document, error)
+ // Updates a `Document`.
+ UpdateDocument(context.Context, *UpdateDocumentRequest) (*Document, error)
+ // Deletes a `Document`.
+ DeleteDocument(context.Context, *DeleteDocumentRequest) (*emptypb.Empty, error)
+ // Lists all `Document`s in a `Corpus`.
+ ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error)
+ // Performs semantic search over a `Document`.
+ QueryDocument(context.Context, *QueryDocumentRequest) (*QueryDocumentResponse, error)
+ // Creates a `Chunk`.
+ CreateChunk(context.Context, *CreateChunkRequest) (*Chunk, error)
+ // Batch create `Chunk`s.
+ BatchCreateChunks(context.Context, *BatchCreateChunksRequest) (*BatchCreateChunksResponse, error)
+ // Gets information about a specific `Chunk`.
+ GetChunk(context.Context, *GetChunkRequest) (*Chunk, error)
+ // Updates a `Chunk`.
+ UpdateChunk(context.Context, *UpdateChunkRequest) (*Chunk, error)
+ // Batch update `Chunk`s.
+ BatchUpdateChunks(context.Context, *BatchUpdateChunksRequest) (*BatchUpdateChunksResponse, error)
+ // Deletes a `Chunk`.
+ DeleteChunk(context.Context, *DeleteChunkRequest) (*emptypb.Empty, error)
+ // Batch delete `Chunk`s.
+ BatchDeleteChunks(context.Context, *BatchDeleteChunksRequest) (*emptypb.Empty, error)
+ // Lists all `Chunk`s in a `Document`.
+ ListChunks(context.Context, *ListChunksRequest) (*ListChunksResponse, error)
+}
+
+// UnimplementedRetrieverServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedRetrieverServiceServer struct {
+}
+
+func (*UnimplementedRetrieverServiceServer) CreateCorpus(context.Context, *CreateCorpusRequest) (*Corpus, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateCorpus not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) GetCorpus(context.Context, *GetCorpusRequest) (*Corpus, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetCorpus not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) UpdateCorpus(context.Context, *UpdateCorpusRequest) (*Corpus, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateCorpus not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) DeleteCorpus(context.Context, *DeleteCorpusRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteCorpus not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) ListCorpora(context.Context, *ListCorporaRequest) (*ListCorporaResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListCorpora not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) QueryCorpus(context.Context, *QueryCorpusRequest) (*QueryCorpusResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method QueryCorpus not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) CreateDocument(context.Context, *CreateDocumentRequest) (*Document, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateDocument not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) GetDocument(context.Context, *GetDocumentRequest) (*Document, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetDocument not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) UpdateDocument(context.Context, *UpdateDocumentRequest) (*Document, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateDocument not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) DeleteDocument(context.Context, *DeleteDocumentRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteDocument not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListDocuments not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) QueryDocument(context.Context, *QueryDocumentRequest) (*QueryDocumentResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method QueryDocument not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) CreateChunk(context.Context, *CreateChunkRequest) (*Chunk, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateChunk not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) BatchCreateChunks(context.Context, *BatchCreateChunksRequest) (*BatchCreateChunksResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method BatchCreateChunks not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) GetChunk(context.Context, *GetChunkRequest) (*Chunk, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetChunk not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) UpdateChunk(context.Context, *UpdateChunkRequest) (*Chunk, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateChunk not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) BatchUpdateChunks(context.Context, *BatchUpdateChunksRequest) (*BatchUpdateChunksResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method BatchUpdateChunks not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) DeleteChunk(context.Context, *DeleteChunkRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteChunk not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) BatchDeleteChunks(context.Context, *BatchDeleteChunksRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method BatchDeleteChunks not implemented")
+}
+func (*UnimplementedRetrieverServiceServer) ListChunks(context.Context, *ListChunksRequest) (*ListChunksResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListChunks not implemented")
+}
+
+func RegisterRetrieverServiceServer(s *grpc.Server, srv RetrieverServiceServer) {
+ s.RegisterService(&_RetrieverService_serviceDesc, srv)
+}
+
+func _RetrieverService_CreateCorpus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateCorpusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).CreateCorpus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/CreateCorpus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).CreateCorpus(ctx, req.(*CreateCorpusRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_GetCorpus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetCorpusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).GetCorpus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/GetCorpus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).GetCorpus(ctx, req.(*GetCorpusRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_UpdateCorpus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateCorpusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).UpdateCorpus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/UpdateCorpus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).UpdateCorpus(ctx, req.(*UpdateCorpusRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_DeleteCorpus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteCorpusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).DeleteCorpus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/DeleteCorpus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).DeleteCorpus(ctx, req.(*DeleteCorpusRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_ListCorpora_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListCorporaRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).ListCorpora(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/ListCorpora",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).ListCorpora(ctx, req.(*ListCorporaRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_QueryCorpus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryCorpusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).QueryCorpus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/QueryCorpus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).QueryCorpus(ctx, req.(*QueryCorpusRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_CreateDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateDocumentRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).CreateDocument(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/CreateDocument",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).CreateDocument(ctx, req.(*CreateDocumentRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_GetDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetDocumentRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).GetDocument(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/GetDocument",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).GetDocument(ctx, req.(*GetDocumentRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_UpdateDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateDocumentRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).UpdateDocument(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/UpdateDocument",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).UpdateDocument(ctx, req.(*UpdateDocumentRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_DeleteDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteDocumentRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).DeleteDocument(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/DeleteDocument",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).DeleteDocument(ctx, req.(*DeleteDocumentRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_ListDocuments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListDocumentsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).ListDocuments(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/ListDocuments",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).ListDocuments(ctx, req.(*ListDocumentsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_QueryDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryDocumentRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).QueryDocument(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/QueryDocument",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).QueryDocument(ctx, req.(*QueryDocumentRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_CreateChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateChunkRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).CreateChunk(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/CreateChunk",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).CreateChunk(ctx, req.(*CreateChunkRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_BatchCreateChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(BatchCreateChunksRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).BatchCreateChunks(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/BatchCreateChunks",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).BatchCreateChunks(ctx, req.(*BatchCreateChunksRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_GetChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetChunkRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).GetChunk(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/GetChunk",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).GetChunk(ctx, req.(*GetChunkRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_UpdateChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateChunkRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).UpdateChunk(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/UpdateChunk",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).UpdateChunk(ctx, req.(*UpdateChunkRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_BatchUpdateChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(BatchUpdateChunksRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).BatchUpdateChunks(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/BatchUpdateChunks",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).BatchUpdateChunks(ctx, req.(*BatchUpdateChunksRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_DeleteChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteChunkRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).DeleteChunk(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/DeleteChunk",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).DeleteChunk(ctx, req.(*DeleteChunkRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_BatchDeleteChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(BatchDeleteChunksRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).BatchDeleteChunks(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/BatchDeleteChunks",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).BatchDeleteChunks(ctx, req.(*BatchDeleteChunksRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _RetrieverService_ListChunks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListChunksRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RetrieverServiceServer).ListChunks(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.RetrieverService/ListChunks",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RetrieverServiceServer).ListChunks(ctx, req.(*ListChunksRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _RetrieverService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "google.ai.generativelanguage.v1beta.RetrieverService",
+ HandlerType: (*RetrieverServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "CreateCorpus",
+ Handler: _RetrieverService_CreateCorpus_Handler,
+ },
+ {
+ MethodName: "GetCorpus",
+ Handler: _RetrieverService_GetCorpus_Handler,
+ },
+ {
+ MethodName: "UpdateCorpus",
+ Handler: _RetrieverService_UpdateCorpus_Handler,
+ },
+ {
+ MethodName: "DeleteCorpus",
+ Handler: _RetrieverService_DeleteCorpus_Handler,
+ },
+ {
+ MethodName: "ListCorpora",
+ Handler: _RetrieverService_ListCorpora_Handler,
+ },
+ {
+ MethodName: "QueryCorpus",
+ Handler: _RetrieverService_QueryCorpus_Handler,
+ },
+ {
+ MethodName: "CreateDocument",
+ Handler: _RetrieverService_CreateDocument_Handler,
+ },
+ {
+ MethodName: "GetDocument",
+ Handler: _RetrieverService_GetDocument_Handler,
+ },
+ {
+ MethodName: "UpdateDocument",
+ Handler: _RetrieverService_UpdateDocument_Handler,
+ },
+ {
+ MethodName: "DeleteDocument",
+ Handler: _RetrieverService_DeleteDocument_Handler,
+ },
+ {
+ MethodName: "ListDocuments",
+ Handler: _RetrieverService_ListDocuments_Handler,
+ },
+ {
+ MethodName: "QueryDocument",
+ Handler: _RetrieverService_QueryDocument_Handler,
+ },
+ {
+ MethodName: "CreateChunk",
+ Handler: _RetrieverService_CreateChunk_Handler,
+ },
+ {
+ MethodName: "BatchCreateChunks",
+ Handler: _RetrieverService_BatchCreateChunks_Handler,
+ },
+ {
+ MethodName: "GetChunk",
+ Handler: _RetrieverService_GetChunk_Handler,
+ },
+ {
+ MethodName: "UpdateChunk",
+ Handler: _RetrieverService_UpdateChunk_Handler,
+ },
+ {
+ MethodName: "BatchUpdateChunks",
+ Handler: _RetrieverService_BatchUpdateChunks_Handler,
+ },
+ {
+ MethodName: "DeleteChunk",
+ Handler: _RetrieverService_DeleteChunk_Handler,
+ },
+ {
+ MethodName: "BatchDeleteChunks",
+ Handler: _RetrieverService_BatchDeleteChunks_Handler,
+ },
+ {
+ MethodName: "ListChunks",
+ Handler: _RetrieverService_ListChunks_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "google/ai/generativelanguage/v1beta/retriever_service.proto",
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/safety.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/safety.pb.go
new file mode 100644
index 000000000..039710ce9
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/safety.pb.go
@@ -0,0 +1,792 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/safety.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// The category of a rating.
+//
+// These categories cover various kinds of harms that developers
+// may wish to adjust.
+type HarmCategory int32
+
+const (
+ // Category is unspecified.
+ HarmCategory_HARM_CATEGORY_UNSPECIFIED HarmCategory = 0
+ // Negative or harmful comments targeting identity and/or protected attribute.
+ HarmCategory_HARM_CATEGORY_DEROGATORY HarmCategory = 1
+ // Content that is rude, disrespectful, or profane.
+ HarmCategory_HARM_CATEGORY_TOXICITY HarmCategory = 2
+ // Describes scenarios depicting violence against an individual or group, or
+ // general descriptions of gore.
+ HarmCategory_HARM_CATEGORY_VIOLENCE HarmCategory = 3
+ // Contains references to sexual acts or other lewd content.
+ HarmCategory_HARM_CATEGORY_SEXUAL HarmCategory = 4
+ // Promotes unchecked medical advice.
+ HarmCategory_HARM_CATEGORY_MEDICAL HarmCategory = 5
+ // Dangerous content that promotes, facilitates, or encourages harmful acts.
+ HarmCategory_HARM_CATEGORY_DANGEROUS HarmCategory = 6
+ // Harasment content.
+ HarmCategory_HARM_CATEGORY_HARASSMENT HarmCategory = 7
+ // Hate speech and content.
+ HarmCategory_HARM_CATEGORY_HATE_SPEECH HarmCategory = 8
+ // Sexually explicit content.
+ HarmCategory_HARM_CATEGORY_SEXUALLY_EXPLICIT HarmCategory = 9
+ // Dangerous content.
+ HarmCategory_HARM_CATEGORY_DANGEROUS_CONTENT HarmCategory = 10
+)
+
+// Enum value maps for HarmCategory.
+var (
+ HarmCategory_name = map[int32]string{
+ 0: "HARM_CATEGORY_UNSPECIFIED",
+ 1: "HARM_CATEGORY_DEROGATORY",
+ 2: "HARM_CATEGORY_TOXICITY",
+ 3: "HARM_CATEGORY_VIOLENCE",
+ 4: "HARM_CATEGORY_SEXUAL",
+ 5: "HARM_CATEGORY_MEDICAL",
+ 6: "HARM_CATEGORY_DANGEROUS",
+ 7: "HARM_CATEGORY_HARASSMENT",
+ 8: "HARM_CATEGORY_HATE_SPEECH",
+ 9: "HARM_CATEGORY_SEXUALLY_EXPLICIT",
+ 10: "HARM_CATEGORY_DANGEROUS_CONTENT",
+ }
+ HarmCategory_value = map[string]int32{
+ "HARM_CATEGORY_UNSPECIFIED": 0,
+ "HARM_CATEGORY_DEROGATORY": 1,
+ "HARM_CATEGORY_TOXICITY": 2,
+ "HARM_CATEGORY_VIOLENCE": 3,
+ "HARM_CATEGORY_SEXUAL": 4,
+ "HARM_CATEGORY_MEDICAL": 5,
+ "HARM_CATEGORY_DANGEROUS": 6,
+ "HARM_CATEGORY_HARASSMENT": 7,
+ "HARM_CATEGORY_HATE_SPEECH": 8,
+ "HARM_CATEGORY_SEXUALLY_EXPLICIT": 9,
+ "HARM_CATEGORY_DANGEROUS_CONTENT": 10,
+ }
+)
+
+func (x HarmCategory) Enum() *HarmCategory {
+ p := new(HarmCategory)
+ *p = x
+ return p
+}
+
+func (x HarmCategory) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (HarmCategory) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[0].Descriptor()
+}
+
+func (HarmCategory) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[0]
+}
+
+func (x HarmCategory) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use HarmCategory.Descriptor instead.
+func (HarmCategory) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{0}
+}
+
+// A list of reasons why content may have been blocked.
+type ContentFilter_BlockedReason int32
+
+const (
+ // A blocked reason was not specified.
+ ContentFilter_BLOCKED_REASON_UNSPECIFIED ContentFilter_BlockedReason = 0
+ // Content was blocked by safety settings.
+ ContentFilter_SAFETY ContentFilter_BlockedReason = 1
+ // Content was blocked, but the reason is uncategorized.
+ ContentFilter_OTHER ContentFilter_BlockedReason = 2
+)
+
+// Enum value maps for ContentFilter_BlockedReason.
+var (
+ ContentFilter_BlockedReason_name = map[int32]string{
+ 0: "BLOCKED_REASON_UNSPECIFIED",
+ 1: "SAFETY",
+ 2: "OTHER",
+ }
+ ContentFilter_BlockedReason_value = map[string]int32{
+ "BLOCKED_REASON_UNSPECIFIED": 0,
+ "SAFETY": 1,
+ "OTHER": 2,
+ }
+)
+
+func (x ContentFilter_BlockedReason) Enum() *ContentFilter_BlockedReason {
+ p := new(ContentFilter_BlockedReason)
+ *p = x
+ return p
+}
+
+func (x ContentFilter_BlockedReason) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (ContentFilter_BlockedReason) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[1].Descriptor()
+}
+
+func (ContentFilter_BlockedReason) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[1]
+}
+
+func (x ContentFilter_BlockedReason) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use ContentFilter_BlockedReason.Descriptor instead.
+func (ContentFilter_BlockedReason) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{0, 0}
+}
+
+// The probability that a piece of content is harmful.
+//
+// The classification system gives the probability of the content being
+// unsafe. This does not indicate the severity of harm for a piece of content.
+type SafetyRating_HarmProbability int32
+
+const (
+ // Probability is unspecified.
+ SafetyRating_HARM_PROBABILITY_UNSPECIFIED SafetyRating_HarmProbability = 0
+ // Content has a negligible chance of being unsafe.
+ SafetyRating_NEGLIGIBLE SafetyRating_HarmProbability = 1
+ // Content has a low chance of being unsafe.
+ SafetyRating_LOW SafetyRating_HarmProbability = 2
+ // Content has a medium chance of being unsafe.
+ SafetyRating_MEDIUM SafetyRating_HarmProbability = 3
+ // Content has a high chance of being unsafe.
+ SafetyRating_HIGH SafetyRating_HarmProbability = 4
+)
+
+// Enum value maps for SafetyRating_HarmProbability.
+var (
+ SafetyRating_HarmProbability_name = map[int32]string{
+ 0: "HARM_PROBABILITY_UNSPECIFIED",
+ 1: "NEGLIGIBLE",
+ 2: "LOW",
+ 3: "MEDIUM",
+ 4: "HIGH",
+ }
+ SafetyRating_HarmProbability_value = map[string]int32{
+ "HARM_PROBABILITY_UNSPECIFIED": 0,
+ "NEGLIGIBLE": 1,
+ "LOW": 2,
+ "MEDIUM": 3,
+ "HIGH": 4,
+ }
+)
+
+func (x SafetyRating_HarmProbability) Enum() *SafetyRating_HarmProbability {
+ p := new(SafetyRating_HarmProbability)
+ *p = x
+ return p
+}
+
+func (x SafetyRating_HarmProbability) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (SafetyRating_HarmProbability) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[2].Descriptor()
+}
+
+func (SafetyRating_HarmProbability) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[2]
+}
+
+func (x SafetyRating_HarmProbability) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use SafetyRating_HarmProbability.Descriptor instead.
+func (SafetyRating_HarmProbability) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{2, 0}
+}
+
+// Block at and beyond a specified harm probability.
+type SafetySetting_HarmBlockThreshold int32
+
+const (
+ // Threshold is unspecified.
+ SafetySetting_HARM_BLOCK_THRESHOLD_UNSPECIFIED SafetySetting_HarmBlockThreshold = 0
+ // Content with NEGLIGIBLE will be allowed.
+ SafetySetting_BLOCK_LOW_AND_ABOVE SafetySetting_HarmBlockThreshold = 1
+ // Content with NEGLIGIBLE and LOW will be allowed.
+ SafetySetting_BLOCK_MEDIUM_AND_ABOVE SafetySetting_HarmBlockThreshold = 2
+ // Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.
+ SafetySetting_BLOCK_ONLY_HIGH SafetySetting_HarmBlockThreshold = 3
+ // All content will be allowed.
+ SafetySetting_BLOCK_NONE SafetySetting_HarmBlockThreshold = 4
+)
+
+// Enum value maps for SafetySetting_HarmBlockThreshold.
+var (
+ SafetySetting_HarmBlockThreshold_name = map[int32]string{
+ 0: "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
+ 1: "BLOCK_LOW_AND_ABOVE",
+ 2: "BLOCK_MEDIUM_AND_ABOVE",
+ 3: "BLOCK_ONLY_HIGH",
+ 4: "BLOCK_NONE",
+ }
+ SafetySetting_HarmBlockThreshold_value = map[string]int32{
+ "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0,
+ "BLOCK_LOW_AND_ABOVE": 1,
+ "BLOCK_MEDIUM_AND_ABOVE": 2,
+ "BLOCK_ONLY_HIGH": 3,
+ "BLOCK_NONE": 4,
+ }
+)
+
+func (x SafetySetting_HarmBlockThreshold) Enum() *SafetySetting_HarmBlockThreshold {
+ p := new(SafetySetting_HarmBlockThreshold)
+ *p = x
+ return p
+}
+
+func (x SafetySetting_HarmBlockThreshold) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (SafetySetting_HarmBlockThreshold) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[3].Descriptor()
+}
+
+func (SafetySetting_HarmBlockThreshold) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes[3]
+}
+
+func (x SafetySetting_HarmBlockThreshold) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use SafetySetting_HarmBlockThreshold.Descriptor instead.
+func (SafetySetting_HarmBlockThreshold) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{3, 0}
+}
+
+// Content filtering metadata associated with processing a single request.
+//
+// ContentFilter contains a reason and an optional supporting string. The reason
+// may be unspecified.
+type ContentFilter struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The reason content was blocked during request processing.
+ Reason ContentFilter_BlockedReason `protobuf:"varint,1,opt,name=reason,proto3,enum=google.ai.generativelanguage.v1beta.ContentFilter_BlockedReason" json:"reason,omitempty"`
+ // A string that describes the filtering behavior in more detail.
+ Message *string `protobuf:"bytes,2,opt,name=message,proto3,oneof" json:"message,omitempty"`
+}
+
+func (x *ContentFilter) Reset() {
+ *x = ContentFilter{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ContentFilter) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ContentFilter) ProtoMessage() {}
+
+func (x *ContentFilter) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_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 ContentFilter.ProtoReflect.Descriptor instead.
+func (*ContentFilter) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *ContentFilter) GetReason() ContentFilter_BlockedReason {
+ if x != nil {
+ return x.Reason
+ }
+ return ContentFilter_BLOCKED_REASON_UNSPECIFIED
+}
+
+func (x *ContentFilter) GetMessage() string {
+ if x != nil && x.Message != nil {
+ return *x.Message
+ }
+ return ""
+}
+
+// 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.
+type SafetyFeedback struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Safety rating evaluated from content.
+ Rating *SafetyRating `protobuf:"bytes,1,opt,name=rating,proto3" json:"rating,omitempty"`
+ // Safety settings applied to the request.
+ Setting *SafetySetting `protobuf:"bytes,2,opt,name=setting,proto3" json:"setting,omitempty"`
+}
+
+func (x *SafetyFeedback) Reset() {
+ *x = SafetyFeedback{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SafetyFeedback) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SafetyFeedback) ProtoMessage() {}
+
+func (x *SafetyFeedback) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[1]
+ 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 SafetyFeedback.ProtoReflect.Descriptor instead.
+func (*SafetyFeedback) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *SafetyFeedback) GetRating() *SafetyRating {
+ if x != nil {
+ return x.Rating
+ }
+ return nil
+}
+
+func (x *SafetyFeedback) GetSetting() *SafetySetting {
+ if x != nil {
+ return x.Setting
+ }
+ return nil
+}
+
+// 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.
+type SafetyRating struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The category for this rating.
+ Category HarmCategory `protobuf:"varint,3,opt,name=category,proto3,enum=google.ai.generativelanguage.v1beta.HarmCategory" json:"category,omitempty"`
+ // Required. The probability of harm for this content.
+ Probability SafetyRating_HarmProbability `protobuf:"varint,4,opt,name=probability,proto3,enum=google.ai.generativelanguage.v1beta.SafetyRating_HarmProbability" json:"probability,omitempty"`
+ // Was this content blocked because of this rating?
+ Blocked bool `protobuf:"varint,5,opt,name=blocked,proto3" json:"blocked,omitempty"`
+}
+
+func (x *SafetyRating) Reset() {
+ *x = SafetyRating{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SafetyRating) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SafetyRating) ProtoMessage() {}
+
+func (x *SafetyRating) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[2]
+ 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 SafetyRating.ProtoReflect.Descriptor instead.
+func (*SafetyRating) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *SafetyRating) GetCategory() HarmCategory {
+ if x != nil {
+ return x.Category
+ }
+ return HarmCategory_HARM_CATEGORY_UNSPECIFIED
+}
+
+func (x *SafetyRating) GetProbability() SafetyRating_HarmProbability {
+ if x != nil {
+ return x.Probability
+ }
+ return SafetyRating_HARM_PROBABILITY_UNSPECIFIED
+}
+
+func (x *SafetyRating) GetBlocked() bool {
+ if x != nil {
+ return x.Blocked
+ }
+ return false
+}
+
+// Safety setting, affecting the safety-blocking behavior.
+//
+// Passing a safety setting for a category changes the allowed proability that
+// content is blocked.
+type SafetySetting struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The category for this setting.
+ Category HarmCategory `protobuf:"varint,3,opt,name=category,proto3,enum=google.ai.generativelanguage.v1beta.HarmCategory" json:"category,omitempty"`
+ // Required. Controls the probability threshold at which harm is blocked.
+ Threshold SafetySetting_HarmBlockThreshold `protobuf:"varint,4,opt,name=threshold,proto3,enum=google.ai.generativelanguage.v1beta.SafetySetting_HarmBlockThreshold" json:"threshold,omitempty"`
+}
+
+func (x *SafetySetting) Reset() {
+ *x = SafetySetting{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SafetySetting) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SafetySetting) ProtoMessage() {}
+
+func (x *SafetySetting) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[3]
+ 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 SafetySetting.ProtoReflect.Descriptor instead.
+func (*SafetySetting) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *SafetySetting) GetCategory() HarmCategory {
+ if x != nil {
+ return x.Category
+ }
+ return HarmCategory_HARM_CATEGORY_UNSPECIFIED
+}
+
+func (x *SafetySetting) GetThreshold() SafetySetting_HarmBlockThreshold {
+ if x != nil {
+ return x.Threshold
+ }
+ return SafetySetting_HARM_BLOCK_THRESHOLD_UNSPECIFIED
+}
+
+var File_google_ai_generativelanguage_v1beta_safety_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_safety_proto_rawDesc = []byte{
+ 0x0a, 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69,
+ 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x06, 0x72, 0x65,
+ 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x40, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x42,
+ 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65,
+ 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+ 0x88, 0x01, 0x01, 0x22, 0x46, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65,
+ 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x5f,
+ 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
+ 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x41, 0x46, 0x45, 0x54, 0x59, 0x10, 0x01,
+ 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x10, 0x02, 0x42, 0x0a, 0x0a, 0x08, 0x5f,
+ 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x53, 0x61, 0x66, 0x65,
+ 0x74, 0x79, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x49, 0x0a, 0x06, 0x72, 0x61,
+ 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x72,
+ 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x4c, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x61, 0x66,
+ 0x65, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74,
+ 0x69, 0x6e, 0x67, 0x22, 0xca, 0x02, 0x0a, 0x0c, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61,
+ 0x74, 0x69, 0x6e, 0x67, 0x12, 0x52, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x61, 0x72,
+ 0x6d, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08,
+ 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x68, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x62,
+ 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x41, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67,
+ 0x2e, 0x48, 0x61, 0x72, 0x6d, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
+ 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69,
+ 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x05, 0x20,
+ 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x62, 0x0a, 0x0f,
+ 0x48, 0x61, 0x72, 0x6d, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12,
+ 0x20, 0x0a, 0x1c, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x50, 0x52, 0x4f, 0x42, 0x41, 0x42, 0x49, 0x4c,
+ 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
+ 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x49, 0x42, 0x4c, 0x45, 0x10,
+ 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45,
+ 0x44, 0x49, 0x55, 0x4d, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x47, 0x48, 0x10, 0x04,
+ 0x22, 0xe4, 0x02, 0x0a, 0x0d, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69,
+ 0x6e, 0x67, 0x12, 0x52, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x61, 0x72, 0x6d, 0x43,
+ 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x63, 0x61,
+ 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x68, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
+ 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x48, 0x61,
+ 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64,
+ 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64,
+ 0x22, 0x94, 0x01, 0x0a, 0x12, 0x48, 0x61, 0x72, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x68,
+ 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x24, 0x0a, 0x20, 0x48, 0x41, 0x52, 0x4d, 0x5f,
+ 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x53, 0x48, 0x4f, 0x4c, 0x44, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a,
+ 0x13, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4c, 0x4f, 0x57, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x41,
+ 0x42, 0x4f, 0x56, 0x45, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f,
+ 0x4d, 0x45, 0x44, 0x49, 0x55, 0x4d, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x41, 0x42, 0x4f, 0x56, 0x45,
+ 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4f, 0x4e, 0x4c, 0x59,
+ 0x5f, 0x48, 0x49, 0x47, 0x48, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4c, 0x4f, 0x43, 0x4b,
+ 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x04, 0x2a, 0xdc, 0x02, 0x0a, 0x0c, 0x48, 0x61, 0x72, 0x6d,
+ 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x19, 0x48, 0x41, 0x52, 0x4d,
+ 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x48, 0x41, 0x52, 0x4d, 0x5f,
+ 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x44, 0x45, 0x52, 0x4f, 0x47, 0x41, 0x54,
+ 0x4f, 0x52, 0x59, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41,
+ 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x54, 0x4f, 0x58, 0x49, 0x43, 0x49, 0x54, 0x59, 0x10,
+ 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f,
+ 0x52, 0x59, 0x5f, 0x56, 0x49, 0x4f, 0x4c, 0x45, 0x4e, 0x43, 0x45, 0x10, 0x03, 0x12, 0x18, 0x0a,
+ 0x14, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x53,
+ 0x45, 0x58, 0x55, 0x41, 0x4c, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x41, 0x52, 0x4d, 0x5f,
+ 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x43, 0x41, 0x4c,
+ 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x17, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47,
+ 0x4f, 0x52, 0x59, 0x5f, 0x44, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x4f, 0x55, 0x53, 0x10, 0x06, 0x12,
+ 0x1c, 0x0a, 0x18, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59,
+ 0x5f, 0x48, 0x41, 0x52, 0x41, 0x53, 0x53, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x07, 0x12, 0x1d, 0x0a,
+ 0x19, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x48,
+ 0x41, 0x54, 0x45, 0x5f, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x10, 0x08, 0x12, 0x23, 0x0a, 0x1f,
+ 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x53, 0x45,
+ 0x58, 0x55, 0x41, 0x4c, 0x4c, 0x59, 0x5f, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10,
+ 0x09, 0x12, 0x23, 0x0a, 0x1f, 0x48, 0x41, 0x52, 0x4d, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f,
+ 0x52, 0x59, 0x5f, 0x44, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x4f, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4e,
+ 0x54, 0x45, 0x4e, 0x54, 0x10, 0x0a, 0x42, 0x97, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x42, 0x0b, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
+ 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62,
+ 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_safety_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_safety_proto_rawDescData = file_google_ai_generativelanguage_v1beta_safety_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_safety_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_safety_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_safety_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_safety_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_safety_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
+var file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
+var file_google_ai_generativelanguage_v1beta_safety_proto_goTypes = []interface{}{
+ (HarmCategory)(0), // 0: google.ai.generativelanguage.v1beta.HarmCategory
+ (ContentFilter_BlockedReason)(0), // 1: google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason
+ (SafetyRating_HarmProbability)(0), // 2: google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability
+ (SafetySetting_HarmBlockThreshold)(0), // 3: google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold
+ (*ContentFilter)(nil), // 4: google.ai.generativelanguage.v1beta.ContentFilter
+ (*SafetyFeedback)(nil), // 5: google.ai.generativelanguage.v1beta.SafetyFeedback
+ (*SafetyRating)(nil), // 6: google.ai.generativelanguage.v1beta.SafetyRating
+ (*SafetySetting)(nil), // 7: google.ai.generativelanguage.v1beta.SafetySetting
+}
+var file_google_ai_generativelanguage_v1beta_safety_proto_depIdxs = []int32{
+ 1, // 0: google.ai.generativelanguage.v1beta.ContentFilter.reason:type_name -> google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason
+ 6, // 1: google.ai.generativelanguage.v1beta.SafetyFeedback.rating:type_name -> google.ai.generativelanguage.v1beta.SafetyRating
+ 7, // 2: google.ai.generativelanguage.v1beta.SafetyFeedback.setting:type_name -> google.ai.generativelanguage.v1beta.SafetySetting
+ 0, // 3: google.ai.generativelanguage.v1beta.SafetyRating.category:type_name -> google.ai.generativelanguage.v1beta.HarmCategory
+ 2, // 4: google.ai.generativelanguage.v1beta.SafetyRating.probability:type_name -> google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability
+ 0, // 5: google.ai.generativelanguage.v1beta.SafetySetting.category:type_name -> google.ai.generativelanguage.v1beta.HarmCategory
+ 3, // 6: google.ai.generativelanguage.v1beta.SafetySetting.threshold:type_name -> google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold
+ 7, // [7:7] is the sub-list for method output_type
+ 7, // [7:7] is the sub-list for method input_type
+ 7, // [7:7] is the sub-list for extension type_name
+ 7, // [7:7] is the sub-list for extension extendee
+ 0, // [0:7] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_safety_proto_init() }
+func file_google_ai_generativelanguage_v1beta_safety_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_safety_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ContentFilter); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SafetyFeedback); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SafetyRating); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SafetySetting); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes[0].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_safety_proto_rawDesc,
+ NumEnums: 4,
+ NumMessages: 4,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_safety_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_safety_proto_depIdxs,
+ EnumInfos: file_google_ai_generativelanguage_v1beta_safety_proto_enumTypes,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_safety_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_safety_proto = out.File
+ file_google_ai_generativelanguage_v1beta_safety_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_safety_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_safety_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/text_service.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/text_service.pb.go
new file mode 100644
index 000000000..8484c9982
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/text_service.pb.go
@@ -0,0 +1,1455 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/text_service.proto
+
+package generativelanguagepb
+
+import (
+ context "context"
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// Request to generate a text completion response from the model.
+type GenerateTextRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Model` or `TunedModel` to use for generating the
+ // completion.
+ // Examples:
+ //
+ // models/text-bison-001
+ // tunedModels/sentence-translator-u3b7m
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // 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.
+ Prompt *TextPrompt `protobuf:"bytes,2,opt,name=prompt,proto3" json:"prompt,omitempty"`
+ // 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.
+ Temperature *float32 `protobuf:"fixed32,3,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"`
+ // Optional. Number of generated responses to return.
+ //
+ // This value must be between [1, 8], inclusive. If unset, this will default
+ // to 1.
+ CandidateCount *int32 `protobuf:"varint,4,opt,name=candidate_count,json=candidateCount,proto3,oneof" json:"candidate_count,omitempty"`
+ // 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.
+ MaxOutputTokens *int32 `protobuf:"varint,5,opt,name=max_output_tokens,json=maxOutputTokens,proto3,oneof" json:"max_output_tokens,omitempty"`
+ // 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.
+ TopP *float32 `protobuf:"fixed32,6,opt,name=top_p,json=topP,proto3,oneof" json:"top_p,omitempty"`
+ // 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.
+ TopK *int32 `protobuf:"varint,7,opt,name=top_k,json=topK,proto3,oneof" json:"top_k,omitempty"`
+ // 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.
+ SafetySettings []*SafetySetting `protobuf:"bytes,8,rep,name=safety_settings,json=safetySettings,proto3" json:"safety_settings,omitempty"`
+ // 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.
+ StopSequences []string `protobuf:"bytes,9,rep,name=stop_sequences,json=stopSequences,proto3" json:"stop_sequences,omitempty"`
+}
+
+func (x *GenerateTextRequest) Reset() {
+ *x = GenerateTextRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateTextRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateTextRequest) ProtoMessage() {}
+
+func (x *GenerateTextRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_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 GenerateTextRequest.ProtoReflect.Descriptor instead.
+func (*GenerateTextRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GenerateTextRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *GenerateTextRequest) GetPrompt() *TextPrompt {
+ if x != nil {
+ return x.Prompt
+ }
+ return nil
+}
+
+func (x *GenerateTextRequest) GetTemperature() float32 {
+ if x != nil && x.Temperature != nil {
+ return *x.Temperature
+ }
+ return 0
+}
+
+func (x *GenerateTextRequest) GetCandidateCount() int32 {
+ if x != nil && x.CandidateCount != nil {
+ return *x.CandidateCount
+ }
+ return 0
+}
+
+func (x *GenerateTextRequest) GetMaxOutputTokens() int32 {
+ if x != nil && x.MaxOutputTokens != nil {
+ return *x.MaxOutputTokens
+ }
+ return 0
+}
+
+func (x *GenerateTextRequest) GetTopP() float32 {
+ if x != nil && x.TopP != nil {
+ return *x.TopP
+ }
+ return 0
+}
+
+func (x *GenerateTextRequest) GetTopK() int32 {
+ if x != nil && x.TopK != nil {
+ return *x.TopK
+ }
+ return 0
+}
+
+func (x *GenerateTextRequest) GetSafetySettings() []*SafetySetting {
+ if x != nil {
+ return x.SafetySettings
+ }
+ return nil
+}
+
+func (x *GenerateTextRequest) GetStopSequences() []string {
+ if x != nil {
+ return x.StopSequences
+ }
+ return nil
+}
+
+// The response from the model, including candidate completions.
+type GenerateTextResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Candidate responses from the model.
+ Candidates []*TextCompletion `protobuf:"bytes,1,rep,name=candidates,proto3" json:"candidates,omitempty"`
+ // 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).
+ Filters []*ContentFilter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
+ // Returns any safety feedback related to content filtering.
+ SafetyFeedback []*SafetyFeedback `protobuf:"bytes,4,rep,name=safety_feedback,json=safetyFeedback,proto3" json:"safety_feedback,omitempty"`
+}
+
+func (x *GenerateTextResponse) Reset() {
+ *x = GenerateTextResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GenerateTextResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GenerateTextResponse) ProtoMessage() {}
+
+func (x *GenerateTextResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[1]
+ 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 GenerateTextResponse.ProtoReflect.Descriptor instead.
+func (*GenerateTextResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GenerateTextResponse) GetCandidates() []*TextCompletion {
+ if x != nil {
+ return x.Candidates
+ }
+ return nil
+}
+
+func (x *GenerateTextResponse) GetFilters() []*ContentFilter {
+ if x != nil {
+ return x.Filters
+ }
+ return nil
+}
+
+func (x *GenerateTextResponse) GetSafetyFeedback() []*SafetyFeedback {
+ if x != nil {
+ return x.SafetyFeedback
+ }
+ return nil
+}
+
+// Text given to the model as a prompt.
+//
+// The Model will use this TextPrompt to Generate a text completion.
+type TextPrompt struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The prompt text.
+ Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
+}
+
+func (x *TextPrompt) Reset() {
+ *x = TextPrompt{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TextPrompt) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TextPrompt) ProtoMessage() {}
+
+func (x *TextPrompt) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[2]
+ 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 TextPrompt.ProtoReflect.Descriptor instead.
+func (*TextPrompt) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *TextPrompt) GetText() string {
+ if x != nil {
+ return x.Text
+ }
+ return ""
+}
+
+// Output text returned from a model.
+type TextCompletion struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. The generated text returned from the model.
+ Output string `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
+ // Ratings for the safety of a response.
+ //
+ // There is at most one rating per category.
+ SafetyRatings []*SafetyRating `protobuf:"bytes,2,rep,name=safety_ratings,json=safetyRatings,proto3" json:"safety_ratings,omitempty"`
+ // 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`.
+ CitationMetadata *CitationMetadata `protobuf:"bytes,3,opt,name=citation_metadata,json=citationMetadata,proto3,oneof" json:"citation_metadata,omitempty"`
+}
+
+func (x *TextCompletion) Reset() {
+ *x = TextCompletion{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TextCompletion) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TextCompletion) ProtoMessage() {}
+
+func (x *TextCompletion) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[3]
+ 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 TextCompletion.ProtoReflect.Descriptor instead.
+func (*TextCompletion) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *TextCompletion) GetOutput() string {
+ if x != nil {
+ return x.Output
+ }
+ return ""
+}
+
+func (x *TextCompletion) GetSafetyRatings() []*SafetyRating {
+ if x != nil {
+ return x.SafetyRatings
+ }
+ return nil
+}
+
+func (x *TextCompletion) GetCitationMetadata() *CitationMetadata {
+ if x != nil {
+ return x.CitationMetadata
+ }
+ return nil
+}
+
+// Request to get a text embedding from the model.
+type EmbedTextRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The model name to use with the format model=models/{model}.
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // Optional. The free-form input text that the model will turn into an
+ // embedding.
+ Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
+}
+
+func (x *EmbedTextRequest) Reset() {
+ *x = EmbedTextRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *EmbedTextRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EmbedTextRequest) ProtoMessage() {}
+
+func (x *EmbedTextRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[4]
+ 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 EmbedTextRequest.ProtoReflect.Descriptor instead.
+func (*EmbedTextRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *EmbedTextRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *EmbedTextRequest) GetText() string {
+ if x != nil {
+ return x.Text
+ }
+ return ""
+}
+
+// The response to a EmbedTextRequest.
+type EmbedTextResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. The embedding generated from the input text.
+ Embedding *Embedding `protobuf:"bytes,1,opt,name=embedding,proto3,oneof" json:"embedding,omitempty"`
+}
+
+func (x *EmbedTextResponse) Reset() {
+ *x = EmbedTextResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *EmbedTextResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*EmbedTextResponse) ProtoMessage() {}
+
+func (x *EmbedTextResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[5]
+ 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 EmbedTextResponse.ProtoReflect.Descriptor instead.
+func (*EmbedTextResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *EmbedTextResponse) GetEmbedding() *Embedding {
+ if x != nil {
+ return x.Embedding
+ }
+ return nil
+}
+
+// Batch request to get a text embedding from the model.
+type BatchEmbedTextRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The name of the `Model` to use for generating the embedding.
+ // Examples:
+ //
+ // models/embedding-gecko-001
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // 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.
+ Texts []string `protobuf:"bytes,2,rep,name=texts,proto3" json:"texts,omitempty"`
+ // Optional. Embed requests for the batch. Only one of `texts` or `requests`
+ // can be set.
+ Requests []*EmbedTextRequest `protobuf:"bytes,3,rep,name=requests,proto3" json:"requests,omitempty"`
+}
+
+func (x *BatchEmbedTextRequest) Reset() {
+ *x = BatchEmbedTextRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchEmbedTextRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchEmbedTextRequest) ProtoMessage() {}
+
+func (x *BatchEmbedTextRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[6]
+ 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 BatchEmbedTextRequest.ProtoReflect.Descriptor instead.
+func (*BatchEmbedTextRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *BatchEmbedTextRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *BatchEmbedTextRequest) GetTexts() []string {
+ if x != nil {
+ return x.Texts
+ }
+ return nil
+}
+
+func (x *BatchEmbedTextRequest) GetRequests() []*EmbedTextRequest {
+ if x != nil {
+ return x.Requests
+ }
+ return nil
+}
+
+// The response to a EmbedTextRequest.
+type BatchEmbedTextResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. The embeddings generated from the input text.
+ Embeddings []*Embedding `protobuf:"bytes,1,rep,name=embeddings,proto3" json:"embeddings,omitempty"`
+}
+
+func (x *BatchEmbedTextResponse) Reset() {
+ *x = BatchEmbedTextResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *BatchEmbedTextResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*BatchEmbedTextResponse) ProtoMessage() {}
+
+func (x *BatchEmbedTextResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[7]
+ 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 BatchEmbedTextResponse.ProtoReflect.Descriptor instead.
+func (*BatchEmbedTextResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *BatchEmbedTextResponse) GetEmbeddings() []*Embedding {
+ if x != nil {
+ return x.Embeddings
+ }
+ return nil
+}
+
+// A list of floats representing the embedding.
+type Embedding struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The embedding values.
+ Value []float32 `protobuf:"fixed32,1,rep,packed,name=value,proto3" json:"value,omitempty"`
+}
+
+func (x *Embedding) Reset() {
+ *x = Embedding{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Embedding) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Embedding) ProtoMessage() {}
+
+func (x *Embedding) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[8]
+ 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 Embedding.ProtoReflect.Descriptor instead.
+func (*Embedding) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *Embedding) GetValue() []float32 {
+ if x != nil {
+ return x.Value
+ }
+ return nil
+}
+
+// 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 CountTextTokensRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // 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}`
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
+ // Required. The free-form input text given to the model as a prompt.
+ Prompt *TextPrompt `protobuf:"bytes,2,opt,name=prompt,proto3" json:"prompt,omitempty"`
+}
+
+func (x *CountTextTokensRequest) Reset() {
+ *x = CountTextTokensRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CountTextTokensRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CountTextTokensRequest) ProtoMessage() {}
+
+func (x *CountTextTokensRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[9]
+ 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 CountTextTokensRequest.ProtoReflect.Descriptor instead.
+func (*CountTextTokensRequest) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *CountTextTokensRequest) GetModel() string {
+ if x != nil {
+ return x.Model
+ }
+ return ""
+}
+
+func (x *CountTextTokensRequest) GetPrompt() *TextPrompt {
+ if x != nil {
+ return x.Prompt
+ }
+ return nil
+}
+
+// A response from `CountTextTokens`.
+//
+// It returns the model's `token_count` for the `prompt`.
+type CountTextTokensResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The number of tokens that the `model` tokenizes the `prompt` into.
+ //
+ // Always non-negative.
+ TokenCount int32 `protobuf:"varint,1,opt,name=token_count,json=tokenCount,proto3" json:"token_count,omitempty"`
+}
+
+func (x *CountTextTokensResponse) Reset() {
+ *x = CountTextTokensResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CountTextTokensResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CountTextTokensResponse) ProtoMessage() {}
+
+func (x *CountTextTokensResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[10]
+ 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 CountTextTokensResponse.ProtoReflect.Descriptor instead.
+func (*CountTextTokensResponse) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *CountTextTokensResponse) GetTokenCount() int32 {
+ if x != nil {
+ return x.TokenCount
+ }
+ return 0
+}
+
+var File_google_ai_generativelanguage_v1beta_text_service_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_text_service_proto_rawDesc = []byte{
+ 0x0a, 0x36, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
+ 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x32, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x1a, 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
+ 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c,
+ 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68,
+ 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x04, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19,
+ 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0,
+ 0x41, 0x02, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x4c, 0x0a, 0x06, 0x70, 0x72, 0x6f,
+ 0x6d, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x54, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x2a, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65,
+ 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41,
+ 0x01, 0x48, 0x00, 0x52, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65,
+ 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x0f, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65,
+ 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41,
+ 0x01, 0x48, 0x01, 0x52, 0x0e, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f,
+ 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x11, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x75,
+ 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
+ 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x4f, 0x75, 0x74,
+ 0x70, 0x75, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05,
+ 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x48, 0x03, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x50, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05, 0x74,
+ 0x6f, 0x70, 0x5f, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48,
+ 0x04, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4b, 0x88, 0x01, 0x01, 0x12, 0x60, 0x0a, 0x0f, 0x73, 0x61,
+ 0x66, 0x65, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x08, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79,
+ 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x73, 0x61,
+ 0x66, 0x65, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x25, 0x0a, 0x0e,
+ 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x09,
+ 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x70, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e,
+ 0x63, 0x65, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74,
+ 0x75, 0x72, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74,
+ 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x6d, 0x61, 0x78, 0x5f,
+ 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x42, 0x08, 0x0a,
+ 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f,
+ 0x6b, 0x22, 0x97, 0x02, 0x0a, 0x14, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65,
+ 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x63, 0x61,
+ 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33,
+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31,
+ 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,
+ 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12,
+ 0x4c, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
+ 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x46, 0x69,
+ 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x5c, 0x0a,
+ 0x0f, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x5f, 0x66, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b,
+ 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x53, 0x61, 0x66,
+ 0x65, 0x74, 0x79, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x0e, 0x73, 0x61, 0x66,
+ 0x65, 0x74, 0x79, 0x46, 0x65, 0x65, 0x64, 0x62, 0x61, 0x63, 0x6b, 0x22, 0x25, 0x0a, 0x0a, 0x54,
+ 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x78,
+ 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x74, 0x65,
+ 0x78, 0x74, 0x22, 0x8b, 0x02, 0x0a, 0x0e, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c,
+ 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70,
+ 0x75, 0x74, 0x12, 0x58, 0x0a, 0x0e, 0x73, 0x61, 0x66, 0x65, 0x74, 0x79, 0x5f, 0x72, 0x61, 0x74,
+ 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x53, 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73,
+ 0x61, 0x66, 0x65, 0x74, 0x79, 0x52, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x6c, 0x0a, 0x11,
+ 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+ 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x69,
+ 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x03,
+ 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x10, 0x63, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d,
+ 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x63,
+ 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
+ 0x22, 0x72, 0x0a, 0x10, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x74,
+ 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04,
+ 0x74, 0x65, 0x78, 0x74, 0x22, 0x79, 0x0a, 0x11, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78,
+ 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x09, 0x65, 0x6d, 0x62,
+ 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41,
+ 0x03, 0x48, 0x00, 0x52, 0x09, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x88, 0x01,
+ 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x22,
+ 0xd1, 0x01, 0x0a, 0x15, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65,
+ 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29,
+ 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x12, 0x19, 0x0a, 0x05, 0x74, 0x65, 0x78, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x56, 0x0a, 0x08, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62,
+ 0x65, 0x74, 0x61, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x73, 0x22, 0x6d, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65,
+ 0x64, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a,
+ 0x0a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e,
+ 0x67, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e,
+ 0x67, 0x73, 0x22, 0x21, 0x0a, 0x09, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x12,
+ 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x02, 0x52, 0x05,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x16, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54,
+ 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x12, 0x45, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x2f, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x29, 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x4c, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70,
+ 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x65,
+ 0x78, 0x74, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70,
+ 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x22, 0x3a, 0x0a, 0x17, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65,
+ 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x32, 0xc0, 0x07, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
+ 0x65, 0x12, 0xb0, 0x02, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65,
+ 0x78, 0x74, 0x12, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65, 0x78, 0x74, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x01, 0xda, 0x41, 0x46, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x2c, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x2c, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72,
+ 0x61, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f,
+ 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2c, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74,
+ 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2c, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x2c, 0x74, 0x6f,
+ 0x70, 0x5f, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x5b, 0x3a, 0x01, 0x2a, 0x5a, 0x2f, 0x3a, 0x01,
+ 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x3d, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d,
+ 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65, 0x78, 0x74, 0x22, 0x25, 0x2f,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
+ 0x54, 0x65, 0x78, 0x74, 0x12, 0xb6, 0x01, 0x0a, 0x09, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65,
+ 0x78, 0x74, 0x12, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65,
+ 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e,
+ 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x22, 0x3a, 0xda, 0x41, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x74, 0x65, 0x78, 0x74,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x3a, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x12, 0xcb, 0x01,
+ 0x0a, 0x0e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74,
+ 0x12, 0x3a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,
+ 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65,
+ 0x64, 0x54, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78,
+ 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0xda, 0x41, 0x0b, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a,
+ 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x62, 0x61, 0x74,
+ 0x63, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x54, 0x65, 0x78, 0x74, 0x12, 0xd0, 0x01, 0x0a, 0x0f,
+ 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12,
+ 0x3b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x78, 0x74, 0x54,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65,
+ 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0xda, 0x41, 0x0c, 0x6d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x2c, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x2d, 0x3a, 0x01, 0x2a, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x7b, 0x6d,
+ 0x6f, 0x64, 0x65, 0x6c, 0x3d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x1a, 0x24,
+ 0xca, 0x41, 0x21, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73,
+ 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0x9c, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x42, 0x10, 0x54, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f,
+ 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x3b, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67,
+ 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescData = file_google_ai_generativelanguage_v1beta_text_service_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_text_service_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
+var file_google_ai_generativelanguage_v1beta_text_service_proto_goTypes = []interface{}{
+ (*GenerateTextRequest)(nil), // 0: google.ai.generativelanguage.v1beta.GenerateTextRequest
+ (*GenerateTextResponse)(nil), // 1: google.ai.generativelanguage.v1beta.GenerateTextResponse
+ (*TextPrompt)(nil), // 2: google.ai.generativelanguage.v1beta.TextPrompt
+ (*TextCompletion)(nil), // 3: google.ai.generativelanguage.v1beta.TextCompletion
+ (*EmbedTextRequest)(nil), // 4: google.ai.generativelanguage.v1beta.EmbedTextRequest
+ (*EmbedTextResponse)(nil), // 5: google.ai.generativelanguage.v1beta.EmbedTextResponse
+ (*BatchEmbedTextRequest)(nil), // 6: google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
+ (*BatchEmbedTextResponse)(nil), // 7: google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
+ (*Embedding)(nil), // 8: google.ai.generativelanguage.v1beta.Embedding
+ (*CountTextTokensRequest)(nil), // 9: google.ai.generativelanguage.v1beta.CountTextTokensRequest
+ (*CountTextTokensResponse)(nil), // 10: google.ai.generativelanguage.v1beta.CountTextTokensResponse
+ (*SafetySetting)(nil), // 11: google.ai.generativelanguage.v1beta.SafetySetting
+ (*ContentFilter)(nil), // 12: google.ai.generativelanguage.v1beta.ContentFilter
+ (*SafetyFeedback)(nil), // 13: google.ai.generativelanguage.v1beta.SafetyFeedback
+ (*SafetyRating)(nil), // 14: google.ai.generativelanguage.v1beta.SafetyRating
+ (*CitationMetadata)(nil), // 15: google.ai.generativelanguage.v1beta.CitationMetadata
+}
+var file_google_ai_generativelanguage_v1beta_text_service_proto_depIdxs = []int32{
+ 2, // 0: google.ai.generativelanguage.v1beta.GenerateTextRequest.prompt:type_name -> google.ai.generativelanguage.v1beta.TextPrompt
+ 11, // 1: google.ai.generativelanguage.v1beta.GenerateTextRequest.safety_settings:type_name -> google.ai.generativelanguage.v1beta.SafetySetting
+ 3, // 2: google.ai.generativelanguage.v1beta.GenerateTextResponse.candidates:type_name -> google.ai.generativelanguage.v1beta.TextCompletion
+ 12, // 3: google.ai.generativelanguage.v1beta.GenerateTextResponse.filters:type_name -> google.ai.generativelanguage.v1beta.ContentFilter
+ 13, // 4: google.ai.generativelanguage.v1beta.GenerateTextResponse.safety_feedback:type_name -> google.ai.generativelanguage.v1beta.SafetyFeedback
+ 14, // 5: google.ai.generativelanguage.v1beta.TextCompletion.safety_ratings:type_name -> google.ai.generativelanguage.v1beta.SafetyRating
+ 15, // 6: google.ai.generativelanguage.v1beta.TextCompletion.citation_metadata:type_name -> google.ai.generativelanguage.v1beta.CitationMetadata
+ 8, // 7: google.ai.generativelanguage.v1beta.EmbedTextResponse.embedding:type_name -> google.ai.generativelanguage.v1beta.Embedding
+ 4, // 8: google.ai.generativelanguage.v1beta.BatchEmbedTextRequest.requests:type_name -> google.ai.generativelanguage.v1beta.EmbedTextRequest
+ 8, // 9: google.ai.generativelanguage.v1beta.BatchEmbedTextResponse.embeddings:type_name -> google.ai.generativelanguage.v1beta.Embedding
+ 2, // 10: google.ai.generativelanguage.v1beta.CountTextTokensRequest.prompt:type_name -> google.ai.generativelanguage.v1beta.TextPrompt
+ 0, // 11: google.ai.generativelanguage.v1beta.TextService.GenerateText:input_type -> google.ai.generativelanguage.v1beta.GenerateTextRequest
+ 4, // 12: google.ai.generativelanguage.v1beta.TextService.EmbedText:input_type -> google.ai.generativelanguage.v1beta.EmbedTextRequest
+ 6, // 13: google.ai.generativelanguage.v1beta.TextService.BatchEmbedText:input_type -> google.ai.generativelanguage.v1beta.BatchEmbedTextRequest
+ 9, // 14: google.ai.generativelanguage.v1beta.TextService.CountTextTokens:input_type -> google.ai.generativelanguage.v1beta.CountTextTokensRequest
+ 1, // 15: google.ai.generativelanguage.v1beta.TextService.GenerateText:output_type -> google.ai.generativelanguage.v1beta.GenerateTextResponse
+ 5, // 16: google.ai.generativelanguage.v1beta.TextService.EmbedText:output_type -> google.ai.generativelanguage.v1beta.EmbedTextResponse
+ 7, // 17: google.ai.generativelanguage.v1beta.TextService.BatchEmbedText:output_type -> google.ai.generativelanguage.v1beta.BatchEmbedTextResponse
+ 10, // 18: google.ai.generativelanguage.v1beta.TextService.CountTextTokens:output_type -> google.ai.generativelanguage.v1beta.CountTextTokensResponse
+ 15, // [15:19] is the sub-list for method output_type
+ 11, // [11:15] is the sub-list for method input_type
+ 11, // [11:11] is the sub-list for extension type_name
+ 11, // [11:11] is the sub-list for extension extendee
+ 0, // [0:11] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_text_service_proto_init() }
+func file_google_ai_generativelanguage_v1beta_text_service_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_text_service_proto != nil {
+ return
+ }
+ file_google_ai_generativelanguage_v1beta_citation_proto_init()
+ file_google_ai_generativelanguage_v1beta_safety_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateTextRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GenerateTextResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TextPrompt); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TextCompletion); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*EmbedTextRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*EmbedTextResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchEmbedTextRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*BatchEmbedTextResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Embedding); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CountTextTokensRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CountTextTokensResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[0].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[3].OneofWrappers = []interface{}{}
+ file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes[5].OneofWrappers = []interface{}{}
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_text_service_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 11,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_text_service_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_text_service_proto_depIdxs,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_text_service_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_text_service_proto = out.File
+ file_google_ai_generativelanguage_v1beta_text_service_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_text_service_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_text_service_proto_depIdxs = nil
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConnInterface
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion6
+
+// TextServiceClient is the client API for TextService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type TextServiceClient interface {
+ // Generates a response from the model given an input message.
+ GenerateText(ctx context.Context, in *GenerateTextRequest, opts ...grpc.CallOption) (*GenerateTextResponse, error)
+ // Generates an embedding from the model given an input message.
+ EmbedText(ctx context.Context, in *EmbedTextRequest, opts ...grpc.CallOption) (*EmbedTextResponse, error)
+ // Generates multiple embeddings from the model given input text in a
+ // synchronous call.
+ BatchEmbedText(ctx context.Context, in *BatchEmbedTextRequest, opts ...grpc.CallOption) (*BatchEmbedTextResponse, error)
+ // Runs a model's tokenizer on a text and returns the token count.
+ CountTextTokens(ctx context.Context, in *CountTextTokensRequest, opts ...grpc.CallOption) (*CountTextTokensResponse, error)
+}
+
+type textServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewTextServiceClient(cc grpc.ClientConnInterface) TextServiceClient {
+ return &textServiceClient{cc}
+}
+
+func (c *textServiceClient) GenerateText(ctx context.Context, in *GenerateTextRequest, opts ...grpc.CallOption) (*GenerateTextResponse, error) {
+ out := new(GenerateTextResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.TextService/GenerateText", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *textServiceClient) EmbedText(ctx context.Context, in *EmbedTextRequest, opts ...grpc.CallOption) (*EmbedTextResponse, error) {
+ out := new(EmbedTextResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.TextService/EmbedText", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *textServiceClient) BatchEmbedText(ctx context.Context, in *BatchEmbedTextRequest, opts ...grpc.CallOption) (*BatchEmbedTextResponse, error) {
+ out := new(BatchEmbedTextResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.TextService/BatchEmbedText", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *textServiceClient) CountTextTokens(ctx context.Context, in *CountTextTokensRequest, opts ...grpc.CallOption) (*CountTextTokensResponse, error) {
+ out := new(CountTextTokensResponse)
+ err := c.cc.Invoke(ctx, "/google.ai.generativelanguage.v1beta.TextService/CountTextTokens", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// TextServiceServer is the server API for TextService service.
+type TextServiceServer interface {
+ // Generates a response from the model given an input message.
+ GenerateText(context.Context, *GenerateTextRequest) (*GenerateTextResponse, error)
+ // Generates an embedding from the model given an input message.
+ EmbedText(context.Context, *EmbedTextRequest) (*EmbedTextResponse, error)
+ // Generates multiple embeddings from the model given input text in a
+ // synchronous call.
+ BatchEmbedText(context.Context, *BatchEmbedTextRequest) (*BatchEmbedTextResponse, error)
+ // Runs a model's tokenizer on a text and returns the token count.
+ CountTextTokens(context.Context, *CountTextTokensRequest) (*CountTextTokensResponse, error)
+}
+
+// UnimplementedTextServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedTextServiceServer struct {
+}
+
+func (*UnimplementedTextServiceServer) GenerateText(context.Context, *GenerateTextRequest) (*GenerateTextResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GenerateText not implemented")
+}
+func (*UnimplementedTextServiceServer) EmbedText(context.Context, *EmbedTextRequest) (*EmbedTextResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method EmbedText not implemented")
+}
+func (*UnimplementedTextServiceServer) BatchEmbedText(context.Context, *BatchEmbedTextRequest) (*BatchEmbedTextResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method BatchEmbedText not implemented")
+}
+func (*UnimplementedTextServiceServer) CountTextTokens(context.Context, *CountTextTokensRequest) (*CountTextTokensResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CountTextTokens not implemented")
+}
+
+func RegisterTextServiceServer(s *grpc.Server, srv TextServiceServer) {
+ s.RegisterService(&_TextService_serviceDesc, srv)
+}
+
+func _TextService_GenerateText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GenerateTextRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(TextServiceServer).GenerateText(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.TextService/GenerateText",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(TextServiceServer).GenerateText(ctx, req.(*GenerateTextRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _TextService_EmbedText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(EmbedTextRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(TextServiceServer).EmbedText(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.TextService/EmbedText",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(TextServiceServer).EmbedText(ctx, req.(*EmbedTextRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _TextService_BatchEmbedText_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(BatchEmbedTextRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(TextServiceServer).BatchEmbedText(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.TextService/BatchEmbedText",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(TextServiceServer).BatchEmbedText(ctx, req.(*BatchEmbedTextRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _TextService_CountTextTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CountTextTokensRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(TextServiceServer).CountTextTokens(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/google.ai.generativelanguage.v1beta.TextService/CountTextTokens",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(TextServiceServer).CountTextTokens(ctx, req.(*CountTextTokensRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _TextService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "google.ai.generativelanguage.v1beta.TextService",
+ HandlerType: (*TextServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "GenerateText",
+ Handler: _TextService_GenerateText_Handler,
+ },
+ {
+ MethodName: "EmbedText",
+ Handler: _TextService_EmbedText_Handler,
+ },
+ {
+ MethodName: "BatchEmbedText",
+ Handler: _TextService_BatchEmbedText_Handler,
+ },
+ {
+ MethodName: "CountTextTokens",
+ Handler: _TextService_CountTextTokens_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "google/ai/generativelanguage/v1beta/text_service.proto",
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/tuned_model.pb.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/tuned_model.pb.go
new file mode 100644
index 000000000..7449713f5
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb/tuned_model.pb.go
@@ -0,0 +1,1196 @@
+// 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.
+
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc v4.25.3
+// source: google/ai/generativelanguage/v1beta/tuned_model.proto
+
+package generativelanguagepb
+
+import (
+ reflect "reflect"
+ sync "sync"
+
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// The state of the tuned model.
+type TunedModel_State int32
+
+const (
+ // The default value. This value is unused.
+ TunedModel_STATE_UNSPECIFIED TunedModel_State = 0
+ // The model is being created.
+ TunedModel_CREATING TunedModel_State = 1
+ // The model is ready to be used.
+ TunedModel_ACTIVE TunedModel_State = 2
+ // The model failed to be created.
+ TunedModel_FAILED TunedModel_State = 3
+)
+
+// Enum value maps for TunedModel_State.
+var (
+ TunedModel_State_name = map[int32]string{
+ 0: "STATE_UNSPECIFIED",
+ 1: "CREATING",
+ 2: "ACTIVE",
+ 3: "FAILED",
+ }
+ TunedModel_State_value = map[string]int32{
+ "STATE_UNSPECIFIED": 0,
+ "CREATING": 1,
+ "ACTIVE": 2,
+ "FAILED": 3,
+ }
+)
+
+func (x TunedModel_State) Enum() *TunedModel_State {
+ p := new(TunedModel_State)
+ *p = x
+ return p
+}
+
+func (x TunedModel_State) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (TunedModel_State) Descriptor() protoreflect.EnumDescriptor {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_enumTypes[0].Descriptor()
+}
+
+func (TunedModel_State) Type() protoreflect.EnumType {
+ return &file_google_ai_generativelanguage_v1beta_tuned_model_proto_enumTypes[0]
+}
+
+func (x TunedModel_State) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use TunedModel_State.Descriptor instead.
+func (TunedModel_State) EnumDescriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{0, 0}
+}
+
+// A fine-tuned model created using ModelService.CreateTunedModel.
+type TunedModel struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The model used as the starting point for tuning.
+ //
+ // Types that are assignable to SourceModel:
+ //
+ // *TunedModel_TunedModelSource
+ // *TunedModel_BaseModel
+ SourceModel isTunedModel_SourceModel `protobuf_oneof:"source_model"`
+ // 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"
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // Optional. The name to display for this model in user interfaces.
+ // The display name must be up to 40 characters including spaces.
+ DisplayName string `protobuf:"bytes,5,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
+ // Optional. A short description of this model.
+ Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
+ // 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.
+ Temperature *float32 `protobuf:"fixed32,11,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"`
+ // 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.
+ TopP *float32 `protobuf:"fixed32,12,opt,name=top_p,json=topP,proto3,oneof" json:"top_p,omitempty"`
+ // 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.
+ TopK *int32 `protobuf:"varint,13,opt,name=top_k,json=topK,proto3,oneof" json:"top_k,omitempty"`
+ // Output only. The state of the tuned model.
+ State TunedModel_State `protobuf:"varint,7,opt,name=state,proto3,enum=google.ai.generativelanguage.v1beta.TunedModel_State" json:"state,omitempty"`
+ // Output only. The timestamp when this model was created.
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ // Output only. The timestamp when this model was updated.
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ // Required. The tuning task that creates the tuned model.
+ TuningTask *TuningTask `protobuf:"bytes,10,opt,name=tuning_task,json=tuningTask,proto3" json:"tuning_task,omitempty"`
+}
+
+func (x *TunedModel) Reset() {
+ *x = TunedModel{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TunedModel) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TunedModel) ProtoMessage() {}
+
+func (x *TunedModel) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_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 TunedModel.ProtoReflect.Descriptor instead.
+func (*TunedModel) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{0}
+}
+
+func (m *TunedModel) GetSourceModel() isTunedModel_SourceModel {
+ if m != nil {
+ return m.SourceModel
+ }
+ return nil
+}
+
+func (x *TunedModel) GetTunedModelSource() *TunedModelSource {
+ if x, ok := x.GetSourceModel().(*TunedModel_TunedModelSource); ok {
+ return x.TunedModelSource
+ }
+ return nil
+}
+
+func (x *TunedModel) GetBaseModel() string {
+ if x, ok := x.GetSourceModel().(*TunedModel_BaseModel); ok {
+ return x.BaseModel
+ }
+ return ""
+}
+
+func (x *TunedModel) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *TunedModel) GetDisplayName() string {
+ if x != nil {
+ return x.DisplayName
+ }
+ return ""
+}
+
+func (x *TunedModel) GetDescription() string {
+ if x != nil {
+ return x.Description
+ }
+ return ""
+}
+
+func (x *TunedModel) GetTemperature() float32 {
+ if x != nil && x.Temperature != nil {
+ return *x.Temperature
+ }
+ return 0
+}
+
+func (x *TunedModel) GetTopP() float32 {
+ if x != nil && x.TopP != nil {
+ return *x.TopP
+ }
+ return 0
+}
+
+func (x *TunedModel) GetTopK() int32 {
+ if x != nil && x.TopK != nil {
+ return *x.TopK
+ }
+ return 0
+}
+
+func (x *TunedModel) GetState() TunedModel_State {
+ if x != nil {
+ return x.State
+ }
+ return TunedModel_STATE_UNSPECIFIED
+}
+
+func (x *TunedModel) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *TunedModel) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+func (x *TunedModel) GetTuningTask() *TuningTask {
+ if x != nil {
+ return x.TuningTask
+ }
+ return nil
+}
+
+type isTunedModel_SourceModel interface {
+ isTunedModel_SourceModel()
+}
+
+type TunedModel_TunedModelSource struct {
+ // Optional. TunedModel to use as the starting point for training the new
+ // model.
+ TunedModelSource *TunedModelSource `protobuf:"bytes,3,opt,name=tuned_model_source,json=tunedModelSource,proto3,oneof"`
+}
+
+type TunedModel_BaseModel struct {
+ // Immutable. The name of the `Model` to tune.
+ // Example: `models/text-bison-001`
+ BaseModel string `protobuf:"bytes,4,opt,name=base_model,json=baseModel,proto3,oneof"`
+}
+
+func (*TunedModel_TunedModelSource) isTunedModel_SourceModel() {}
+
+func (*TunedModel_BaseModel) isTunedModel_SourceModel() {}
+
+// Tuned model as a source for training a new model.
+type TunedModelSource struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Immutable. The name of the `TunedModel` to use as the starting point for
+ // training the new model.
+ // Example: `tunedModels/my-tuned-model`
+ TunedModel string `protobuf:"bytes,1,opt,name=tuned_model,json=tunedModel,proto3" json:"tuned_model,omitempty"`
+ // Output only. The name of the base `Model` this `TunedModel` was tuned from.
+ // Example: `models/text-bison-001`
+ BaseModel string `protobuf:"bytes,2,opt,name=base_model,json=baseModel,proto3" json:"base_model,omitempty"`
+}
+
+func (x *TunedModelSource) Reset() {
+ *x = TunedModelSource{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TunedModelSource) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TunedModelSource) ProtoMessage() {}
+
+func (x *TunedModelSource) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[1]
+ 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 TunedModelSource.ProtoReflect.Descriptor instead.
+func (*TunedModelSource) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *TunedModelSource) GetTunedModel() string {
+ if x != nil {
+ return x.TunedModel
+ }
+ return ""
+}
+
+func (x *TunedModelSource) GetBaseModel() string {
+ if x != nil {
+ return x.BaseModel
+ }
+ return ""
+}
+
+// Tuning tasks that create tuned models.
+type TuningTask struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. The timestamp when tuning this model started.
+ StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
+ // Output only. The timestamp when tuning this model completed.
+ CompleteTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=complete_time,json=completeTime,proto3" json:"complete_time,omitempty"`
+ // Output only. Metrics collected during tuning.
+ Snapshots []*TuningSnapshot `protobuf:"bytes,3,rep,name=snapshots,proto3" json:"snapshots,omitempty"`
+ // Required. Input only. Immutable. The model training data.
+ TrainingData *Dataset `protobuf:"bytes,4,opt,name=training_data,json=trainingData,proto3" json:"training_data,omitempty"`
+ // Immutable. Hyperparameters controlling the tuning process. If not provided,
+ // default values will be used.
+ Hyperparameters *Hyperparameters `protobuf:"bytes,5,opt,name=hyperparameters,proto3" json:"hyperparameters,omitempty"`
+}
+
+func (x *TuningTask) Reset() {
+ *x = TuningTask{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TuningTask) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TuningTask) ProtoMessage() {}
+
+func (x *TuningTask) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[2]
+ 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 TuningTask.ProtoReflect.Descriptor instead.
+func (*TuningTask) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *TuningTask) GetStartTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.StartTime
+ }
+ return nil
+}
+
+func (x *TuningTask) GetCompleteTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CompleteTime
+ }
+ return nil
+}
+
+func (x *TuningTask) GetSnapshots() []*TuningSnapshot {
+ if x != nil {
+ return x.Snapshots
+ }
+ return nil
+}
+
+func (x *TuningTask) GetTrainingData() *Dataset {
+ if x != nil {
+ return x.TrainingData
+ }
+ return nil
+}
+
+func (x *TuningTask) GetHyperparameters() *Hyperparameters {
+ if x != nil {
+ return x.Hyperparameters
+ }
+ return nil
+}
+
+// Hyperparameters controlling the tuning process. Read more at
+// https://ai.google.dev/docs/model_tuning_guidance
+type Hyperparameters struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Options for specifying learning rate during tuning.
+ //
+ // Types that are assignable to LearningRateOption:
+ //
+ // *Hyperparameters_LearningRate
+ // *Hyperparameters_LearningRateMultiplier
+ LearningRateOption isHyperparameters_LearningRateOption `protobuf_oneof:"learning_rate_option"`
+ // 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.
+ EpochCount *int32 `protobuf:"varint,14,opt,name=epoch_count,json=epochCount,proto3,oneof" json:"epoch_count,omitempty"`
+ // 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.
+ BatchSize *int32 `protobuf:"varint,15,opt,name=batch_size,json=batchSize,proto3,oneof" json:"batch_size,omitempty"`
+}
+
+func (x *Hyperparameters) Reset() {
+ *x = Hyperparameters{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Hyperparameters) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Hyperparameters) ProtoMessage() {}
+
+func (x *Hyperparameters) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[3]
+ 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 Hyperparameters.ProtoReflect.Descriptor instead.
+func (*Hyperparameters) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{3}
+}
+
+func (m *Hyperparameters) GetLearningRateOption() isHyperparameters_LearningRateOption {
+ if m != nil {
+ return m.LearningRateOption
+ }
+ return nil
+}
+
+func (x *Hyperparameters) GetLearningRate() float32 {
+ if x, ok := x.GetLearningRateOption().(*Hyperparameters_LearningRate); ok {
+ return x.LearningRate
+ }
+ return 0
+}
+
+func (x *Hyperparameters) GetLearningRateMultiplier() float32 {
+ if x, ok := x.GetLearningRateOption().(*Hyperparameters_LearningRateMultiplier); ok {
+ return x.LearningRateMultiplier
+ }
+ return 0
+}
+
+func (x *Hyperparameters) GetEpochCount() int32 {
+ if x != nil && x.EpochCount != nil {
+ return *x.EpochCount
+ }
+ return 0
+}
+
+func (x *Hyperparameters) GetBatchSize() int32 {
+ if x != nil && x.BatchSize != nil {
+ return *x.BatchSize
+ }
+ return 0
+}
+
+type isHyperparameters_LearningRateOption interface {
+ isHyperparameters_LearningRateOption()
+}
+
+type Hyperparameters_LearningRate struct {
+ // 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.
+ LearningRate float32 `protobuf:"fixed32,16,opt,name=learning_rate,json=learningRate,proto3,oneof"`
+}
+
+type Hyperparameters_LearningRateMultiplier struct {
+ // 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.
+ LearningRateMultiplier float32 `protobuf:"fixed32,17,opt,name=learning_rate_multiplier,json=learningRateMultiplier,proto3,oneof"`
+}
+
+func (*Hyperparameters_LearningRate) isHyperparameters_LearningRateOption() {}
+
+func (*Hyperparameters_LearningRateMultiplier) isHyperparameters_LearningRateOption() {}
+
+// Dataset for training or validation.
+type Dataset struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Inline data or a reference to the data.
+ //
+ // Types that are assignable to Dataset:
+ //
+ // *Dataset_Examples
+ Dataset isDataset_Dataset `protobuf_oneof:"dataset"`
+}
+
+func (x *Dataset) Reset() {
+ *x = Dataset{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Dataset) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Dataset) ProtoMessage() {}
+
+func (x *Dataset) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[4]
+ 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 Dataset.ProtoReflect.Descriptor instead.
+func (*Dataset) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{4}
+}
+
+func (m *Dataset) GetDataset() isDataset_Dataset {
+ if m != nil {
+ return m.Dataset
+ }
+ return nil
+}
+
+func (x *Dataset) GetExamples() *TuningExamples {
+ if x, ok := x.GetDataset().(*Dataset_Examples); ok {
+ return x.Examples
+ }
+ return nil
+}
+
+type isDataset_Dataset interface {
+ isDataset_Dataset()
+}
+
+type Dataset_Examples struct {
+ // Optional. Inline examples.
+ Examples *TuningExamples `protobuf:"bytes,1,opt,name=examples,proto3,oneof"`
+}
+
+func (*Dataset_Examples) isDataset_Dataset() {}
+
+// A set of tuning examples. Can be training or validation data.
+type TuningExamples struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Required. The examples. Example input can be for text or discuss, but all
+ // examples in a set must be of the same type.
+ Examples []*TuningExample `protobuf:"bytes,1,rep,name=examples,proto3" json:"examples,omitempty"`
+}
+
+func (x *TuningExamples) Reset() {
+ *x = TuningExamples{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TuningExamples) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TuningExamples) ProtoMessage() {}
+
+func (x *TuningExamples) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[5]
+ 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 TuningExamples.ProtoReflect.Descriptor instead.
+func (*TuningExamples) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *TuningExamples) GetExamples() []*TuningExample {
+ if x != nil {
+ return x.Examples
+ }
+ return nil
+}
+
+// A single example for tuning.
+type TuningExample struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The input to the model for this example.
+ //
+ // Types that are assignable to ModelInput:
+ //
+ // *TuningExample_TextInput
+ ModelInput isTuningExample_ModelInput `protobuf_oneof:"model_input"`
+ // Required. The expected model output.
+ Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"`
+}
+
+func (x *TuningExample) Reset() {
+ *x = TuningExample{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TuningExample) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TuningExample) ProtoMessage() {}
+
+func (x *TuningExample) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[6]
+ 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 TuningExample.ProtoReflect.Descriptor instead.
+func (*TuningExample) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{6}
+}
+
+func (m *TuningExample) GetModelInput() isTuningExample_ModelInput {
+ if m != nil {
+ return m.ModelInput
+ }
+ return nil
+}
+
+func (x *TuningExample) GetTextInput() string {
+ if x, ok := x.GetModelInput().(*TuningExample_TextInput); ok {
+ return x.TextInput
+ }
+ return ""
+}
+
+func (x *TuningExample) GetOutput() string {
+ if x != nil {
+ return x.Output
+ }
+ return ""
+}
+
+type isTuningExample_ModelInput interface {
+ isTuningExample_ModelInput()
+}
+
+type TuningExample_TextInput struct {
+ // Optional. Text model input.
+ TextInput string `protobuf:"bytes,1,opt,name=text_input,json=textInput,proto3,oneof"`
+}
+
+func (*TuningExample_TextInput) isTuningExample_ModelInput() {}
+
+// Record for a single tuning step.
+type TuningSnapshot struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Output only. The tuning step.
+ Step int32 `protobuf:"varint,1,opt,name=step,proto3" json:"step,omitempty"`
+ // Output only. The epoch this step was part of.
+ Epoch int32 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"`
+ // Output only. The mean loss of the training examples for this step.
+ MeanLoss float32 `protobuf:"fixed32,3,opt,name=mean_loss,json=meanLoss,proto3" json:"mean_loss,omitempty"`
+ // Output only. The timestamp when this metric was computed.
+ ComputeTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=compute_time,json=computeTime,proto3" json:"compute_time,omitempty"`
+}
+
+func (x *TuningSnapshot) Reset() {
+ *x = TuningSnapshot{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *TuningSnapshot) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*TuningSnapshot) ProtoMessage() {}
+
+func (x *TuningSnapshot) ProtoReflect() protoreflect.Message {
+ mi := &file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[7]
+ 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 TuningSnapshot.ProtoReflect.Descriptor instead.
+func (*TuningSnapshot) Descriptor() ([]byte, []int) {
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *TuningSnapshot) GetStep() int32 {
+ if x != nil {
+ return x.Step
+ }
+ return 0
+}
+
+func (x *TuningSnapshot) GetEpoch() int32 {
+ if x != nil {
+ return x.Epoch
+ }
+ return 0
+}
+
+func (x *TuningSnapshot) GetMeanLoss() float32 {
+ if x != nil {
+ return x.MeanLoss
+ }
+ return 0
+}
+
+func (x *TuningSnapshot) GetComputeTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.ComputeTime
+ }
+ return nil
+}
+
+var File_google_ai_generativelanguage_v1beta_tuned_model_proto protoreflect.FileDescriptor
+
+var file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDesc = []byte{
+ 0x0a, 0x35, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2f, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x1a, 0x1f, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62,
+ 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
+ 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
+ 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x07, 0x0a, 0x0a, 0x54, 0x75,
+ 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x6a, 0x0a, 0x12, 0x74, 0x75, 0x6e, 0x65,
+ 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01,
+ 0x48, 0x00, 0x52, 0x10, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x29,
+ 0x0a, 0x27, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x09, 0x62, 0x61, 0x73,
+ 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
+ 0x26, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70,
+ 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
+ 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
+ 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a,
+ 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x0b, 0x20,
+ 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x0b, 0x74, 0x65, 0x6d, 0x70,
+ 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x6f,
+ 0x70, 0x5f, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02,
+ 0x52, 0x04, 0x74, 0x6f, 0x70, 0x50, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x05, 0x74, 0x6f, 0x70,
+ 0x5f, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x03, 0x52,
+ 0x04, 0x74, 0x6f, 0x70, 0x4b, 0x88, 0x01, 0x01, 0x12, 0x50, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74,
+ 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61,
+ 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75,
+ 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x03,
+ 0xe0, 0x41, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03,
+ 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b,
+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0,
+ 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x55,
+ 0x0a, 0x0b, 0x74, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x0a, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67,
+ 0x54, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x74, 0x75, 0x6e, 0x69, 0x6e,
+ 0x67, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x44, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15,
+ 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4e,
+ 0x47, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12,
+ 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x3a, 0x65, 0xea, 0x41, 0x62,
+ 0x0a, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67,
+ 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x19,
+ 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x74, 0x75, 0x6e,
+ 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x7d, 0x2a, 0x0b, 0x74, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x32, 0x0a, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x42, 0x0e, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x42, 0x08, 0x0a, 0x06,
+ 0x5f, 0x74, 0x6f, 0x70, 0x5f, 0x6b, 0x22, 0xb9, 0x01, 0x0a, 0x10, 0x54, 0x75, 0x6e, 0x65, 0x64,
+ 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x74,
+ 0x75, 0x6e, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x34, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x2e, 0x0a, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x75, 0x6e, 0x65,
+ 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x0a, 0x74, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x12, 0x4e, 0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xe0, 0x41, 0x03, 0xfa, 0x41, 0x29, 0x0a, 0x27,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x2f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x22, 0xad, 0x03, 0x0a, 0x0a, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x61, 0x73,
+ 0x6b, 0x12, 0x3e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
+ 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d,
+ 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69,
+ 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
+ 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c,
+ 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x56, 0x0a, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73,
+ 0x68, 0x6f, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61,
+ 0x2e, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12,
+ 0x5c, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x61, 0x74, 0x61,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74,
+ 0x61, 0x73, 0x65, 0x74, 0x42, 0x09, 0xe0, 0x41, 0x04, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52,
+ 0x0c, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x63, 0x0a,
+ 0x0f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73,
+ 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x79, 0x70,
+ 0x65, 0x72, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x42, 0x03, 0xe0, 0x41,
+ 0x05, 0x52, 0x0f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
+ 0x72, 0x73, 0x22, 0x8f, 0x02, 0x0a, 0x0f, 0x48, 0x79, 0x70, 0x65, 0x72, 0x70, 0x61, 0x72, 0x61,
+ 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69,
+ 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x02, 0x42, 0x06, 0xe0,
+ 0x41, 0x05, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e,
+ 0x67, 0x52, 0x61, 0x74, 0x65, 0x12, 0x42, 0x0a, 0x18, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e,
+ 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65,
+ 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x02, 0x42, 0x06, 0xe0, 0x41, 0x05, 0xe0, 0x41, 0x01, 0x48,
+ 0x00, 0x52, 0x16, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x74, 0x65, 0x4d,
+ 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x0b, 0x65, 0x70, 0x6f,
+ 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03,
+ 0xe0, 0x41, 0x05, 0x48, 0x01, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x69,
+ 0x7a, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x48, 0x02, 0x52,
+ 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a,
+ 0x14, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6f,
+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f,
+ 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f,
+ 0x73, 0x69, 0x7a, 0x65, 0x22, 0x6c, 0x0a, 0x07, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x12,
+ 0x56, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x33, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x78,
+ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x08, 0x65,
+ 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x64, 0x61, 0x74, 0x61, 0x73,
+ 0x65, 0x74, 0x22, 0x65, 0x0a, 0x0e, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x61, 0x6d,
+ 0x70, 0x6c, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73,
+ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x6e,
+ 0x69, 0x6e, 0x67, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52,
+ 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x22, 0x61, 0x0a, 0x0d, 0x54, 0x75, 0x6e,
+ 0x69, 0x6e, 0x67, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0a, 0x74, 0x65,
+ 0x78, 0x74, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03,
+ 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x09, 0x74, 0x65, 0x78, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74,
+ 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x42, 0x0d, 0x0a,
+ 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0xaa, 0x01, 0x0a,
+ 0x0e, 0x54, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12,
+ 0x17, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0,
+ 0x41, 0x03, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63,
+ 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x65, 0x70,
+ 0x6f, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x09, 0x6d, 0x65, 0x61, 0x6e, 0x5f, 0x6c, 0x6f, 0x73, 0x73,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x6d, 0x65, 0x61,
+ 0x6e, 0x4c, 0x6f, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65,
+ 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x63, 0x6f,
+ 0x6d, 0x70, 0x75, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x9b, 0x01, 0x0a, 0x27, 0x63, 0x6f,
+ 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x69, 0x2e, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x76,
+ 0x31, 0x62, 0x65, 0x74, 0x61, 0x42, 0x0f, 0x54, 0x75, 0x6e, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65,
+ 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x5d, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x61, 0x69,
+ 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75,
+ 0x61, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x2f, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
+ 0x70, 0x62, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x61, 0x6e,
+ 0x67, 0x75, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescOnce sync.Once
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescData = file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDesc
+)
+
+func file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescGZIP() []byte {
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescOnce.Do(func() {
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescData)
+ })
+ return file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDescData
+}
+
+var file_google_ai_generativelanguage_v1beta_tuned_model_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
+var file_google_ai_generativelanguage_v1beta_tuned_model_proto_goTypes = []interface{}{
+ (TunedModel_State)(0), // 0: google.ai.generativelanguage.v1beta.TunedModel.State
+ (*TunedModel)(nil), // 1: google.ai.generativelanguage.v1beta.TunedModel
+ (*TunedModelSource)(nil), // 2: google.ai.generativelanguage.v1beta.TunedModelSource
+ (*TuningTask)(nil), // 3: google.ai.generativelanguage.v1beta.TuningTask
+ (*Hyperparameters)(nil), // 4: google.ai.generativelanguage.v1beta.Hyperparameters
+ (*Dataset)(nil), // 5: google.ai.generativelanguage.v1beta.Dataset
+ (*TuningExamples)(nil), // 6: google.ai.generativelanguage.v1beta.TuningExamples
+ (*TuningExample)(nil), // 7: google.ai.generativelanguage.v1beta.TuningExample
+ (*TuningSnapshot)(nil), // 8: google.ai.generativelanguage.v1beta.TuningSnapshot
+ (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
+}
+var file_google_ai_generativelanguage_v1beta_tuned_model_proto_depIdxs = []int32{
+ 2, // 0: google.ai.generativelanguage.v1beta.TunedModel.tuned_model_source:type_name -> google.ai.generativelanguage.v1beta.TunedModelSource
+ 0, // 1: google.ai.generativelanguage.v1beta.TunedModel.state:type_name -> google.ai.generativelanguage.v1beta.TunedModel.State
+ 9, // 2: google.ai.generativelanguage.v1beta.TunedModel.create_time:type_name -> google.protobuf.Timestamp
+ 9, // 3: google.ai.generativelanguage.v1beta.TunedModel.update_time:type_name -> google.protobuf.Timestamp
+ 3, // 4: google.ai.generativelanguage.v1beta.TunedModel.tuning_task:type_name -> google.ai.generativelanguage.v1beta.TuningTask
+ 9, // 5: google.ai.generativelanguage.v1beta.TuningTask.start_time:type_name -> google.protobuf.Timestamp
+ 9, // 6: google.ai.generativelanguage.v1beta.TuningTask.complete_time:type_name -> google.protobuf.Timestamp
+ 8, // 7: google.ai.generativelanguage.v1beta.TuningTask.snapshots:type_name -> google.ai.generativelanguage.v1beta.TuningSnapshot
+ 5, // 8: google.ai.generativelanguage.v1beta.TuningTask.training_data:type_name -> google.ai.generativelanguage.v1beta.Dataset
+ 4, // 9: google.ai.generativelanguage.v1beta.TuningTask.hyperparameters:type_name -> google.ai.generativelanguage.v1beta.Hyperparameters
+ 6, // 10: google.ai.generativelanguage.v1beta.Dataset.examples:type_name -> google.ai.generativelanguage.v1beta.TuningExamples
+ 7, // 11: google.ai.generativelanguage.v1beta.TuningExamples.examples:type_name -> google.ai.generativelanguage.v1beta.TuningExample
+ 9, // 12: google.ai.generativelanguage.v1beta.TuningSnapshot.compute_time:type_name -> google.protobuf.Timestamp
+ 13, // [13:13] is the sub-list for method output_type
+ 13, // [13:13] is the sub-list for method input_type
+ 13, // [13:13] is the sub-list for extension type_name
+ 13, // [13:13] is the sub-list for extension extendee
+ 0, // [0:13] is the sub-list for field type_name
+}
+
+func init() { file_google_ai_generativelanguage_v1beta_tuned_model_proto_init() }
+func file_google_ai_generativelanguage_v1beta_tuned_model_proto_init() {
+ if File_google_ai_generativelanguage_v1beta_tuned_model_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TunedModel); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TunedModelSource); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TuningTask); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Hyperparameters); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Dataset); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TuningExamples); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TuningExample); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*TuningSnapshot); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[0].OneofWrappers = []interface{}{
+ (*TunedModel_TunedModelSource)(nil),
+ (*TunedModel_BaseModel)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[3].OneofWrappers = []interface{}{
+ (*Hyperparameters_LearningRate)(nil),
+ (*Hyperparameters_LearningRateMultiplier)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[4].OneofWrappers = []interface{}{
+ (*Dataset_Examples)(nil),
+ }
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes[6].OneofWrappers = []interface{}{
+ (*TuningExample_TextInput)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDesc,
+ NumEnums: 1,
+ NumMessages: 8,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_google_ai_generativelanguage_v1beta_tuned_model_proto_goTypes,
+ DependencyIndexes: file_google_ai_generativelanguage_v1beta_tuned_model_proto_depIdxs,
+ EnumInfos: file_google_ai_generativelanguage_v1beta_tuned_model_proto_enumTypes,
+ MessageInfos: file_google_ai_generativelanguage_v1beta_tuned_model_proto_msgTypes,
+ }.Build()
+ File_google_ai_generativelanguage_v1beta_tuned_model_proto = out.File
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_rawDesc = nil
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_goTypes = nil
+ file_google_ai_generativelanguage_v1beta_tuned_model_proto_depIdxs = nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/info.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/info.go
new file mode 100644
index 000000000..80cdb6773
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/info.go
@@ -0,0 +1,25 @@
+// 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.
+
+// SetGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Also passes any
+// provided key-value pairs. Intended for use by Google-written clients.
+//
+// Internal use only.
+
+package generativelanguage
+
+func (c *GenerativeClient) SetGoogleClientInfo(keyval ...string) {
+ c.setGoogleClientInfo(keyval...)
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/model_client.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/model_client.go
new file mode 100644
index 000000000..c05d4c4b2
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/model_client.go
@@ -0,0 +1,1200 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "math"
+ "net/http"
+ "net/url"
+ "time"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ "cloud.google.com/go/longrunning"
+ lroauto "cloud.google.com/go/longrunning/autogen"
+ longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ httptransport "google.golang.org/api/transport/http"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/protobuf/encoding/protojson"
+ "google.golang.org/protobuf/proto"
+)
+
+var newModelClientHook clientHook
+
+// ModelCallOptions contains the retry settings for each method of ModelClient.
+type ModelCallOptions struct {
+ GetModel []gax.CallOption
+ ListModels []gax.CallOption
+ GetTunedModel []gax.CallOption
+ ListTunedModels []gax.CallOption
+ CreateTunedModel []gax.CallOption
+ UpdateTunedModel []gax.CallOption
+ DeleteTunedModel []gax.CallOption
+}
+
+func defaultModelGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("generativelanguage.googleapis.com:443"),
+ internaloption.WithDefaultEndpointTemplate("generativelanguage.UNIVERSE_DOMAIN:443"),
+ internaloption.WithDefaultMTLSEndpoint("generativelanguage.mtls.googleapis.com:443"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultModelCallOptions() *ModelCallOptions {
+ return &ModelCallOptions{
+ GetModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListModels: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListTunedModels: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ }
+}
+
+func defaultModelRESTCallOptions() *ModelCallOptions {
+ return &ModelCallOptions{
+ GetModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ ListModels: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ GetTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ ListTunedModels: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ CreateTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ UpdateTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ DeleteTunedModel: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ }
+}
+
+// internalModelClient is an interface that defines the methods available from Generative Language API.
+type internalModelClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ GetModel(context.Context, *generativelanguagepb.GetModelRequest, ...gax.CallOption) (*generativelanguagepb.Model, error)
+ ListModels(context.Context, *generativelanguagepb.ListModelsRequest, ...gax.CallOption) *ModelIterator
+ GetTunedModel(context.Context, *generativelanguagepb.GetTunedModelRequest, ...gax.CallOption) (*generativelanguagepb.TunedModel, error)
+ ListTunedModels(context.Context, *generativelanguagepb.ListTunedModelsRequest, ...gax.CallOption) *TunedModelIterator
+ CreateTunedModel(context.Context, *generativelanguagepb.CreateTunedModelRequest, ...gax.CallOption) (*CreateTunedModelOperation, error)
+ CreateTunedModelOperation(name string) *CreateTunedModelOperation
+ UpdateTunedModel(context.Context, *generativelanguagepb.UpdateTunedModelRequest, ...gax.CallOption) (*generativelanguagepb.TunedModel, error)
+ DeleteTunedModel(context.Context, *generativelanguagepb.DeleteTunedModelRequest, ...gax.CallOption) error
+}
+
+// ModelClient is a client for interacting with Generative Language API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// Provides methods for getting metadata information about Generative Models.
+type ModelClient struct {
+ // The internal transport-dependent client.
+ internalClient internalModelClient
+
+ // The call options for this service.
+ CallOptions *ModelCallOptions
+
+ // LROClient is used internally to handle long-running operations.
+ // It is exposed so that its CallOptions can be modified if required.
+ // Users should not Close this client.
+ LROClient *lroauto.OperationsClient
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *ModelClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *ModelClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *ModelClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// GetModel gets information about a specific Model.
+func (c *ModelClient) GetModel(ctx context.Context, req *generativelanguagepb.GetModelRequest, opts ...gax.CallOption) (*generativelanguagepb.Model, error) {
+ return c.internalClient.GetModel(ctx, req, opts...)
+}
+
+// ListModels lists models available through the API.
+func (c *ModelClient) ListModels(ctx context.Context, req *generativelanguagepb.ListModelsRequest, opts ...gax.CallOption) *ModelIterator {
+ return c.internalClient.ListModels(ctx, req, opts...)
+}
+
+// GetTunedModel gets information about a specific TunedModel.
+func (c *ModelClient) GetTunedModel(ctx context.Context, req *generativelanguagepb.GetTunedModelRequest, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ return c.internalClient.GetTunedModel(ctx, req, opts...)
+}
+
+// ListTunedModels lists tuned models owned by the user.
+func (c *ModelClient) ListTunedModels(ctx context.Context, req *generativelanguagepb.ListTunedModelsRequest, opts ...gax.CallOption) *TunedModelIterator {
+ return c.internalClient.ListTunedModels(ctx, req, opts...)
+}
+
+// CreateTunedModel 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
+func (c *ModelClient) CreateTunedModel(ctx context.Context, req *generativelanguagepb.CreateTunedModelRequest, opts ...gax.CallOption) (*CreateTunedModelOperation, error) {
+ return c.internalClient.CreateTunedModel(ctx, req, opts...)
+}
+
+// CreateTunedModelOperation returns a new CreateTunedModelOperation from a given name.
+// The name must be that of a previously created CreateTunedModelOperation, possibly from a different process.
+func (c *ModelClient) CreateTunedModelOperation(name string) *CreateTunedModelOperation {
+ return c.internalClient.CreateTunedModelOperation(name)
+}
+
+// UpdateTunedModel updates a tuned model.
+func (c *ModelClient) UpdateTunedModel(ctx context.Context, req *generativelanguagepb.UpdateTunedModelRequest, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ return c.internalClient.UpdateTunedModel(ctx, req, opts...)
+}
+
+// DeleteTunedModel deletes a tuned model.
+func (c *ModelClient) DeleteTunedModel(ctx context.Context, req *generativelanguagepb.DeleteTunedModelRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteTunedModel(ctx, req, opts...)
+}
+
+// modelGRPCClient is a client for interacting with Generative Language API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type modelGRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // Points back to the CallOptions field of the containing ModelClient
+ CallOptions **ModelCallOptions
+
+ // The gRPC API client.
+ modelClient generativelanguagepb.ModelServiceClient
+
+ // LROClient is used internally to handle long-running operations.
+ // It is exposed so that its CallOptions can be modified if required.
+ // Users should not Close this client.
+ LROClient **lroauto.OperationsClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogHeaders []string
+}
+
+// NewModelClient creates a new model service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// Provides methods for getting metadata information about Generative Models.
+func NewModelClient(ctx context.Context, opts ...option.ClientOption) (*ModelClient, error) {
+ clientOpts := defaultModelGRPCClientOptions()
+ if newModelClientHook != nil {
+ hookOpts, err := newModelClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := ModelClient{CallOptions: defaultModelCallOptions()}
+
+ c := &modelGRPCClient{
+ connPool: connPool,
+ modelClient: generativelanguagepb.NewModelServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
+ if err != nil {
+ // This error "should not happen", since we are just reusing old connection pool
+ // and never actually need to dial.
+ // If this does happen, we could leak connp. However, we cannot close conn:
+ // If the user invoked the constructor with option.WithGRPCConn,
+ // we would close a connection that's still in use.
+ // TODO: investigate error conditions.
+ return nil, err
+ }
+ c.LROClient = &client.LROClient
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *modelGRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *modelGRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *modelGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type modelRESTClient struct {
+ // The http endpoint to connect to.
+ endpoint string
+
+ // The http client.
+ httpClient *http.Client
+
+ // LROClient is used internally to handle long-running operations.
+ // It is exposed so that its CallOptions can be modified if required.
+ // Users should not Close this client.
+ LROClient **lroauto.OperationsClient
+
+ // The x-goog-* headers to be sent with each request.
+ xGoogHeaders []string
+
+ // Points back to the CallOptions field of the containing ModelClient
+ CallOptions **ModelCallOptions
+}
+
+// NewModelRESTClient creates a new model service rest client.
+//
+// Provides methods for getting metadata information about Generative Models.
+func NewModelRESTClient(ctx context.Context, opts ...option.ClientOption) (*ModelClient, error) {
+ clientOpts := append(defaultModelRESTClientOptions(), opts...)
+ httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
+ if err != nil {
+ return nil, err
+ }
+
+ callOpts := defaultModelRESTCallOptions()
+ c := &modelRESTClient{
+ endpoint: endpoint,
+ httpClient: httpClient,
+ CallOptions: &callOpts,
+ }
+ c.setGoogleClientInfo()
+
+ lroOpts := []option.ClientOption{
+ option.WithHTTPClient(httpClient),
+ option.WithEndpoint(endpoint),
+ }
+ opClient, err := lroauto.NewOperationsRESTClient(ctx, lroOpts...)
+ if err != nil {
+ return nil, err
+ }
+ c.LROClient = &opClient
+
+ return &ModelClient{internalClient: c, CallOptions: callOpts}, nil
+}
+
+func defaultModelRESTClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("https://generativelanguage.googleapis.com"),
+ internaloption.WithDefaultEndpointTemplate("https://generativelanguage.UNIVERSE_DOMAIN"),
+ internaloption.WithDefaultMTLSEndpoint("https://generativelanguage.mtls.googleapis.com"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ }
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *modelRESTClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *modelRESTClient) Close() error {
+ // Replace httpClient with nil to force cleanup.
+ c.httpClient = nil
+ return nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: This method always returns nil.
+func (c *modelRESTClient) Connection() *grpc.ClientConn {
+ return nil
+}
+func (c *modelGRPCClient) GetModel(ctx context.Context, req *generativelanguagepb.GetModelRequest, opts ...gax.CallOption) (*generativelanguagepb.Model, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GetModel[0:len((*c.CallOptions).GetModel):len((*c.CallOptions).GetModel)], opts...)
+ var resp *generativelanguagepb.Model
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.modelClient.GetModel(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *modelGRPCClient) ListModels(ctx context.Context, req *generativelanguagepb.ListModelsRequest, opts ...gax.CallOption) *ModelIterator {
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ opts = append((*c.CallOptions).ListModels[0:len((*c.CallOptions).ListModels):len((*c.CallOptions).ListModels)], opts...)
+ it := &ModelIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListModelsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Model, string, error) {
+ resp := &generativelanguagepb.ListModelsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.modelClient.ListModels(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetModels(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *modelGRPCClient) GetTunedModel(ctx context.Context, req *generativelanguagepb.GetTunedModelRequest, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GetTunedModel[0:len((*c.CallOptions).GetTunedModel):len((*c.CallOptions).GetTunedModel)], opts...)
+ var resp *generativelanguagepb.TunedModel
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.modelClient.GetTunedModel(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *modelGRPCClient) ListTunedModels(ctx context.Context, req *generativelanguagepb.ListTunedModelsRequest, opts ...gax.CallOption) *TunedModelIterator {
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ opts = append((*c.CallOptions).ListTunedModels[0:len((*c.CallOptions).ListTunedModels):len((*c.CallOptions).ListTunedModels)], opts...)
+ it := &TunedModelIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListTunedModelsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.TunedModel, string, error) {
+ resp := &generativelanguagepb.ListTunedModelsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.modelClient.ListTunedModels(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetTunedModels(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *modelGRPCClient) CreateTunedModel(ctx context.Context, req *generativelanguagepb.CreateTunedModelRequest, opts ...gax.CallOption) (*CreateTunedModelOperation, error) {
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ opts = append((*c.CallOptions).CreateTunedModel[0:len((*c.CallOptions).CreateTunedModel):len((*c.CallOptions).CreateTunedModel)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.modelClient.CreateTunedModel(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &CreateTunedModelOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+func (c *modelGRPCClient) UpdateTunedModel(ctx context.Context, req *generativelanguagepb.UpdateTunedModelRequest, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tuned_model.name", url.QueryEscape(req.GetTunedModel().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateTunedModel[0:len((*c.CallOptions).UpdateTunedModel):len((*c.CallOptions).UpdateTunedModel)], opts...)
+ var resp *generativelanguagepb.TunedModel
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.modelClient.UpdateTunedModel(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *modelGRPCClient) DeleteTunedModel(ctx context.Context, req *generativelanguagepb.DeleteTunedModelRequest, opts ...gax.CallOption) error {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).DeleteTunedModel[0:len((*c.CallOptions).DeleteTunedModel):len((*c.CallOptions).DeleteTunedModel)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.modelClient.DeleteTunedModel(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+// GetModel gets information about a specific Model.
+func (c *modelRESTClient) GetModel(ctx context.Context, req *generativelanguagepb.GetModelRequest, opts ...gax.CallOption) (*generativelanguagepb.Model, error) {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GetModel[0:len((*c.CallOptions).GetModel):len((*c.CallOptions).GetModel)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Model{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// ListModels lists models available through the API.
+func (c *modelRESTClient) ListModels(ctx context.Context, req *generativelanguagepb.ListModelsRequest, opts ...gax.CallOption) *ModelIterator {
+ it := &ModelIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListModelsRequest)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Model, string, error) {
+ resp := &generativelanguagepb.ListModelsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, "", err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/models")
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetPageSize() != 0 {
+ params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
+ }
+ if req.GetPageToken() != "" {
+ params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, "", e
+ }
+ it.Response = resp
+ return resp.GetModels(), resp.GetNextPageToken(), nil
+ }
+
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// GetTunedModel gets information about a specific TunedModel.
+func (c *modelRESTClient) GetTunedModel(ctx context.Context, req *generativelanguagepb.GetTunedModelRequest, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GetTunedModel[0:len((*c.CallOptions).GetTunedModel):len((*c.CallOptions).GetTunedModel)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.TunedModel{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// ListTunedModels lists tuned models owned by the user.
+func (c *modelRESTClient) ListTunedModels(ctx context.Context, req *generativelanguagepb.ListTunedModelsRequest, opts ...gax.CallOption) *TunedModelIterator {
+ it := &TunedModelIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListTunedModelsRequest)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.TunedModel, string, error) {
+ resp := &generativelanguagepb.ListTunedModelsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, "", err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/tunedModels")
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetFilter() != "" {
+ params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
+ }
+ if req.GetPageSize() != 0 {
+ params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
+ }
+ if req.GetPageToken() != "" {
+ params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, "", e
+ }
+ it.Response = resp
+ return resp.GetTunedModels(), resp.GetNextPageToken(), nil
+ }
+
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// CreateTunedModel 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
+func (c *modelRESTClient) CreateTunedModel(ctx context.Context, req *generativelanguagepb.CreateTunedModelRequest, opts ...gax.CallOption) (*CreateTunedModelOperation, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetTunedModel()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/tunedModels")
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req != nil && req.TunedModelId != nil {
+ params.Add("tunedModelId", fmt.Sprintf("%v", req.GetTunedModelId()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &longrunningpb.Operation{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+
+ override := fmt.Sprintf("/v1beta/%s", resp.GetName())
+ return &CreateTunedModelOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ pollPath: override,
+ }, nil
+}
+
+// UpdateTunedModel updates a tuned model.
+func (c *modelRESTClient) UpdateTunedModel(ctx context.Context, req *generativelanguagepb.UpdateTunedModelRequest, opts ...gax.CallOption) (*generativelanguagepb.TunedModel, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetTunedModel()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetTunedModel().GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetUpdateMask() != nil {
+ updateMask, err := protojson.Marshal(req.GetUpdateMask())
+ if err != nil {
+ return nil, err
+ }
+ params.Add("updateMask", string(updateMask[1:len(updateMask)-1]))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "tuned_model.name", url.QueryEscape(req.GetTunedModel().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateTunedModel[0:len((*c.CallOptions).UpdateTunedModel):len((*c.CallOptions).UpdateTunedModel)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.TunedModel{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// DeleteTunedModel deletes a tuned model.
+func (c *modelRESTClient) DeleteTunedModel(ctx context.Context, req *generativelanguagepb.DeleteTunedModelRequest, opts ...gax.CallOption) error {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ // Returns nil if there is no error, otherwise wraps
+ // the response code and body into a non-nil error
+ return googleapi.CheckResponse(httpRsp)
+ }, opts...)
+}
+
+// CreateTunedModelOperation returns a new CreateTunedModelOperation from a given name.
+// The name must be that of a previously created CreateTunedModelOperation, possibly from a different process.
+func (c *modelGRPCClient) CreateTunedModelOperation(name string) *CreateTunedModelOperation {
+ return &CreateTunedModelOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// CreateTunedModelOperation returns a new CreateTunedModelOperation from a given name.
+// The name must be that of a previously created CreateTunedModelOperation, possibly from a different process.
+func (c *modelRESTClient) CreateTunedModelOperation(name string) *CreateTunedModelOperation {
+ override := fmt.Sprintf("/v1beta/%s", name)
+ return &CreateTunedModelOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ pollPath: override,
+ }
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/permission_client.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/permission_client.go
new file mode 100644
index 000000000..948f87e70
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/permission_client.go
@@ -0,0 +1,948 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "math"
+ "net/http"
+ "net/url"
+ "time"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ httptransport "google.golang.org/api/transport/http"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/protobuf/encoding/protojson"
+ "google.golang.org/protobuf/proto"
+)
+
+var newPermissionClientHook clientHook
+
+// PermissionCallOptions contains the retry settings for each method of PermissionClient.
+type PermissionCallOptions struct {
+ CreatePermission []gax.CallOption
+ GetPermission []gax.CallOption
+ ListPermissions []gax.CallOption
+ UpdatePermission []gax.CallOption
+ DeletePermission []gax.CallOption
+ TransferOwnership []gax.CallOption
+}
+
+func defaultPermissionGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("generativelanguage.googleapis.com:443"),
+ internaloption.WithDefaultEndpointTemplate("generativelanguage.UNIVERSE_DOMAIN:443"),
+ internaloption.WithDefaultMTLSEndpoint("generativelanguage.mtls.googleapis.com:443"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultPermissionCallOptions() *PermissionCallOptions {
+ return &PermissionCallOptions{
+ CreatePermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetPermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListPermissions: []gax.CallOption{},
+ UpdatePermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeletePermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ TransferOwnership: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ }
+}
+
+func defaultPermissionRESTCallOptions() *PermissionCallOptions {
+ return &PermissionCallOptions{
+ CreatePermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ GetPermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ ListPermissions: []gax.CallOption{},
+ UpdatePermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ DeletePermission: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ TransferOwnership: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ }
+}
+
+// internalPermissionClient is an interface that defines the methods available from Generative Language API.
+type internalPermissionClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ CreatePermission(context.Context, *generativelanguagepb.CreatePermissionRequest, ...gax.CallOption) (*generativelanguagepb.Permission, error)
+ GetPermission(context.Context, *generativelanguagepb.GetPermissionRequest, ...gax.CallOption) (*generativelanguagepb.Permission, error)
+ ListPermissions(context.Context, *generativelanguagepb.ListPermissionsRequest, ...gax.CallOption) *PermissionIterator
+ UpdatePermission(context.Context, *generativelanguagepb.UpdatePermissionRequest, ...gax.CallOption) (*generativelanguagepb.Permission, error)
+ DeletePermission(context.Context, *generativelanguagepb.DeletePermissionRequest, ...gax.CallOption) error
+ TransferOwnership(context.Context, *generativelanguagepb.TransferOwnershipRequest, ...gax.CallOption) (*generativelanguagepb.TransferOwnershipResponse, error)
+}
+
+// PermissionClient is a client for interacting with Generative Language API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// Provides methods for managing permissions to PaLM API resources.
+type PermissionClient struct {
+ // The internal transport-dependent client.
+ internalClient internalPermissionClient
+
+ // The call options for this service.
+ CallOptions *PermissionCallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *PermissionClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *PermissionClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *PermissionClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// CreatePermission create a permission to a specific resource.
+func (c *PermissionClient) CreatePermission(ctx context.Context, req *generativelanguagepb.CreatePermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ return c.internalClient.CreatePermission(ctx, req, opts...)
+}
+
+// GetPermission gets information about a specific Permission.
+func (c *PermissionClient) GetPermission(ctx context.Context, req *generativelanguagepb.GetPermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ return c.internalClient.GetPermission(ctx, req, opts...)
+}
+
+// ListPermissions lists permissions for the specific resource.
+func (c *PermissionClient) ListPermissions(ctx context.Context, req *generativelanguagepb.ListPermissionsRequest, opts ...gax.CallOption) *PermissionIterator {
+ return c.internalClient.ListPermissions(ctx, req, opts...)
+}
+
+// UpdatePermission updates the permission.
+func (c *PermissionClient) UpdatePermission(ctx context.Context, req *generativelanguagepb.UpdatePermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ return c.internalClient.UpdatePermission(ctx, req, opts...)
+}
+
+// DeletePermission deletes the permission.
+func (c *PermissionClient) DeletePermission(ctx context.Context, req *generativelanguagepb.DeletePermissionRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeletePermission(ctx, req, opts...)
+}
+
+// TransferOwnership 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.
+func (c *PermissionClient) TransferOwnership(ctx context.Context, req *generativelanguagepb.TransferOwnershipRequest, opts ...gax.CallOption) (*generativelanguagepb.TransferOwnershipResponse, error) {
+ return c.internalClient.TransferOwnership(ctx, req, opts...)
+}
+
+// permissionGRPCClient is a client for interacting with Generative Language API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type permissionGRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // Points back to the CallOptions field of the containing PermissionClient
+ CallOptions **PermissionCallOptions
+
+ // The gRPC API client.
+ permissionClient generativelanguagepb.PermissionServiceClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogHeaders []string
+}
+
+// NewPermissionClient creates a new permission service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// Provides methods for managing permissions to PaLM API resources.
+func NewPermissionClient(ctx context.Context, opts ...option.ClientOption) (*PermissionClient, error) {
+ clientOpts := defaultPermissionGRPCClientOptions()
+ if newPermissionClientHook != nil {
+ hookOpts, err := newPermissionClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := PermissionClient{CallOptions: defaultPermissionCallOptions()}
+
+ c := &permissionGRPCClient{
+ connPool: connPool,
+ permissionClient: generativelanguagepb.NewPermissionServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *permissionGRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *permissionGRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *permissionGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type permissionRESTClient struct {
+ // The http endpoint to connect to.
+ endpoint string
+
+ // The http client.
+ httpClient *http.Client
+
+ // The x-goog-* headers to be sent with each request.
+ xGoogHeaders []string
+
+ // Points back to the CallOptions field of the containing PermissionClient
+ CallOptions **PermissionCallOptions
+}
+
+// NewPermissionRESTClient creates a new permission service rest client.
+//
+// Provides methods for managing permissions to PaLM API resources.
+func NewPermissionRESTClient(ctx context.Context, opts ...option.ClientOption) (*PermissionClient, error) {
+ clientOpts := append(defaultPermissionRESTClientOptions(), opts...)
+ httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
+ if err != nil {
+ return nil, err
+ }
+
+ callOpts := defaultPermissionRESTCallOptions()
+ c := &permissionRESTClient{
+ endpoint: endpoint,
+ httpClient: httpClient,
+ CallOptions: &callOpts,
+ }
+ c.setGoogleClientInfo()
+
+ return &PermissionClient{internalClient: c, CallOptions: callOpts}, nil
+}
+
+func defaultPermissionRESTClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("https://generativelanguage.googleapis.com"),
+ internaloption.WithDefaultEndpointTemplate("https://generativelanguage.UNIVERSE_DOMAIN"),
+ internaloption.WithDefaultMTLSEndpoint("https://generativelanguage.mtls.googleapis.com"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ }
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *permissionRESTClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *permissionRESTClient) Close() error {
+ // Replace httpClient with nil to force cleanup.
+ c.httpClient = nil
+ return nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: This method always returns nil.
+func (c *permissionRESTClient) Connection() *grpc.ClientConn {
+ return nil
+}
+func (c *permissionGRPCClient) CreatePermission(ctx context.Context, req *generativelanguagepb.CreatePermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).CreatePermission[0:len((*c.CallOptions).CreatePermission):len((*c.CallOptions).CreatePermission)], opts...)
+ var resp *generativelanguagepb.Permission
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.permissionClient.CreatePermission(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *permissionGRPCClient) GetPermission(ctx context.Context, req *generativelanguagepb.GetPermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GetPermission[0:len((*c.CallOptions).GetPermission):len((*c.CallOptions).GetPermission)], opts...)
+ var resp *generativelanguagepb.Permission
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.permissionClient.GetPermission(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *permissionGRPCClient) ListPermissions(ctx context.Context, req *generativelanguagepb.ListPermissionsRequest, opts ...gax.CallOption) *PermissionIterator {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).ListPermissions[0:len((*c.CallOptions).ListPermissions):len((*c.CallOptions).ListPermissions)], opts...)
+ it := &PermissionIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListPermissionsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Permission, string, error) {
+ resp := &generativelanguagepb.ListPermissionsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.permissionClient.ListPermissions(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetPermissions(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *permissionGRPCClient) UpdatePermission(ctx context.Context, req *generativelanguagepb.UpdatePermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "permission.name", url.QueryEscape(req.GetPermission().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).UpdatePermission[0:len((*c.CallOptions).UpdatePermission):len((*c.CallOptions).UpdatePermission)], opts...)
+ var resp *generativelanguagepb.Permission
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.permissionClient.UpdatePermission(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *permissionGRPCClient) DeletePermission(ctx context.Context, req *generativelanguagepb.DeletePermissionRequest, opts ...gax.CallOption) error {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).DeletePermission[0:len((*c.CallOptions).DeletePermission):len((*c.CallOptions).DeletePermission)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.permissionClient.DeletePermission(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *permissionGRPCClient) TransferOwnership(ctx context.Context, req *generativelanguagepb.TransferOwnershipRequest, opts ...gax.CallOption) (*generativelanguagepb.TransferOwnershipResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).TransferOwnership[0:len((*c.CallOptions).TransferOwnership):len((*c.CallOptions).TransferOwnership)], opts...)
+ var resp *generativelanguagepb.TransferOwnershipResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.permissionClient.TransferOwnership(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// CreatePermission create a permission to a specific resource.
+func (c *permissionRESTClient) CreatePermission(ctx context.Context, req *generativelanguagepb.CreatePermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetPermission()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/permissions", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CreatePermission[0:len((*c.CallOptions).CreatePermission):len((*c.CallOptions).CreatePermission)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Permission{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// GetPermission gets information about a specific Permission.
+func (c *permissionRESTClient) GetPermission(ctx context.Context, req *generativelanguagepb.GetPermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GetPermission[0:len((*c.CallOptions).GetPermission):len((*c.CallOptions).GetPermission)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Permission{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// ListPermissions lists permissions for the specific resource.
+func (c *permissionRESTClient) ListPermissions(ctx context.Context, req *generativelanguagepb.ListPermissionsRequest, opts ...gax.CallOption) *PermissionIterator {
+ it := &PermissionIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListPermissionsRequest)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Permission, string, error) {
+ resp := &generativelanguagepb.ListPermissionsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, "", err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/permissions", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetPageSize() != 0 {
+ params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
+ }
+ if req.GetPageToken() != "" {
+ params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, "", e
+ }
+ it.Response = resp
+ return resp.GetPermissions(), resp.GetNextPageToken(), nil
+ }
+
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// UpdatePermission updates the permission.
+func (c *permissionRESTClient) UpdatePermission(ctx context.Context, req *generativelanguagepb.UpdatePermissionRequest, opts ...gax.CallOption) (*generativelanguagepb.Permission, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetPermission()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetPermission().GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetUpdateMask() != nil {
+ updateMask, err := protojson.Marshal(req.GetUpdateMask())
+ if err != nil {
+ return nil, err
+ }
+ params.Add("updateMask", string(updateMask[1:len(updateMask)-1]))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "permission.name", url.QueryEscape(req.GetPermission().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).UpdatePermission[0:len((*c.CallOptions).UpdatePermission):len((*c.CallOptions).UpdatePermission)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Permission{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// DeletePermission deletes the permission.
+func (c *permissionRESTClient) DeletePermission(ctx context.Context, req *generativelanguagepb.DeletePermissionRequest, opts ...gax.CallOption) error {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ // Returns nil if there is no error, otherwise wraps
+ // the response code and body into a non-nil error
+ return googleapi.CheckResponse(httpRsp)
+ }, opts...)
+}
+
+// TransferOwnership 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.
+func (c *permissionRESTClient) TransferOwnership(ctx context.Context, req *generativelanguagepb.TransferOwnershipRequest, opts ...gax.CallOption) (*generativelanguagepb.TransferOwnershipResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:transferOwnership", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).TransferOwnership[0:len((*c.CallOptions).TransferOwnership):len((*c.CallOptions).TransferOwnership)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.TransferOwnershipResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/retriever_client.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/retriever_client.go
new file mode 100644
index 000000000..58d417cd9
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/retriever_client.go
@@ -0,0 +1,2504 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "math"
+ "net/http"
+ "net/url"
+ "time"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/iterator"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ httptransport "google.golang.org/api/transport/http"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/protobuf/encoding/protojson"
+ "google.golang.org/protobuf/proto"
+)
+
+var newRetrieverClientHook clientHook
+
+// RetrieverCallOptions contains the retry settings for each method of RetrieverClient.
+type RetrieverCallOptions struct {
+ CreateCorpus []gax.CallOption
+ GetCorpus []gax.CallOption
+ UpdateCorpus []gax.CallOption
+ DeleteCorpus []gax.CallOption
+ ListCorpora []gax.CallOption
+ QueryCorpus []gax.CallOption
+ CreateDocument []gax.CallOption
+ GetDocument []gax.CallOption
+ UpdateDocument []gax.CallOption
+ DeleteDocument []gax.CallOption
+ ListDocuments []gax.CallOption
+ QueryDocument []gax.CallOption
+ CreateChunk []gax.CallOption
+ BatchCreateChunks []gax.CallOption
+ GetChunk []gax.CallOption
+ UpdateChunk []gax.CallOption
+ BatchUpdateChunks []gax.CallOption
+ DeleteChunk []gax.CallOption
+ BatchDeleteChunks []gax.CallOption
+ ListChunks []gax.CallOption
+}
+
+func defaultRetrieverGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("generativelanguage.googleapis.com:443"),
+ internaloption.WithDefaultEndpointTemplate("generativelanguage.UNIVERSE_DOMAIN:443"),
+ internaloption.WithDefaultMTLSEndpoint("generativelanguage.mtls.googleapis.com:443"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultRetrieverCallOptions() *RetrieverCallOptions {
+ return &RetrieverCallOptions{
+ CreateCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListCorpora: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ QueryCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ GetDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ DeleteDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ ListDocuments: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ QueryDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CreateChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ BatchCreateChunks: []gax.CallOption{},
+ GetChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ UpdateChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ BatchUpdateChunks: []gax.CallOption{},
+ DeleteChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ BatchDeleteChunks: []gax.CallOption{},
+ ListChunks: []gax.CallOption{},
+ }
+}
+
+func defaultRetrieverRESTCallOptions() *RetrieverCallOptions {
+ return &RetrieverCallOptions{
+ CreateCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ GetCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ UpdateCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ DeleteCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ ListCorpora: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ QueryCorpus: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ CreateDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ GetDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ UpdateDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ DeleteDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ ListDocuments: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ QueryDocument: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ CreateChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ BatchCreateChunks: []gax.CallOption{},
+ GetChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ UpdateChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ BatchUpdateChunks: []gax.CallOption{},
+ DeleteChunk: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ BatchDeleteChunks: []gax.CallOption{},
+ ListChunks: []gax.CallOption{},
+ }
+}
+
+// internalRetrieverClient is an interface that defines the methods available from Generative Language API.
+type internalRetrieverClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ CreateCorpus(context.Context, *generativelanguagepb.CreateCorpusRequest, ...gax.CallOption) (*generativelanguagepb.Corpus, error)
+ GetCorpus(context.Context, *generativelanguagepb.GetCorpusRequest, ...gax.CallOption) (*generativelanguagepb.Corpus, error)
+ UpdateCorpus(context.Context, *generativelanguagepb.UpdateCorpusRequest, ...gax.CallOption) (*generativelanguagepb.Corpus, error)
+ DeleteCorpus(context.Context, *generativelanguagepb.DeleteCorpusRequest, ...gax.CallOption) error
+ ListCorpora(context.Context, *generativelanguagepb.ListCorporaRequest, ...gax.CallOption) *CorpusIterator
+ QueryCorpus(context.Context, *generativelanguagepb.QueryCorpusRequest, ...gax.CallOption) (*generativelanguagepb.QueryCorpusResponse, error)
+ CreateDocument(context.Context, *generativelanguagepb.CreateDocumentRequest, ...gax.CallOption) (*generativelanguagepb.Document, error)
+ GetDocument(context.Context, *generativelanguagepb.GetDocumentRequest, ...gax.CallOption) (*generativelanguagepb.Document, error)
+ UpdateDocument(context.Context, *generativelanguagepb.UpdateDocumentRequest, ...gax.CallOption) (*generativelanguagepb.Document, error)
+ DeleteDocument(context.Context, *generativelanguagepb.DeleteDocumentRequest, ...gax.CallOption) error
+ ListDocuments(context.Context, *generativelanguagepb.ListDocumentsRequest, ...gax.CallOption) *DocumentIterator
+ QueryDocument(context.Context, *generativelanguagepb.QueryDocumentRequest, ...gax.CallOption) (*generativelanguagepb.QueryDocumentResponse, error)
+ CreateChunk(context.Context, *generativelanguagepb.CreateChunkRequest, ...gax.CallOption) (*generativelanguagepb.Chunk, error)
+ BatchCreateChunks(context.Context, *generativelanguagepb.BatchCreateChunksRequest, ...gax.CallOption) (*generativelanguagepb.BatchCreateChunksResponse, error)
+ GetChunk(context.Context, *generativelanguagepb.GetChunkRequest, ...gax.CallOption) (*generativelanguagepb.Chunk, error)
+ UpdateChunk(context.Context, *generativelanguagepb.UpdateChunkRequest, ...gax.CallOption) (*generativelanguagepb.Chunk, error)
+ BatchUpdateChunks(context.Context, *generativelanguagepb.BatchUpdateChunksRequest, ...gax.CallOption) (*generativelanguagepb.BatchUpdateChunksResponse, error)
+ DeleteChunk(context.Context, *generativelanguagepb.DeleteChunkRequest, ...gax.CallOption) error
+ BatchDeleteChunks(context.Context, *generativelanguagepb.BatchDeleteChunksRequest, ...gax.CallOption) error
+ ListChunks(context.Context, *generativelanguagepb.ListChunksRequest, ...gax.CallOption) *ChunkIterator
+}
+
+// RetrieverClient is a client for interacting with Generative Language API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// An API for semantic search over a corpus of user uploaded content.
+type RetrieverClient struct {
+ // The internal transport-dependent client.
+ internalClient internalRetrieverClient
+
+ // The call options for this service.
+ CallOptions *RetrieverCallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *RetrieverClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *RetrieverClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *RetrieverClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// CreateCorpus creates an empty Corpus.
+func (c *RetrieverClient) CreateCorpus(ctx context.Context, req *generativelanguagepb.CreateCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ return c.internalClient.CreateCorpus(ctx, req, opts...)
+}
+
+// GetCorpus gets information about a specific Corpus.
+func (c *RetrieverClient) GetCorpus(ctx context.Context, req *generativelanguagepb.GetCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ return c.internalClient.GetCorpus(ctx, req, opts...)
+}
+
+// UpdateCorpus updates a Corpus.
+func (c *RetrieverClient) UpdateCorpus(ctx context.Context, req *generativelanguagepb.UpdateCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ return c.internalClient.UpdateCorpus(ctx, req, opts...)
+}
+
+// DeleteCorpus deletes a Corpus.
+func (c *RetrieverClient) DeleteCorpus(ctx context.Context, req *generativelanguagepb.DeleteCorpusRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteCorpus(ctx, req, opts...)
+}
+
+// ListCorpora lists all Corpora owned by the user.
+func (c *RetrieverClient) ListCorpora(ctx context.Context, req *generativelanguagepb.ListCorporaRequest, opts ...gax.CallOption) *CorpusIterator {
+ return c.internalClient.ListCorpora(ctx, req, opts...)
+}
+
+// QueryCorpus performs semantic search over a Corpus.
+func (c *RetrieverClient) QueryCorpus(ctx context.Context, req *generativelanguagepb.QueryCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.QueryCorpusResponse, error) {
+ return c.internalClient.QueryCorpus(ctx, req, opts...)
+}
+
+// CreateDocument creates an empty Document.
+func (c *RetrieverClient) CreateDocument(ctx context.Context, req *generativelanguagepb.CreateDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ return c.internalClient.CreateDocument(ctx, req, opts...)
+}
+
+// GetDocument gets information about a specific Document.
+func (c *RetrieverClient) GetDocument(ctx context.Context, req *generativelanguagepb.GetDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ return c.internalClient.GetDocument(ctx, req, opts...)
+}
+
+// UpdateDocument updates a Document.
+func (c *RetrieverClient) UpdateDocument(ctx context.Context, req *generativelanguagepb.UpdateDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ return c.internalClient.UpdateDocument(ctx, req, opts...)
+}
+
+// DeleteDocument deletes a Document.
+func (c *RetrieverClient) DeleteDocument(ctx context.Context, req *generativelanguagepb.DeleteDocumentRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteDocument(ctx, req, opts...)
+}
+
+// ListDocuments lists all Documents in a Corpus.
+func (c *RetrieverClient) ListDocuments(ctx context.Context, req *generativelanguagepb.ListDocumentsRequest, opts ...gax.CallOption) *DocumentIterator {
+ return c.internalClient.ListDocuments(ctx, req, opts...)
+}
+
+// QueryDocument performs semantic search over a Document.
+func (c *RetrieverClient) QueryDocument(ctx context.Context, req *generativelanguagepb.QueryDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.QueryDocumentResponse, error) {
+ return c.internalClient.QueryDocument(ctx, req, opts...)
+}
+
+// CreateChunk creates a Chunk.
+func (c *RetrieverClient) CreateChunk(ctx context.Context, req *generativelanguagepb.CreateChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ return c.internalClient.CreateChunk(ctx, req, opts...)
+}
+
+// BatchCreateChunks batch create Chunks.
+func (c *RetrieverClient) BatchCreateChunks(ctx context.Context, req *generativelanguagepb.BatchCreateChunksRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchCreateChunksResponse, error) {
+ return c.internalClient.BatchCreateChunks(ctx, req, opts...)
+}
+
+// GetChunk gets information about a specific Chunk.
+func (c *RetrieverClient) GetChunk(ctx context.Context, req *generativelanguagepb.GetChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ return c.internalClient.GetChunk(ctx, req, opts...)
+}
+
+// UpdateChunk updates a Chunk.
+func (c *RetrieverClient) UpdateChunk(ctx context.Context, req *generativelanguagepb.UpdateChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ return c.internalClient.UpdateChunk(ctx, req, opts...)
+}
+
+// BatchUpdateChunks batch update Chunks.
+func (c *RetrieverClient) BatchUpdateChunks(ctx context.Context, req *generativelanguagepb.BatchUpdateChunksRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchUpdateChunksResponse, error) {
+ return c.internalClient.BatchUpdateChunks(ctx, req, opts...)
+}
+
+// DeleteChunk deletes a Chunk.
+func (c *RetrieverClient) DeleteChunk(ctx context.Context, req *generativelanguagepb.DeleteChunkRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteChunk(ctx, req, opts...)
+}
+
+// BatchDeleteChunks batch delete Chunks.
+func (c *RetrieverClient) BatchDeleteChunks(ctx context.Context, req *generativelanguagepb.BatchDeleteChunksRequest, opts ...gax.CallOption) error {
+ return c.internalClient.BatchDeleteChunks(ctx, req, opts...)
+}
+
+// ListChunks lists all Chunks in a Document.
+func (c *RetrieverClient) ListChunks(ctx context.Context, req *generativelanguagepb.ListChunksRequest, opts ...gax.CallOption) *ChunkIterator {
+ return c.internalClient.ListChunks(ctx, req, opts...)
+}
+
+// retrieverGRPCClient is a client for interacting with Generative Language API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type retrieverGRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // Points back to the CallOptions field of the containing RetrieverClient
+ CallOptions **RetrieverCallOptions
+
+ // The gRPC API client.
+ retrieverClient generativelanguagepb.RetrieverServiceClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogHeaders []string
+}
+
+// NewRetrieverClient creates a new retriever service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// An API for semantic search over a corpus of user uploaded content.
+func NewRetrieverClient(ctx context.Context, opts ...option.ClientOption) (*RetrieverClient, error) {
+ clientOpts := defaultRetrieverGRPCClientOptions()
+ if newRetrieverClientHook != nil {
+ hookOpts, err := newRetrieverClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := RetrieverClient{CallOptions: defaultRetrieverCallOptions()}
+
+ c := &retrieverGRPCClient{
+ connPool: connPool,
+ retrieverClient: generativelanguagepb.NewRetrieverServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *retrieverGRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *retrieverGRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *retrieverGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type retrieverRESTClient struct {
+ // The http endpoint to connect to.
+ endpoint string
+
+ // The http client.
+ httpClient *http.Client
+
+ // The x-goog-* headers to be sent with each request.
+ xGoogHeaders []string
+
+ // Points back to the CallOptions field of the containing RetrieverClient
+ CallOptions **RetrieverCallOptions
+}
+
+// NewRetrieverRESTClient creates a new retriever service rest client.
+//
+// An API for semantic search over a corpus of user uploaded content.
+func NewRetrieverRESTClient(ctx context.Context, opts ...option.ClientOption) (*RetrieverClient, error) {
+ clientOpts := append(defaultRetrieverRESTClientOptions(), opts...)
+ httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
+ if err != nil {
+ return nil, err
+ }
+
+ callOpts := defaultRetrieverRESTCallOptions()
+ c := &retrieverRESTClient{
+ endpoint: endpoint,
+ httpClient: httpClient,
+ CallOptions: &callOpts,
+ }
+ c.setGoogleClientInfo()
+
+ return &RetrieverClient{internalClient: c, CallOptions: callOpts}, nil
+}
+
+func defaultRetrieverRESTClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("https://generativelanguage.googleapis.com"),
+ internaloption.WithDefaultEndpointTemplate("https://generativelanguage.UNIVERSE_DOMAIN"),
+ internaloption.WithDefaultMTLSEndpoint("https://generativelanguage.mtls.googleapis.com"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ }
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *retrieverRESTClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *retrieverRESTClient) Close() error {
+ // Replace httpClient with nil to force cleanup.
+ c.httpClient = nil
+ return nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: This method always returns nil.
+func (c *retrieverRESTClient) Connection() *grpc.ClientConn {
+ return nil
+}
+func (c *retrieverGRPCClient) CreateCorpus(ctx context.Context, req *generativelanguagepb.CreateCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ opts = append((*c.CallOptions).CreateCorpus[0:len((*c.CallOptions).CreateCorpus):len((*c.CallOptions).CreateCorpus)], opts...)
+ var resp *generativelanguagepb.Corpus
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.CreateCorpus(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) GetCorpus(ctx context.Context, req *generativelanguagepb.GetCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GetCorpus[0:len((*c.CallOptions).GetCorpus):len((*c.CallOptions).GetCorpus)], opts...)
+ var resp *generativelanguagepb.Corpus
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.GetCorpus(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) UpdateCorpus(ctx context.Context, req *generativelanguagepb.UpdateCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "corpus.name", url.QueryEscape(req.GetCorpus().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateCorpus[0:len((*c.CallOptions).UpdateCorpus):len((*c.CallOptions).UpdateCorpus)], opts...)
+ var resp *generativelanguagepb.Corpus
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.UpdateCorpus(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) DeleteCorpus(ctx context.Context, req *generativelanguagepb.DeleteCorpusRequest, opts ...gax.CallOption) error {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).DeleteCorpus[0:len((*c.CallOptions).DeleteCorpus):len((*c.CallOptions).DeleteCorpus)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.retrieverClient.DeleteCorpus(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *retrieverGRPCClient) ListCorpora(ctx context.Context, req *generativelanguagepb.ListCorporaRequest, opts ...gax.CallOption) *CorpusIterator {
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, c.xGoogHeaders...)
+ opts = append((*c.CallOptions).ListCorpora[0:len((*c.CallOptions).ListCorpora):len((*c.CallOptions).ListCorpora)], opts...)
+ it := &CorpusIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListCorporaRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Corpus, string, error) {
+ resp := &generativelanguagepb.ListCorporaResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.ListCorpora(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetCorpora(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *retrieverGRPCClient) QueryCorpus(ctx context.Context, req *generativelanguagepb.QueryCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.QueryCorpusResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).QueryCorpus[0:len((*c.CallOptions).QueryCorpus):len((*c.CallOptions).QueryCorpus)], opts...)
+ var resp *generativelanguagepb.QueryCorpusResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.QueryCorpus(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) CreateDocument(ctx context.Context, req *generativelanguagepb.CreateDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).CreateDocument[0:len((*c.CallOptions).CreateDocument):len((*c.CallOptions).CreateDocument)], opts...)
+ var resp *generativelanguagepb.Document
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.CreateDocument(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) GetDocument(ctx context.Context, req *generativelanguagepb.GetDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GetDocument[0:len((*c.CallOptions).GetDocument):len((*c.CallOptions).GetDocument)], opts...)
+ var resp *generativelanguagepb.Document
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.GetDocument(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) UpdateDocument(ctx context.Context, req *generativelanguagepb.UpdateDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "document.name", url.QueryEscape(req.GetDocument().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateDocument[0:len((*c.CallOptions).UpdateDocument):len((*c.CallOptions).UpdateDocument)], opts...)
+ var resp *generativelanguagepb.Document
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.UpdateDocument(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) DeleteDocument(ctx context.Context, req *generativelanguagepb.DeleteDocumentRequest, opts ...gax.CallOption) error {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).DeleteDocument[0:len((*c.CallOptions).DeleteDocument):len((*c.CallOptions).DeleteDocument)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.retrieverClient.DeleteDocument(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *retrieverGRPCClient) ListDocuments(ctx context.Context, req *generativelanguagepb.ListDocumentsRequest, opts ...gax.CallOption) *DocumentIterator {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).ListDocuments[0:len((*c.CallOptions).ListDocuments):len((*c.CallOptions).ListDocuments)], opts...)
+ it := &DocumentIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListDocumentsRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Document, string, error) {
+ resp := &generativelanguagepb.ListDocumentsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.ListDocuments(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetDocuments(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+func (c *retrieverGRPCClient) QueryDocument(ctx context.Context, req *generativelanguagepb.QueryDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.QueryDocumentResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).QueryDocument[0:len((*c.CallOptions).QueryDocument):len((*c.CallOptions).QueryDocument)], opts...)
+ var resp *generativelanguagepb.QueryDocumentResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.QueryDocument(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) CreateChunk(ctx context.Context, req *generativelanguagepb.CreateChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).CreateChunk[0:len((*c.CallOptions).CreateChunk):len((*c.CallOptions).CreateChunk)], opts...)
+ var resp *generativelanguagepb.Chunk
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.CreateChunk(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) BatchCreateChunks(ctx context.Context, req *generativelanguagepb.BatchCreateChunksRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchCreateChunksResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).BatchCreateChunks[0:len((*c.CallOptions).BatchCreateChunks):len((*c.CallOptions).BatchCreateChunks)], opts...)
+ var resp *generativelanguagepb.BatchCreateChunksResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.BatchCreateChunks(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) GetChunk(ctx context.Context, req *generativelanguagepb.GetChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GetChunk[0:len((*c.CallOptions).GetChunk):len((*c.CallOptions).GetChunk)], opts...)
+ var resp *generativelanguagepb.Chunk
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.GetChunk(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) UpdateChunk(ctx context.Context, req *generativelanguagepb.UpdateChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "chunk.name", url.QueryEscape(req.GetChunk().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateChunk[0:len((*c.CallOptions).UpdateChunk):len((*c.CallOptions).UpdateChunk)], opts...)
+ var resp *generativelanguagepb.Chunk
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.UpdateChunk(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) BatchUpdateChunks(ctx context.Context, req *generativelanguagepb.BatchUpdateChunksRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchUpdateChunksResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).BatchUpdateChunks[0:len((*c.CallOptions).BatchUpdateChunks):len((*c.CallOptions).BatchUpdateChunks)], opts...)
+ var resp *generativelanguagepb.BatchUpdateChunksResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.BatchUpdateChunks(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *retrieverGRPCClient) DeleteChunk(ctx context.Context, req *generativelanguagepb.DeleteChunkRequest, opts ...gax.CallOption) error {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).DeleteChunk[0:len((*c.CallOptions).DeleteChunk):len((*c.CallOptions).DeleteChunk)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.retrieverClient.DeleteChunk(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *retrieverGRPCClient) BatchDeleteChunks(ctx context.Context, req *generativelanguagepb.BatchDeleteChunksRequest, opts ...gax.CallOption) error {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).BatchDeleteChunks[0:len((*c.CallOptions).BatchDeleteChunks):len((*c.CallOptions).BatchDeleteChunks)], opts...)
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ _, err = c.retrieverClient.BatchDeleteChunks(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ return err
+}
+
+func (c *retrieverGRPCClient) ListChunks(ctx context.Context, req *generativelanguagepb.ListChunksRequest, opts ...gax.CallOption) *ChunkIterator {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).ListChunks[0:len((*c.CallOptions).ListChunks):len((*c.CallOptions).ListChunks)], opts...)
+ it := &ChunkIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListChunksRequest)
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Chunk, string, error) {
+ resp := &generativelanguagepb.ListChunksResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.retrieverClient.ListChunks(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, "", err
+ }
+
+ it.Response = resp
+ return resp.GetChunks(), resp.GetNextPageToken(), nil
+ }
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// CreateCorpus creates an empty Corpus.
+func (c *retrieverRESTClient) CreateCorpus(ctx context.Context, req *generativelanguagepb.CreateCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetCorpus()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/corpora")
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CreateCorpus[0:len((*c.CallOptions).CreateCorpus):len((*c.CallOptions).CreateCorpus)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Corpus{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// GetCorpus gets information about a specific Corpus.
+func (c *retrieverRESTClient) GetCorpus(ctx context.Context, req *generativelanguagepb.GetCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GetCorpus[0:len((*c.CallOptions).GetCorpus):len((*c.CallOptions).GetCorpus)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Corpus{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// UpdateCorpus updates a Corpus.
+func (c *retrieverRESTClient) UpdateCorpus(ctx context.Context, req *generativelanguagepb.UpdateCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.Corpus, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetCorpus()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetCorpus().GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetUpdateMask() != nil {
+ updateMask, err := protojson.Marshal(req.GetUpdateMask())
+ if err != nil {
+ return nil, err
+ }
+ params.Add("updateMask", string(updateMask[1:len(updateMask)-1]))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "corpus.name", url.QueryEscape(req.GetCorpus().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateCorpus[0:len((*c.CallOptions).UpdateCorpus):len((*c.CallOptions).UpdateCorpus)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Corpus{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// DeleteCorpus deletes a Corpus.
+func (c *retrieverRESTClient) DeleteCorpus(ctx context.Context, req *generativelanguagepb.DeleteCorpusRequest, opts ...gax.CallOption) error {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetForce() {
+ params.Add("force", fmt.Sprintf("%v", req.GetForce()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ // Returns nil if there is no error, otherwise wraps
+ // the response code and body into a non-nil error
+ return googleapi.CheckResponse(httpRsp)
+ }, opts...)
+}
+
+// ListCorpora lists all Corpora owned by the user.
+func (c *retrieverRESTClient) ListCorpora(ctx context.Context, req *generativelanguagepb.ListCorporaRequest, opts ...gax.CallOption) *CorpusIterator {
+ it := &CorpusIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListCorporaRequest)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Corpus, string, error) {
+ resp := &generativelanguagepb.ListCorporaResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, "", err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/corpora")
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetPageSize() != 0 {
+ params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
+ }
+ if req.GetPageToken() != "" {
+ params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, "", e
+ }
+ it.Response = resp
+ return resp.GetCorpora(), resp.GetNextPageToken(), nil
+ }
+
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// QueryCorpus performs semantic search over a Corpus.
+func (c *retrieverRESTClient) QueryCorpus(ctx context.Context, req *generativelanguagepb.QueryCorpusRequest, opts ...gax.CallOption) (*generativelanguagepb.QueryCorpusResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:query", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).QueryCorpus[0:len((*c.CallOptions).QueryCorpus):len((*c.CallOptions).QueryCorpus)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.QueryCorpusResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// CreateDocument creates an empty Document.
+func (c *retrieverRESTClient) CreateDocument(ctx context.Context, req *generativelanguagepb.CreateDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetDocument()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/documents", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CreateDocument[0:len((*c.CallOptions).CreateDocument):len((*c.CallOptions).CreateDocument)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Document{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// GetDocument gets information about a specific Document.
+func (c *retrieverRESTClient) GetDocument(ctx context.Context, req *generativelanguagepb.GetDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GetDocument[0:len((*c.CallOptions).GetDocument):len((*c.CallOptions).GetDocument)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Document{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// UpdateDocument updates a Document.
+func (c *retrieverRESTClient) UpdateDocument(ctx context.Context, req *generativelanguagepb.UpdateDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.Document, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetDocument()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetDocument().GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetUpdateMask() != nil {
+ updateMask, err := protojson.Marshal(req.GetUpdateMask())
+ if err != nil {
+ return nil, err
+ }
+ params.Add("updateMask", string(updateMask[1:len(updateMask)-1]))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "document.name", url.QueryEscape(req.GetDocument().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateDocument[0:len((*c.CallOptions).UpdateDocument):len((*c.CallOptions).UpdateDocument)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Document{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// DeleteDocument deletes a Document.
+func (c *retrieverRESTClient) DeleteDocument(ctx context.Context, req *generativelanguagepb.DeleteDocumentRequest, opts ...gax.CallOption) error {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetForce() {
+ params.Add("force", fmt.Sprintf("%v", req.GetForce()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ // Returns nil if there is no error, otherwise wraps
+ // the response code and body into a non-nil error
+ return googleapi.CheckResponse(httpRsp)
+ }, opts...)
+}
+
+// ListDocuments lists all Documents in a Corpus.
+func (c *retrieverRESTClient) ListDocuments(ctx context.Context, req *generativelanguagepb.ListDocumentsRequest, opts ...gax.CallOption) *DocumentIterator {
+ it := &DocumentIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListDocumentsRequest)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Document, string, error) {
+ resp := &generativelanguagepb.ListDocumentsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, "", err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/documents", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetPageSize() != 0 {
+ params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
+ }
+ if req.GetPageToken() != "" {
+ params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, "", e
+ }
+ it.Response = resp
+ return resp.GetDocuments(), resp.GetNextPageToken(), nil
+ }
+
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
+
+// QueryDocument performs semantic search over a Document.
+func (c *retrieverRESTClient) QueryDocument(ctx context.Context, req *generativelanguagepb.QueryDocumentRequest, opts ...gax.CallOption) (*generativelanguagepb.QueryDocumentResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:query", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).QueryDocument[0:len((*c.CallOptions).QueryDocument):len((*c.CallOptions).QueryDocument)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.QueryDocumentResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// CreateChunk creates a Chunk.
+func (c *retrieverRESTClient) CreateChunk(ctx context.Context, req *generativelanguagepb.CreateChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetChunk()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/chunks", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CreateChunk[0:len((*c.CallOptions).CreateChunk):len((*c.CallOptions).CreateChunk)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Chunk{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// BatchCreateChunks batch create Chunks.
+func (c *retrieverRESTClient) BatchCreateChunks(ctx context.Context, req *generativelanguagepb.BatchCreateChunksRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchCreateChunksResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/chunks:batchCreate", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).BatchCreateChunks[0:len((*c.CallOptions).BatchCreateChunks):len((*c.CallOptions).BatchCreateChunks)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.BatchCreateChunksResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// GetChunk gets information about a specific Chunk.
+func (c *retrieverRESTClient) GetChunk(ctx context.Context, req *generativelanguagepb.GetChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GetChunk[0:len((*c.CallOptions).GetChunk):len((*c.CallOptions).GetChunk)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Chunk{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// UpdateChunk updates a Chunk.
+func (c *retrieverRESTClient) UpdateChunk(ctx context.Context, req *generativelanguagepb.UpdateChunkRequest, opts ...gax.CallOption) (*generativelanguagepb.Chunk, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ body := req.GetChunk()
+ jsonReq, err := m.Marshal(body)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetChunk().GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetUpdateMask() != nil {
+ updateMask, err := protojson.Marshal(req.GetUpdateMask())
+ if err != nil {
+ return nil, err
+ }
+ params.Add("updateMask", string(updateMask[1:len(updateMask)-1]))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "chunk.name", url.QueryEscape(req.GetChunk().GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).UpdateChunk[0:len((*c.CallOptions).UpdateChunk):len((*c.CallOptions).UpdateChunk)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.Chunk{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// BatchUpdateChunks batch update Chunks.
+func (c *retrieverRESTClient) BatchUpdateChunks(ctx context.Context, req *generativelanguagepb.BatchUpdateChunksRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchUpdateChunksResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/chunks:batchUpdate", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).BatchUpdateChunks[0:len((*c.CallOptions).BatchUpdateChunks):len((*c.CallOptions).BatchUpdateChunks)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.BatchUpdateChunksResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// DeleteChunk deletes a Chunk.
+func (c *retrieverRESTClient) DeleteChunk(ctx context.Context, req *generativelanguagepb.DeleteChunkRequest, opts ...gax.CallOption) error {
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v", req.GetName())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ // Returns nil if there is no error, otherwise wraps
+ // the response code and body into a non-nil error
+ return googleapi.CheckResponse(httpRsp)
+ }, opts...)
+}
+
+// BatchDeleteChunks batch delete Chunks.
+func (c *retrieverRESTClient) BatchDeleteChunks(ctx context.Context, req *generativelanguagepb.BatchDeleteChunksRequest, opts ...gax.CallOption) error {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/chunks:batchDelete", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ return gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ // Returns nil if there is no error, otherwise wraps
+ // the response code and body into a non-nil error
+ return googleapi.CheckResponse(httpRsp)
+ }, opts...)
+}
+
+// ListChunks lists all Chunks in a Document.
+func (c *retrieverRESTClient) ListChunks(ctx context.Context, req *generativelanguagepb.ListChunksRequest, opts ...gax.CallOption) *ChunkIterator {
+ it := &ChunkIterator{}
+ req = proto.Clone(req).(*generativelanguagepb.ListChunksRequest)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ it.InternalFetch = func(pageSize int, pageToken string) ([]*generativelanguagepb.Chunk, string, error) {
+ resp := &generativelanguagepb.ListChunksResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
+ if pageSize > math.MaxInt32 {
+ req.PageSize = math.MaxInt32
+ } else if pageSize != 0 {
+ req.PageSize = int32(pageSize)
+ }
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, "", err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v/chunks", req.GetParent())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+ if req.GetPageSize() != 0 {
+ params.Add("pageSize", fmt.Sprintf("%v", req.GetPageSize()))
+ }
+ if req.GetPageToken() != "" {
+ params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
+ }
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := append(c.xGoogHeaders, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
+ if err != nil {
+ return err
+ }
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, "", e
+ }
+ it.Response = resp
+ return resp.GetChunks(), resp.GetNextPageToken(), nil
+ }
+
+ fetch := func(pageSize int, pageToken string) (string, error) {
+ items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
+ if err != nil {
+ return "", err
+ }
+ it.items = append(it.items, items...)
+ return nextPageToken, nil
+ }
+
+ it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
+ it.pageInfo.MaxSize = int(req.GetPageSize())
+ it.pageInfo.Token = req.GetPageToken()
+
+ return it
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/text_client.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/text_client.go
new file mode 100644
index 000000000..aae841c37
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/text_client.go
@@ -0,0 +1,720 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+package generativelanguage
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "math"
+ "net/http"
+ "net/url"
+ "time"
+
+ generativelanguagepb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/option"
+ "google.golang.org/api/option/internaloption"
+ gtransport "google.golang.org/api/transport/grpc"
+ httptransport "google.golang.org/api/transport/http"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/protobuf/encoding/protojson"
+)
+
+var newTextClientHook clientHook
+
+// TextCallOptions contains the retry settings for each method of TextClient.
+type TextCallOptions struct {
+ GenerateText []gax.CallOption
+ EmbedText []gax.CallOption
+ BatchEmbedText []gax.CallOption
+ CountTextTokens []gax.CallOption
+}
+
+func defaultTextGRPCClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("generativelanguage.googleapis.com:443"),
+ internaloption.WithDefaultEndpointTemplate("generativelanguage.UNIVERSE_DOMAIN:443"),
+ internaloption.WithDefaultMTLSEndpoint("generativelanguage.mtls.googleapis.com:443"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ internaloption.EnableJwtWithScope(),
+ option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
+ grpc.MaxCallRecvMsgSize(math.MaxInt32))),
+ }
+}
+
+func defaultTextCallOptions() *TextCallOptions {
+ return &TextCallOptions{
+ GenerateText: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ EmbedText: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ BatchEmbedText: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ CountTextTokens: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnCodes([]codes.Code{
+ codes.Unavailable,
+ }, gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ })
+ }),
+ },
+ }
+}
+
+func defaultTextRESTCallOptions() *TextCallOptions {
+ return &TextCallOptions{
+ GenerateText: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ EmbedText: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ BatchEmbedText: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ CountTextTokens: []gax.CallOption{
+ gax.WithTimeout(60000 * time.Millisecond),
+ gax.WithRetry(func() gax.Retryer {
+ return gax.OnHTTPCodes(gax.Backoff{
+ Initial: 1000 * time.Millisecond,
+ Max: 10000 * time.Millisecond,
+ Multiplier: 1.30,
+ },
+ http.StatusServiceUnavailable)
+ }),
+ },
+ }
+}
+
+// internalTextClient is an interface that defines the methods available from Generative Language API.
+type internalTextClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ GenerateText(context.Context, *generativelanguagepb.GenerateTextRequest, ...gax.CallOption) (*generativelanguagepb.GenerateTextResponse, error)
+ EmbedText(context.Context, *generativelanguagepb.EmbedTextRequest, ...gax.CallOption) (*generativelanguagepb.EmbedTextResponse, error)
+ BatchEmbedText(context.Context, *generativelanguagepb.BatchEmbedTextRequest, ...gax.CallOption) (*generativelanguagepb.BatchEmbedTextResponse, error)
+ CountTextTokens(context.Context, *generativelanguagepb.CountTextTokensRequest, ...gax.CallOption) (*generativelanguagepb.CountTextTokensResponse, error)
+}
+
+// TextClient is a client for interacting with Generative Language API.
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// API for using Generative Language Models (GLMs) trained to generate text.
+//
+// Also known as Large Language Models (LLM)s, these generate text given an
+// input prompt from the user.
+type TextClient struct {
+ // The internal transport-dependent client.
+ internalClient internalTextClient
+
+ // The call options for this service.
+ CallOptions *TextCallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *TextClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *TextClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *TextClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// GenerateText generates a response from the model given an input message.
+func (c *TextClient) GenerateText(ctx context.Context, req *generativelanguagepb.GenerateTextRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateTextResponse, error) {
+ return c.internalClient.GenerateText(ctx, req, opts...)
+}
+
+// EmbedText generates an embedding from the model given an input message.
+func (c *TextClient) EmbedText(ctx context.Context, req *generativelanguagepb.EmbedTextRequest, opts ...gax.CallOption) (*generativelanguagepb.EmbedTextResponse, error) {
+ return c.internalClient.EmbedText(ctx, req, opts...)
+}
+
+// BatchEmbedText generates multiple embeddings from the model given input text in a
+// synchronous call.
+func (c *TextClient) BatchEmbedText(ctx context.Context, req *generativelanguagepb.BatchEmbedTextRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchEmbedTextResponse, error) {
+ return c.internalClient.BatchEmbedText(ctx, req, opts...)
+}
+
+// CountTextTokens runs a model’s tokenizer on a text and returns the token count.
+func (c *TextClient) CountTextTokens(ctx context.Context, req *generativelanguagepb.CountTextTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountTextTokensResponse, error) {
+ return c.internalClient.CountTextTokens(ctx, req, opts...)
+}
+
+// textGRPCClient is a client for interacting with Generative Language API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type textGRPCClient struct {
+ // Connection pool of gRPC connections to the service.
+ connPool gtransport.ConnPool
+
+ // Points back to the CallOptions field of the containing TextClient
+ CallOptions **TextCallOptions
+
+ // The gRPC API client.
+ textClient generativelanguagepb.TextServiceClient
+
+ // The x-goog-* metadata to be sent with each request.
+ xGoogHeaders []string
+}
+
+// NewTextClient creates a new text service client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
+//
+// API for using Generative Language Models (GLMs) trained to generate text.
+//
+// Also known as Large Language Models (LLM)s, these generate text given an
+// input prompt from the user.
+func NewTextClient(ctx context.Context, opts ...option.ClientOption) (*TextClient, error) {
+ clientOpts := defaultTextGRPCClientOptions()
+ if newTextClientHook != nil {
+ hookOpts, err := newTextClientHook(ctx, clientHookParams{})
+ if err != nil {
+ return nil, err
+ }
+ clientOpts = append(clientOpts, hookOpts...)
+ }
+
+ connPool, err := gtransport.DialPool(ctx, append(clientOpts, opts...)...)
+ if err != nil {
+ return nil, err
+ }
+ client := TextClient{CallOptions: defaultTextCallOptions()}
+
+ c := &textGRPCClient{
+ connPool: connPool,
+ textClient: generativelanguagepb.NewTextServiceClient(connPool),
+ CallOptions: &client.CallOptions,
+ }
+ c.setGoogleClientInfo()
+
+ client.internalClient = c
+
+ return &client, nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: Connections are now pooled so this method does not always
+// return the same resource.
+func (c *textGRPCClient) Connection() *grpc.ClientConn {
+ return c.connPool.Conn()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *textGRPCClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *textGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type textRESTClient struct {
+ // The http endpoint to connect to.
+ endpoint string
+
+ // The http client.
+ httpClient *http.Client
+
+ // The x-goog-* headers to be sent with each request.
+ xGoogHeaders []string
+
+ // Points back to the CallOptions field of the containing TextClient
+ CallOptions **TextCallOptions
+}
+
+// NewTextRESTClient creates a new text service rest client.
+//
+// API for using Generative Language Models (GLMs) trained to generate text.
+//
+// Also known as Large Language Models (LLM)s, these generate text given an
+// input prompt from the user.
+func NewTextRESTClient(ctx context.Context, opts ...option.ClientOption) (*TextClient, error) {
+ clientOpts := append(defaultTextRESTClientOptions(), opts...)
+ httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
+ if err != nil {
+ return nil, err
+ }
+
+ callOpts := defaultTextRESTCallOptions()
+ c := &textRESTClient{
+ endpoint: endpoint,
+ httpClient: httpClient,
+ CallOptions: &callOpts,
+ }
+ c.setGoogleClientInfo()
+
+ return &TextClient{internalClient: c, CallOptions: callOpts}, nil
+}
+
+func defaultTextRESTClientOptions() []option.ClientOption {
+ return []option.ClientOption{
+ internaloption.WithDefaultEndpoint("https://generativelanguage.googleapis.com"),
+ internaloption.WithDefaultEndpointTemplate("https://generativelanguage.UNIVERSE_DOMAIN"),
+ internaloption.WithDefaultMTLSEndpoint("https://generativelanguage.mtls.googleapis.com"),
+ internaloption.WithDefaultUniverseDomain("googleapis.com"),
+ internaloption.WithDefaultAudience("https://generativelanguage.googleapis.com/"),
+ internaloption.WithDefaultScopes(DefaultAuthScopes()...),
+ }
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *textRESTClient) setGoogleClientInfo(keyval ...string) {
+ kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
+ c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
+}
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *textRESTClient) Close() error {
+ // Replace httpClient with nil to force cleanup.
+ c.httpClient = nil
+ return nil
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated: This method always returns nil.
+func (c *textRESTClient) Connection() *grpc.ClientConn {
+ return nil
+}
+func (c *textGRPCClient) GenerateText(ctx context.Context, req *generativelanguagepb.GenerateTextRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateTextResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateText[0:len((*c.CallOptions).GenerateText):len((*c.CallOptions).GenerateText)], opts...)
+ var resp *generativelanguagepb.GenerateTextResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.textClient.GenerateText(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *textGRPCClient) EmbedText(ctx context.Context, req *generativelanguagepb.EmbedTextRequest, opts ...gax.CallOption) (*generativelanguagepb.EmbedTextResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).EmbedText[0:len((*c.CallOptions).EmbedText):len((*c.CallOptions).EmbedText)], opts...)
+ var resp *generativelanguagepb.EmbedTextResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.textClient.EmbedText(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *textGRPCClient) BatchEmbedText(ctx context.Context, req *generativelanguagepb.BatchEmbedTextRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchEmbedTextResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).BatchEmbedText[0:len((*c.CallOptions).BatchEmbedText):len((*c.CallOptions).BatchEmbedText)], opts...)
+ var resp *generativelanguagepb.BatchEmbedTextResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.textClient.BatchEmbedText(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *textGRPCClient) CountTextTokens(ctx context.Context, req *generativelanguagepb.CountTextTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountTextTokensResponse, error) {
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ ctx = gax.InsertMetadataIntoOutgoingContext(ctx, hds...)
+ opts = append((*c.CallOptions).CountTextTokens[0:len((*c.CallOptions).CountTextTokens):len((*c.CallOptions).CountTextTokens)], opts...)
+ var resp *generativelanguagepb.CountTextTokensResponse
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.textClient.CountTextTokens(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+// GenerateText generates a response from the model given an input message.
+func (c *textRESTClient) GenerateText(ctx context.Context, req *generativelanguagepb.GenerateTextRequest, opts ...gax.CallOption) (*generativelanguagepb.GenerateTextResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:generateText", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).GenerateText[0:len((*c.CallOptions).GenerateText):len((*c.CallOptions).GenerateText)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.GenerateTextResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// EmbedText generates an embedding from the model given an input message.
+func (c *textRESTClient) EmbedText(ctx context.Context, req *generativelanguagepb.EmbedTextRequest, opts ...gax.CallOption) (*generativelanguagepb.EmbedTextResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:embedText", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).EmbedText[0:len((*c.CallOptions).EmbedText):len((*c.CallOptions).EmbedText)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.EmbedTextResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// BatchEmbedText generates multiple embeddings from the model given input text in a
+// synchronous call.
+func (c *textRESTClient) BatchEmbedText(ctx context.Context, req *generativelanguagepb.BatchEmbedTextRequest, opts ...gax.CallOption) (*generativelanguagepb.BatchEmbedTextResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:batchEmbedText", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).BatchEmbedText[0:len((*c.CallOptions).BatchEmbedText):len((*c.CallOptions).BatchEmbedText)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.BatchEmbedTextResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
+
+// CountTextTokens runs a model’s tokenizer on a text and returns the token count.
+func (c *textRESTClient) CountTextTokens(ctx context.Context, req *generativelanguagepb.CountTextTokensRequest, opts ...gax.CallOption) (*generativelanguagepb.CountTextTokensResponse, error) {
+ m := protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+ jsonReq, err := m.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ baseUrl, err := url.Parse(c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ baseUrl.Path += fmt.Sprintf("/v1beta/%v:countTextTokens", req.GetModel())
+
+ params := url.Values{}
+ params.Add("$alt", "json;enum-encoding=int")
+
+ baseUrl.RawQuery = params.Encode()
+
+ // Build HTTP headers from client and context metadata.
+ hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "model", url.QueryEscape(req.GetModel()))}
+
+ hds = append(c.xGoogHeaders, hds...)
+ hds = append(hds, "Content-Type", "application/json")
+ headers := gax.BuildHeaders(ctx, hds...)
+ opts = append((*c.CallOptions).CountTextTokens[0:len((*c.CallOptions).CountTextTokens):len((*c.CallOptions).CountTextTokens)], opts...)
+ unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
+ resp := &generativelanguagepb.CountTextTokensResponse{}
+ e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ if settings.Path != "" {
+ baseUrl.Path = settings.Path
+ }
+ httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
+ if err != nil {
+ return err
+ }
+ httpReq = httpReq.WithContext(ctx)
+ httpReq.Header = headers
+
+ httpRsp, err := c.httpClient.Do(httpReq)
+ if err != nil {
+ return err
+ }
+ defer httpRsp.Body.Close()
+
+ if err = googleapi.CheckResponse(httpRsp); err != nil {
+ return err
+ }
+
+ buf, err := io.ReadAll(httpRsp.Body)
+ if err != nil {
+ return err
+ }
+
+ if err := unm.Unmarshal(buf, resp); err != nil {
+ return err
+ }
+
+ return nil
+ }, opts...)
+ if e != nil {
+ return nil, e
+ }
+ return resp, nil
+}
diff --git a/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/version.go b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/version.go
new file mode 100644
index 000000000..134745cda
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/generativelanguage/apiv1beta/version.go
@@ -0,0 +1,23 @@
+// 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.
+
+// Code generated by gapicgen. DO NOT EDIT.
+
+package generativelanguage
+
+import "cloud.google.com/go/ai/internal"
+
+func init() {
+ versionClient = internal.Version
+}
diff --git a/vendor/cloud.google.com/go/ai/internal/version.go b/vendor/cloud.google.com/go/ai/internal/version.go
new file mode 100644
index 000000000..594b08915
--- /dev/null
+++ b/vendor/cloud.google.com/go/ai/internal/version.go
@@ -0,0 +1,20 @@
+// 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.
+
+// Code generated by gapicgen. DO NOT EDIT.
+
+package internal
+
+// Version is the current tagged release of the library.
+const Version = "0.5.0"
diff --git a/vendor/cloud.google.com/go/civil/civil.go b/vendor/cloud.google.com/go/civil/civil.go
new file mode 100644
index 000000000..cf663022d
--- /dev/null
+++ b/vendor/cloud.google.com/go/civil/civil.go
@@ -0,0 +1,350 @@
+// Copyright 2016 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 civil implements types for civil time, a time-zone-independent
+// representation of time that follows the rules of the proleptic
+// Gregorian calendar with exactly 24-hour days, 60-minute hours, and 60-second
+// minutes.
+//
+// Because they lack location information, these types do not represent unique
+// moments or intervals of time. Use time.Time for that purpose.
+package civil
+
+import (
+ "fmt"
+ "time"
+)
+
+// A Date represents a date (year, month, day).
+//
+// This type does not include location information, and therefore does not
+// describe a unique 24-hour timespan.
+type Date struct {
+ Year int // Year (e.g., 2014).
+ Month time.Month // Month of the year (January = 1, ...).
+ Day int // Day of the month, starting at 1.
+}
+
+// DateOf returns the Date in which a time occurs in that time's location.
+func DateOf(t time.Time) Date {
+ var d Date
+ d.Year, d.Month, d.Day = t.Date()
+ return d
+}
+
+// ParseDate parses a string in RFC3339 full-date format and returns the date value it represents.
+func ParseDate(s string) (Date, error) {
+ t, err := time.Parse("2006-01-02", s)
+ if err != nil {
+ return Date{}, err
+ }
+ return DateOf(t), nil
+}
+
+// String returns the date in RFC3339 full-date format.
+func (d Date) String() string {
+ return fmt.Sprintf("%04d-%02d-%02d", d.Year, d.Month, d.Day)
+}
+
+// IsValid reports whether the date is valid.
+func (d Date) IsValid() bool {
+ return DateOf(d.In(time.UTC)) == d
+}
+
+// In returns the time corresponding to time 00:00:00 of the date in the location.
+//
+// In is always consistent with time.Date, even when time.Date returns a time
+// on a different day. For example, if loc is America/Indiana/Vincennes, then both
+//
+// time.Date(1955, time.May, 1, 0, 0, 0, 0, loc)
+//
+// and
+//
+// civil.Date{Year: 1955, Month: time.May, Day: 1}.In(loc)
+//
+// return 23:00:00 on April 30, 1955.
+//
+// In panics if loc is nil.
+func (d Date) In(loc *time.Location) time.Time {
+ return time.Date(d.Year, d.Month, d.Day, 0, 0, 0, 0, loc)
+}
+
+// AddDays returns the date that is n days in the future.
+// n can also be negative to go into the past.
+func (d Date) AddDays(n int) Date {
+ return DateOf(d.In(time.UTC).AddDate(0, 0, n))
+}
+
+// DaysSince returns the signed number of days between the date and s, not including the end day.
+// This is the inverse operation to AddDays.
+func (d Date) DaysSince(s Date) (days int) {
+ // We convert to Unix time so we do not have to worry about leap seconds:
+ // Unix time increases by exactly 86400 seconds per day.
+ deltaUnix := d.In(time.UTC).Unix() - s.In(time.UTC).Unix()
+ return int(deltaUnix / 86400)
+}
+
+// Before reports whether d occurs before d2.
+func (d Date) Before(d2 Date) bool {
+ if d.Year != d2.Year {
+ return d.Year < d2.Year
+ }
+ if d.Month != d2.Month {
+ return d.Month < d2.Month
+ }
+ return d.Day < d2.Day
+}
+
+// After reports whether d occurs after d2.
+func (d Date) After(d2 Date) bool {
+ return d2.Before(d)
+}
+
+// Compare compares d and d2. If d is before d2, it returns -1;
+// if d is after d2, it returns +1; otherwise it returns 0.
+func (d Date) Compare(d2 Date) int {
+ if d.Before(d2) {
+ return -1
+ } else if d.After(d2) {
+ return +1
+ }
+ return 0
+}
+
+// IsZero reports whether date fields are set to their default value.
+func (d Date) IsZero() bool {
+ return (d.Year == 0) && (int(d.Month) == 0) && (d.Day == 0)
+}
+
+// MarshalText implements the encoding.TextMarshaler interface.
+// The output is the result of d.String().
+func (d Date) MarshalText() ([]byte, error) {
+ return []byte(d.String()), nil
+}
+
+// UnmarshalText implements the encoding.TextUnmarshaler interface.
+// The date is expected to be a string in a format accepted by ParseDate.
+func (d *Date) UnmarshalText(data []byte) error {
+ var err error
+ *d, err = ParseDate(string(data))
+ return err
+}
+
+// A Time represents a time with nanosecond precision.
+//
+// This type does not include location information, and therefore does not
+// describe a unique moment in time.
+//
+// This type exists to represent the TIME type in storage-based APIs like BigQuery.
+// Most operations on Times are unlikely to be meaningful. Prefer the DateTime type.
+type Time struct {
+ Hour int // The hour of the day in 24-hour format; range [0-23]
+ Minute int // The minute of the hour; range [0-59]
+ Second int // The second of the minute; range [0-59]
+ Nanosecond int // The nanosecond of the second; range [0-999999999]
+}
+
+// TimeOf returns the Time representing the time of day in which a time occurs
+// in that time's location. It ignores the date.
+func TimeOf(t time.Time) Time {
+ var tm Time
+ tm.Hour, tm.Minute, tm.Second = t.Clock()
+ tm.Nanosecond = t.Nanosecond()
+ return tm
+}
+
+// ParseTime parses a string and returns the time value it represents.
+// ParseTime accepts an extended form of the RFC3339 partial-time format. After
+// the HH:MM:SS part of the string, an optional fractional part may appear,
+// consisting of a decimal point followed by one to nine decimal digits.
+// (RFC3339 admits only one digit after the decimal point).
+func ParseTime(s string) (Time, error) {
+ t, err := time.Parse("15:04:05.999999999", s)
+ if err != nil {
+ return Time{}, err
+ }
+ return TimeOf(t), nil
+}
+
+// String returns the date in the format described in ParseTime. If Nanoseconds
+// is zero, no fractional part will be generated. Otherwise, the result will
+// end with a fractional part consisting of a decimal point and nine digits.
+func (t Time) String() string {
+ s := fmt.Sprintf("%02d:%02d:%02d", t.Hour, t.Minute, t.Second)
+ if t.Nanosecond == 0 {
+ return s
+ }
+ return s + fmt.Sprintf(".%09d", t.Nanosecond)
+}
+
+// IsValid reports whether the time is valid.
+func (t Time) IsValid() bool {
+ // Construct a non-zero time.
+ tm := time.Date(2, 2, 2, t.Hour, t.Minute, t.Second, t.Nanosecond, time.UTC)
+ return TimeOf(tm) == t
+}
+
+// IsZero reports whether time fields are set to their default value.
+func (t Time) IsZero() bool {
+ return (t.Hour == 0) && (t.Minute == 0) && (t.Second == 0) && (t.Nanosecond == 0)
+}
+
+// Before reports whether t occurs before t2.
+func (t Time) Before(t2 Time) bool {
+ if t.Hour != t2.Hour {
+ return t.Hour < t2.Hour
+ }
+ if t.Minute != t2.Minute {
+ return t.Minute < t2.Minute
+ }
+ if t.Second != t2.Second {
+ return t.Second < t2.Second
+ }
+
+ return t.Nanosecond < t2.Nanosecond
+}
+
+// After reports whether t occurs after t2.
+func (t Time) After(t2 Time) bool {
+ return t2.Before(t)
+}
+
+// Compare compares t and t2. If t is before t2, it returns -1;
+// if t is after t2, it returns +1; otherwise it returns 0.
+func (t Time) Compare(t2 Time) int {
+ if t.Before(t2) {
+ return -1
+ } else if t.After(t2) {
+ return +1
+ }
+ return 0
+}
+
+// MarshalText implements the encoding.TextMarshaler interface.
+// The output is the result of t.String().
+func (t Time) MarshalText() ([]byte, error) {
+ return []byte(t.String()), nil
+}
+
+// UnmarshalText implements the encoding.TextUnmarshaler interface.
+// The time is expected to be a string in a format accepted by ParseTime.
+func (t *Time) UnmarshalText(data []byte) error {
+ var err error
+ *t, err = ParseTime(string(data))
+ return err
+}
+
+// A DateTime represents a date and time.
+//
+// This type does not include location information, and therefore does not
+// describe a unique moment in time.
+type DateTime struct {
+ Date Date
+ Time Time
+}
+
+// Note: We deliberately do not embed Date into DateTime, to avoid promoting AddDays and Sub.
+
+// DateTimeOf returns the DateTime in which a time occurs in that time's location.
+func DateTimeOf(t time.Time) DateTime {
+ return DateTime{
+ Date: DateOf(t),
+ Time: TimeOf(t),
+ }
+}
+
+// ParseDateTime parses a string and returns the DateTime it represents.
+// ParseDateTime accepts a variant of the RFC3339 date-time format that omits
+// the time offset but includes an optional fractional time, as described in
+// ParseTime. Informally, the accepted format is
+//
+// YYYY-MM-DDTHH:MM:SS[.FFFFFFFFF]
+//
+// where the 'T' may be a lower-case 't'.
+func ParseDateTime(s string) (DateTime, error) {
+ t, err := time.Parse("2006-01-02T15:04:05.999999999", s)
+ if err != nil {
+ t, err = time.Parse("2006-01-02t15:04:05.999999999", s)
+ if err != nil {
+ return DateTime{}, err
+ }
+ }
+ return DateTimeOf(t), nil
+}
+
+// String returns the date in the format described in ParseDate.
+func (dt DateTime) String() string {
+ return dt.Date.String() + "T" + dt.Time.String()
+}
+
+// IsValid reports whether the datetime is valid.
+func (dt DateTime) IsValid() bool {
+ return dt.Date.IsValid() && dt.Time.IsValid()
+}
+
+// In returns the time corresponding to the DateTime in the given location.
+//
+// If the time is missing or ambigous at the location, In returns the same
+// result as time.Date. For example, if loc is America/Indiana/Vincennes, then
+// both
+//
+// time.Date(1955, time.May, 1, 0, 30, 0, 0, loc)
+//
+// and
+//
+// civil.DateTime{
+// civil.Date{Year: 1955, Month: time.May, Day: 1}},
+// civil.Time{Minute: 30}}.In(loc)
+//
+// return 23:30:00 on April 30, 1955.
+//
+// In panics if loc is nil.
+func (dt DateTime) In(loc *time.Location) time.Time {
+ return time.Date(dt.Date.Year, dt.Date.Month, dt.Date.Day, dt.Time.Hour, dt.Time.Minute, dt.Time.Second, dt.Time.Nanosecond, loc)
+}
+
+// Before reports whether dt occurs before dt2.
+func (dt DateTime) Before(dt2 DateTime) bool {
+ return dt.In(time.UTC).Before(dt2.In(time.UTC))
+}
+
+// After reports whether dt occurs after dt2.
+func (dt DateTime) After(dt2 DateTime) bool {
+ return dt2.Before(dt)
+}
+
+// Compare compares dt and dt2. If dt is before dt2, it returns -1;
+// if dt is after dt2, it returns +1; otherwise it returns 0.
+func (dt DateTime) Compare(dt2 DateTime) int {
+ return dt.In(time.UTC).Compare(dt2.In(time.UTC))
+}
+
+// IsZero reports whether datetime fields are set to their default value.
+func (dt DateTime) IsZero() bool {
+ return dt.Date.IsZero() && dt.Time.IsZero()
+}
+
+// MarshalText implements the encoding.TextMarshaler interface.
+// The output is the result of dt.String().
+func (dt DateTime) MarshalText() ([]byte, error) {
+ return []byte(dt.String()), nil
+}
+
+// UnmarshalText implements the encoding.TextUnmarshaler interface.
+// The datetime is expected to be a string in a format accepted by ParseDateTime
+func (dt *DateTime) UnmarshalText(data []byte) error {
+ var err error
+ *dt, err = ParseDateTime(string(data))
+ return err
+}
diff --git a/vendor/github.com/google/generative-ai-go/LICENSE b/vendor/github.com/google/generative-ai-go/LICENSE
new file mode 100644
index 000000000..261eeb9e9
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/vendor/github.com/google/generative-ai-go/genai/chat.go b/vendor/github.com/google/generative-ai-go/genai/chat.go
new file mode 100644
index 000000000..169b24b5d
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/chat.go
@@ -0,0 +1,71 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package genai
+
+import (
+ "context"
+)
+
+// A ChatSession provides interactive chat.
+type ChatSession struct {
+ m *GenerativeModel
+ History []*Content
+}
+
+// StartChat starts a chat session.
+func (m *GenerativeModel) StartChat() *ChatSession {
+ return &ChatSession{m: m}
+}
+
+// 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...)
+ req.GenerationConfig.CandidateCount = Ptr[int32](1)
+ resp, err := cs.m.generateContent(ctx, req)
+ if err != nil {
+ return nil, err
+ }
+ cs.addToHistory(resp.Candidates)
+ return resp, nil
+}
+
+// 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...)
+ req.GenerationConfig.CandidateCount = Ptr[int32](1)
+ streamClient, err := cs.m.c.c.StreamGenerateContent(ctx, req)
+ return &GenerateContentResponseIterator{
+ sc: streamClient,
+ err: err,
+ cs: cs,
+ }
+}
+
+// By default, use the first candidate for history. The user can modify that if they want.
+func (cs *ChatSession) addToHistory(cands []*Candidate) bool {
+ if len(cands) > 0 {
+ c := cands[0].Content
+ if c == nil {
+ return false
+ }
+ c.Role = roleModel
+ cs.History = append(cs.History, c)
+ return true
+ }
+ return false
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/client.go b/vendor/github.com/google/generative-ai-go/genai/client.go
new file mode 100644
index 000000000..652312978
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/client.go
@@ -0,0 +1,401 @@
+// 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.
+
+// For the following go:generate line to work, do the following:
+// 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
+
+package genai
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "reflect"
+ "strings"
+
+ gl "cloud.google.com/go/ai/generativelanguage/apiv1beta"
+ pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ "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
+ mc *gl.ModelClient
+ fc *gl.FileClient
+ ds *gld.Service
+}
+
+// NewClient creates a new Google generative AI client.
+//
+// Clients should be reused instead of created as needed. The methods of Client
+// are safe for concurrent use by multiple goroutines.
+//
+// You may configure the client by passing in options from the [google.golang.org/api/option]
+// package.
+func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
+ if !hasAuthOption(opts) {
+ return nil, errors.New(`You need an auth option to use this client.
+for an API Key: Visit https://ai.google.dev to get one, put it in an environment variable like GEMINI_API_KEY,
+then pass it as an option:
+ genai.NewClient(ctx, option.WithAPIKey(os.Getenv("GEMINI_API_KEY")))
+(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...)
+ if err != nil {
+ return nil, err
+ }
+ mc, err := gl.NewModelRESTClient(ctx, opts...)
+ if err != nil {
+ return nil, err
+ }
+ fc, err := gl.NewFileRESTClient(ctx, opts...)
+ if err != nil {
+ return nil, err
+ }
+ ds, err := gld.NewService(ctx, opts...)
+ if err != nil {
+ return nil, err
+ }
+ c.SetGoogleClientInfo("gccl", "v"+internal.Version, "genai-go", internal.Version)
+ return &Client{c, mc, fc, ds}, nil
+}
+
+// hasAuthOption reports whether an authentication-related option was provided.
+//
+// There is no good way to make these checks, because the types of the options
+// are unexported, and the struct that they populates is in an internal package.
+func hasAuthOption(opts []option.ClientOption) bool {
+ for _, opt := range opts {
+ v := reflect.ValueOf(opt)
+ ts := v.Type().String()
+
+ switch ts {
+ case "option.withAPIKey":
+ return v.String() != ""
+
+ case "option.withHttpClient",
+ "option.withTokenSource",
+ "option.withCredentialsFile",
+ "option.withCredentialsJSON":
+ return true
+ }
+ }
+ return false
+}
+
+// Close closes the client.
+func (c *Client) Close() error {
+ return errors.Join(c.c.Close(), c.mc.Close(), c.fc.Close())
+}
+
+// GenerativeModel is a model that can generate text.
+// Create one with [Client.GenerativeModel], then configure
+// it by setting the exported fields.
+type GenerativeModel struct {
+ c *Client
+ fullName string
+
+ GenerationConfig
+ SafetySettings []*SafetySetting
+ Tools []*Tool
+ ToolConfig *ToolConfig // configuration for tools
+ // 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
+}
+
+// GenerativeModel creates a new instance of the named generative model.
+// For instance, "gemini-1.0-pro" or "models/gemini-1.0-pro".
+//
+// To access a tuned model named NAME, pass "tunedModels/NAME".
+func (c *Client) GenerativeModel(name string) *GenerativeModel {
+ return &GenerativeModel{
+ c: c,
+ fullName: fullModelName(name),
+ }
+}
+
+func fullModelName(name string) string {
+ if strings.ContainsRune(name, '/') {
+ return name
+ }
+ return "models/" + name
+}
+
+// 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)
+ if err != nil {
+ return nil, err
+ }
+ return protoToResponse(res)
+}
+
+// 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,
+ }
+}
+
+func (m *GenerativeModel) generateContent(ctx context.Context, req *pb.GenerateContentRequest) (*GenerateContentResponse, error) {
+ streamClient, err := m.c.c.StreamGenerateContent(ctx, req)
+ iter := &GenerateContentResponseIterator{
+ sc: streamClient,
+ err: err,
+ }
+ for {
+ _, err := iter.Next()
+ if err == iterator.Done {
+ return iter.merged, nil
+ }
+ if err != nil {
+ return nil, err
+ }
+ }
+}
+
+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}
+}
+
+// GenerateContentResponseIterator is an iterator over GnerateContentResponse.
+type GenerateContentResponseIterator struct {
+ sc pb.GenerativeService_StreamGenerateContentClient
+ err error
+ merged *GenerateContentResponse
+ cs *ChatSession
+}
+
+// Next returns the next response.
+func (iter *GenerateContentResponseIterator) Next() (*GenerateContentResponse, error) {
+ if iter.err != nil {
+ return nil, iter.err
+ }
+ resp, err := iter.sc.Recv()
+ iter.err = err
+ if err == io.EOF {
+ if iter.cs != nil && iter.merged != nil {
+ iter.cs.addToHistory(iter.merged.Candidates)
+ }
+ return nil, iterator.Done
+ }
+ if err != nil {
+ return nil, err
+ }
+ gcp, err := protoToResponse(resp)
+ if err != nil {
+ iter.err = err
+ return nil, err
+ }
+ // Merge this response in with the ones we've already seen.
+ iter.merged = joinResponses(iter.merged, gcp)
+ // If this is part of a ChatSession, remember the response for the history.
+ return gcp, nil
+}
+
+func protoToResponse(resp *pb.GenerateContentResponse) (*GenerateContentResponse, error) {
+ gcp := (GenerateContentResponse{}).fromProto(resp)
+ if gcp == nil {
+ return nil, errors.New("empty response from model")
+ }
+ // Assume a non-nil PromptFeedback is an error.
+ // TODO: confirm.
+ if gcp.PromptFeedback != nil && gcp.PromptFeedback.BlockReason != BlockReasonUnspecified {
+ return nil, &BlockedError{PromptFeedback: gcp.PromptFeedback}
+ }
+
+ // If any candidate is blocked, error.
+ // TODO: is this too harsh?
+ for _, c := range gcp.Candidates {
+ if c.FinishReason == FinishReasonSafety || c.FinishReason == FinishReasonRecitation {
+ return nil, &BlockedError{Candidate: c}
+ }
+ }
+ return gcp, nil
+}
+
+// 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)
+ if err != nil {
+ return nil, err
+ }
+
+ return (CountTokensResponse{}).fromProto(res), nil
+}
+
+func (m *GenerativeModel) newCountTokensRequest(contents ...*Content) *pb.CountTokensRequest {
+ return &pb.CountTokensRequest{
+ Model: m.fullName,
+ Contents: support.TransformSlice(contents, (*Content).toProto),
+ }
+}
+
+// Info returns information about the model.
+func (m *GenerativeModel) Info(ctx context.Context) (*ModelInfo, error) {
+ return m.c.modelInfo(ctx, m.fullName)
+}
+
+func (c *Client) modelInfo(ctx context.Context, fullName string) (*ModelInfo, error) {
+ req := &pb.GetModelRequest{Name: fullName}
+ res, err := c.mc.GetModel(ctx, req)
+ if err != nil {
+ return nil, err
+ }
+ return (ModelInfo{}).fromProto(res), nil
+}
+
+// A BlockedError indicates that the model's response was blocked.
+// There can be two underlying causes: the prompt or a candidate response.
+type BlockedError struct {
+ // If non-nil, the model's response was blocked.
+ // Consult the FinishReason field for details.
+ Candidate *Candidate
+
+ // If non-nil, there was a problem with the prompt.
+ PromptFeedback *PromptFeedback
+}
+
+func (e *BlockedError) Error() string {
+ var b strings.Builder
+ fmt.Fprintf(&b, "blocked: ")
+ if e.Candidate != nil {
+ fmt.Fprintf(&b, "candidate: %s", e.Candidate.FinishReason)
+ }
+ if e.PromptFeedback != nil {
+ if e.Candidate != nil {
+ fmt.Fprintf(&b, ", ")
+ }
+ fmt.Fprintf(&b, "prompt: %v", e.PromptFeedback.BlockReason)
+ }
+ return b.String()
+}
+
+// joinResponses merges the two responses, which should be the result of a streaming call.
+// The first argument is modified.
+func joinResponses(dest, src *GenerateContentResponse) *GenerateContentResponse {
+ if dest == nil {
+ return src
+ }
+ dest.Candidates = joinCandidateLists(dest.Candidates, src.Candidates)
+ // Keep dest.PromptFeedback.
+ // TODO: Take the last UsageMetadata.
+ return dest
+}
+
+func joinCandidateLists(dest, src []*Candidate) []*Candidate {
+ indexToSrcCandidate := map[int32]*Candidate{}
+ for _, s := range src {
+ indexToSrcCandidate[s.Index] = s
+ }
+ for _, d := range dest {
+ s := indexToSrcCandidate[d.Index]
+ if s != nil {
+ d.Content = joinContent(d.Content, s.Content)
+ // Take the last of these.
+ d.FinishReason = s.FinishReason
+ // d.FinishMessage = s.FinishMessage
+ d.SafetyRatings = s.SafetyRatings
+ d.CitationMetadata = joinCitationMetadata(d.CitationMetadata, s.CitationMetadata)
+ }
+ }
+ return dest
+}
+
+func joinCitationMetadata(dest, src *CitationMetadata) *CitationMetadata {
+ if dest == nil {
+ return src
+ }
+ if src == nil {
+ return dest
+ }
+ dest.CitationSources = append(dest.CitationSources, src.CitationSources...)
+ return dest
+}
+
+func joinContent(dest, src *Content) *Content {
+ if dest == nil {
+ return src
+ }
+ if src == nil {
+ return dest
+ }
+ // Assume roles are the same.
+ dest.Parts = joinParts(dest.Parts, src.Parts)
+ return dest
+}
+
+func joinParts(dest, src []Part) []Part {
+ return mergeTexts(append(dest, src...))
+}
+
+func mergeTexts(in []Part) []Part {
+ var out []Part
+ i := 0
+ for i < len(in) {
+ if t, ok := in[i].(Text); ok {
+ texts := []string{string(t)}
+ var j int
+ for j = i + 1; j < len(in); j++ {
+ if t, ok := in[j].(Text); ok {
+ texts = append(texts, string(t))
+ } else {
+ break
+ }
+ }
+ // j is just after the last Text.
+ out = append(out, Text(strings.Join(texts, "")))
+ i = j
+ } else {
+ out = append(out, in[i])
+ i++
+ }
+ }
+ return out
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/config.yaml b/vendor/github.com/google/generative-ai-go/genai/config.yaml
new file mode 100644
index 000000000..acaa46962
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/config.yaml
@@ -0,0 +1,186 @@
+# 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.
+
+# Configuration for the protoveneer tool.
+
+package: genai
+
+protoImportPath: cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb
+supportImportPath: github.com/google/generative-ai-go/internal/support
+
+types:
+ HarmCategory:
+ protoPrefix: HarmCategory_HARM_CATEGORY_
+ docVerb: specifies
+
+ SafetySetting_HarmBlockThreshold:
+ name: HarmBlockThreshold
+ protoPrefix: SafetySetting_BLOCK_
+ veneerPrefix: HarmBlock
+ docVerb: specifies
+ valueNames:
+ SafetySetting_HARM_BLOCK_THRESHOLD_UNSPECIFIED: HarmBlockUnspecified
+
+ SafetyRating_HarmProbability:
+ name: HarmProbability
+ protoPrefix: SafetyRating_
+ docVerb: specifies
+ valueNames:
+ SafetyRating_HARM_PROBABILITY_UNSPECIFIED: HarmProbabilityUnspecified
+
+ Candidate_FinishReason:
+ name: FinishReason
+ protoPrefix: Candidate_
+
+ GenerateContentResponse:
+ doc: 'is the response from a GenerateContent or GenerateContentStream call.'
+
+ GenerateContentResponse_PromptFeedback_BlockReason:
+ name: BlockReason
+ protoPrefix: GenerateContentResponse_PromptFeedback_
+
+ Content:
+ fields:
+ Parts:
+ type: '[]Part'
+
+ Blob:
+ fields:
+ MimeType:
+ name: MIMEType
+ docVerb: contains
+
+ FileData:
+ fields:
+ MimeType:
+ name: MIMEType
+ FileUri:
+ name: URI
+ # TODO(jba): support field doc in protoveneer
+ # doc: 'The URI returned from UploadFile or GetFile.'
+
+ GenerationConfig:
+ fields:
+ ResponseMimeType:
+ name: ResponseMIMEType
+
+ SafetySetting:
+
+ SafetyRating:
+ docVerb: 'is the'
+
+ CitationMetadata:
+
+ CitationSource:
+ docVerb: contains
+ fields:
+ Uri:
+ name: URI
+ License:
+ type: string
+
+ Candidate:
+ fields:
+ Index:
+ type: int32
+ GroundingAttributions:
+ omit: true
+
+ GenerateContentResponse_PromptFeedback:
+ name: PromptFeedback
+ docVerb: contains
+
+ CountTokensResponse:
+
+ TaskType:
+ protoPrefix: TaskType
+ valueNames:
+ TaskType_TASK_TYPE_UNSPECIFIED: TaskTypeUnspecified
+
+ EmbedContentResponse:
+ BatchEmbedContentsResponse:
+
+ ContentEmbedding:
+
+ Model:
+ name: ModelInfo
+ doc: 'is information about a language model.'
+ fields:
+ BaseModelId:
+ name: BaseModelID
+ Temperature:
+ type: float32
+ TopP:
+ type: float32
+ TopK:
+ type: int32
+
+ # Types for function calling
+ Tool:
+ ToolConfig:
+ FunctionDeclaration:
+ FunctionCall:
+ FunctionResponse:
+ Schema:
+
+ Type:
+ protoPrefix: Type_
+ veneerPrefix: ''
+
+ FunctionCallingConfig:
+ doc: 'holds configuration for function calling.'
+
+ FunctionCallingConfig_Mode:
+ name: FunctionCallingMode
+ protoPrefix: FunctionCallingConfig
+ veneerPrefix: FunctionCalling
+ valueNames:
+ FunctionCallingConfig_MODE_UNSPECIFIED: FunctionCallingUnspecified
+
+ File:
+ fields:
+ Uri:
+ name: URI
+ MimeType:
+ name: MIMEType
+ Error:
+ # TODO(jba): support or convert status.Status
+ omit: true
+ Metadata:
+ # TODO(jba): support
+ omit: true
+ File_State:
+ name: FileState
+ docVerb: represents
+ protoPrefix: File
+ veneerPrefix: FileState
+ valueNames:
+ File_STATE_UNSPECIFIED: FileStateUnspecified
+
+ GenerateContentResponse_UsageMetadata:
+ name: UsageMetadata
+ fields:
+ PromptTokenCount:
+ type: int32
+ CandidatesTokenCount:
+ type: int32
+ TotalTokenCount:
+ type: int32
+
+# Omit everything not explicitly configured.
+omitTypes:
+ - '*'
+
+converters:
+ Part: partToProto, partFromProto
diff --git a/vendor/github.com/google/generative-ai-go/genai/content.go b/vendor/github.com/google/generative-ai-go/genai/content.go
new file mode 100644
index 000000000..2c34d0e3b
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/content.go
@@ -0,0 +1,145 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package genai
+
+import (
+ "fmt"
+
+ pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+)
+
+const (
+ roleUser = "user"
+ roleModel = "model"
+)
+
+// A Part is either a Text, a Blob or a FunctionResponse.
+type Part interface {
+ toPart() *pb.Part
+}
+
+func partToProto(p Part) *pb.Part {
+ if p == nil {
+ return nil
+ }
+ return p.toPart()
+}
+
+func partFromProto(p *pb.Part) Part {
+ switch d := p.Data.(type) {
+ case *pb.Part_Text:
+ return Text(d.Text)
+ case *pb.Part_InlineData:
+ return Blob{
+ MIMEType: d.InlineData.MimeType,
+ Data: d.InlineData.Data,
+ }
+ case *pb.Part_FunctionCall:
+ return *(FunctionCall{}).fromProto(d.FunctionCall)
+
+ case *pb.Part_FunctionResponse:
+ panic("FunctionResponse unimplemented")
+
+ default:
+ panic(fmt.Errorf("unknown Part.Data type %T", p.Data))
+ }
+}
+
+// A Text is a piece of text, like a question or phrase.
+type Text string
+
+func (t Text) toPart() *pb.Part {
+ return &pb.Part{
+ Data: &pb.Part_Text{Text: string(t)},
+ }
+}
+
+func (b Blob) toPart() *pb.Part {
+ return &pb.Part{
+ Data: &pb.Part_InlineData{
+ InlineData: b.toProto(),
+ },
+ }
+}
+
+// ImageData is a convenience function for creating an image
+// Blob for input to a model.
+// The format should be the second part of the MIME type, after "image/".
+// For example, for a PNG image, pass "png".
+func ImageData(format string, data []byte) Blob {
+ return Blob{
+ MIMEType: "image/" + format,
+ Data: data,
+ }
+}
+
+func (f FunctionCall) toPart() *pb.Part {
+ return &pb.Part{
+ Data: &pb.Part_FunctionCall{
+ FunctionCall: f.toProto(),
+ },
+ }
+}
+
+func (f FunctionResponse) toPart() *pb.Part {
+ return &pb.Part{
+ Data: &pb.Part_FunctionResponse{
+ FunctionResponse: f.toProto(),
+ },
+ }
+}
+
+func (fd FileData) toPart() *pb.Part {
+ return &pb.Part{
+ Data: &pb.Part_FileData{
+ FileData: fd.toProto(),
+ },
+ }
+}
+
+// Ptr returns a pointer to its argument.
+// It can be used to initialize pointer fields:
+//
+// model.Temperature = genai.Ptr[float32](0.1)
+func Ptr[T any](t T) *T { return &t }
+
+// SetCandidateCount sets the CandidateCount field.
+func (c *GenerationConfig) SetCandidateCount(x int32) { c.CandidateCount = &x }
+
+// SetMaxOutputTokens sets the MaxOutputTokens field.
+func (c *GenerationConfig) SetMaxOutputTokens(x int32) { c.MaxOutputTokens = &x }
+
+// SetTemperature sets the Temperature field.
+func (c *GenerationConfig) SetTemperature(x float32) { c.Temperature = &x }
+
+// SetTopP sets the TopP field.
+func (c *GenerationConfig) SetTopP(x float32) { c.TopP = &x }
+
+// SetTopK sets the TopK field.
+func (c *GenerationConfig) SetTopK(x int32) { c.TopK = &x }
+
+// FunctionCalls return all the FunctionCall parts in the candidate.
+func (c *Candidate) FunctionCalls() []FunctionCall {
+ if c.Content == nil {
+ return nil
+ }
+ var fcs []FunctionCall
+ for _, p := range c.Content.Parts {
+ if fc, ok := p.(FunctionCall); ok {
+ fcs = append(fcs, fc)
+ }
+ }
+ return fcs
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/doc.go b/vendor/github.com/google/generative-ai-go/genai/doc.go
new file mode 100644
index 000000000..b88bab537
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/doc.go
@@ -0,0 +1,32 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package genai is a client for the Google AI generative models.
+//
+// NOTE: This client uses the v1beta version of the API.
+//
+// # Getting started
+//
+// Reading the [examples] is the best way to learn how to use this package.
+//
+// # Authorization
+//
+// You will need an API key to use the service.
+// See the [setup tutorial] for details.
+//
+// # Errors
+//
+// [examples]: https://pkg.go.dev/github.com/google/generative-ai-go/genai#pkg-examples
+// [setup tutorial]: https://ai.google.dev/tutorials/setup
+package genai
diff --git a/vendor/github.com/google/generative-ai-go/genai/embed.go b/vendor/github.com/google/generative-ai-go/genai/embed.go
new file mode 100644
index 000000000..8af76240f
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/embed.go
@@ -0,0 +1,125 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package genai
+
+import (
+ "context"
+
+ pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+)
+
+// EmbeddingModel creates a new instance of the named embedding model.
+// Example name: "embedding-001" or "models/embedding-001".
+func (c *Client) EmbeddingModel(name string) *EmbeddingModel {
+ return &EmbeddingModel{
+ c: c,
+ name: name,
+ fullName: fullModelName(name),
+ }
+}
+
+// EmbeddingModel is a model that computes embeddings.
+// Create one with [Client.EmbeddingModel].
+type EmbeddingModel struct {
+ c *Client
+ name string
+ fullName string
+ // TaskType describes how the embedding will be used.
+ TaskType TaskType
+}
+
+// Name returns the name of the EmbeddingModel.
+func (m *EmbeddingModel) Name() string {
+ return m.name
+}
+
+// EmbedContent returns an embedding for the list of parts.
+func (m *EmbeddingModel) EmbedContent(ctx context.Context, parts ...Part) (*EmbedContentResponse, error) {
+ return m.EmbedContentWithTitle(ctx, "", parts...)
+}
+
+// EmbedContentWithTitle returns an embedding for the list of parts.
+// If the given title is non-empty, it is passed to the model and
+// 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)
+ if err != nil {
+ return nil, err
+ }
+ return (EmbedContentResponse{}).fromProto(res), nil
+}
+
+func newEmbedContentRequest(model string, tt TaskType, title string, parts []Part) *pb.EmbedContentRequest {
+ req := &pb.EmbedContentRequest{
+ Model: model,
+ Content: newUserContent(parts).toProto(),
+ }
+ // A non-empty title overrides the task type.
+ if title != "" {
+ req.Title = &title
+ tt = TaskTypeRetrievalDocument
+ }
+ if tt != TaskTypeUnspecified {
+ taskType := pb.TaskType(tt)
+ req.TaskType = &taskType
+ }
+ return req
+}
+
+// An EmbeddingBatch holds a collection of embedding requests.
+type EmbeddingBatch struct {
+ tt TaskType
+ req *pb.BatchEmbedContentsRequest
+}
+
+// NewBatch returns a new, empty EmbeddingBatch with the same TaskType as the model.
+// Make multiple calls to [EmbeddingBatch.AddContent] or [EmbeddingBatch.AddContentWithTitle].
+// Then pass the EmbeddingBatch to [EmbeddingModel.BatchEmbedContents] to get
+// all the embeddings in a single call to the model.
+func (m *EmbeddingModel) NewBatch() *EmbeddingBatch {
+ return &EmbeddingBatch{
+ tt: m.TaskType,
+ req: &pb.BatchEmbedContentsRequest{
+ Model: m.fullName,
+ },
+ }
+}
+
+// AddContent adds a content to the batch.
+func (b *EmbeddingBatch) AddContent(parts ...Part) *EmbeddingBatch {
+ b.AddContentWithTitle("", parts...)
+ return b
+}
+
+// AddContent adds a content to the batch with a title.
+func (b *EmbeddingBatch) AddContentWithTitle(title string, parts ...Part) *EmbeddingBatch {
+ b.req.Requests = append(b.req.Requests, newEmbedContentRequest(b.req.Model, b.tt, title, parts))
+ return b
+}
+
+// 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)
+ if err != nil {
+ return nil, err
+ }
+ return (BatchEmbedContentsResponse{}).fromProto(res), nil
+}
+
+// Info returns information about the model.
+func (m *EmbeddingModel) Info(ctx context.Context) (*ModelInfo, error) {
+ return m.c.modelInfo(ctx, m.fullName)
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/files.go b/vendor/github.com/google/generative-ai-go/genai/files.go
new file mode 100644
index 000000000..07e69cc25
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/files.go
@@ -0,0 +1,123 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package genai
+
+//go:generate ../devtools/generate_discovery_client.sh
+
+import (
+ "context"
+ "io"
+ "strings"
+
+ gl "cloud.google.com/go/ai/generativelanguage/apiv1beta"
+ pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ gld "github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta" // discovery client
+ "google.golang.org/api/googleapi"
+ "google.golang.org/api/iterator"
+)
+
+// 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
+}
+
+// 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.
+// Otherwise, it can contain up to 40 characters that are lowercase
+// alphanumeric or dashes (-), not starting or ending with a dash.
+// 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.
+//
+// It is an error to upload a file that already exists.
+func (c *Client) UploadFile(ctx context.Context, name string, r io.Reader, opts *UploadFileOptions) (*File, error) {
+ if name != "" {
+ name = userNameToServiceName(name)
+ }
+ req := &gld.CreateFileRequest{
+ File: &gld.File{Name: name},
+ }
+ if opts != nil && opts.DisplayName != "" {
+ req.File.DisplayName = opts.DisplayName
+ }
+ call := c.ds.Media.Upload(req)
+ var mopts []googleapi.MediaOption
+ if opts != nil && opts.MIMEType != "" {
+ mopts = append(mopts, googleapi.ContentType(opts.MIMEType))
+ }
+ call.Media(r, mopts...)
+ res, err := call.Do()
+ if err != nil {
+ return nil, err
+ }
+ // Don't return the result, because it contains a file as represented by the
+ // discovery client and we'd have to write code to convert it to this package's
+ // File type.
+ // Instead, make a GetFile call to get the proto file, which our generated code can convert.
+ return c.GetFile(ctx, res.File.Name)
+}
+
+// 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)})
+ if err != nil {
+ return nil, err
+ }
+ return (File{}).fromProto(pf), nil
+}
+
+// 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)})
+}
+
+// userNameToServiceName converts a name supplied by the user to a name required by the service.
+func userNameToServiceName(name string) string {
+ if strings.ContainsRune(name, '/') {
+ return name
+ }
+ return "files/" + name
+}
+
+// ListFiles returns an iterator over the uploaded files.
+func (c *Client) ListFiles(ctx context.Context) *FileIterator {
+ return &FileIterator{
+ it: c.fc.ListFiles(ctx, &pb.ListFilesRequest{}),
+ }
+}
+
+// A FileIterator iterates over Files.
+type FileIterator struct {
+ it *gl.FileIterator
+}
+
+// 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 *FileIterator) Next() (*File, error) {
+ m, err := it.it.Next()
+ if err != nil {
+ return nil, err
+ }
+ return (File{}).fromProto(m), nil
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *FileIterator) PageInfo() *iterator.PageInfo {
+ return it.it.PageInfo()
+}
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
new file mode 100644
index 000000000..11ca1d2c0
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/generativelanguagepb_veneer.gen.go
@@ -0,0 +1,1369 @@
+// 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.
+
+// This file was generated by protoveneer. DO NOT EDIT.
+
+package genai
+
+import (
+ "fmt"
+
+ pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+ "github.com/google/generative-ai-go/internal/support"
+ "google.golang.org/protobuf/types/known/timestamppb"
+ "time"
+)
+
+// BatchEmbedContentsResponse is the response to a `BatchEmbedContentsRequest`.
+type BatchEmbedContentsResponse struct {
+ // Output only. The embeddings for each request, in the same order as provided
+ // in the batch request.
+ Embeddings []*ContentEmbedding
+}
+
+func (v *BatchEmbedContentsResponse) toProto() *pb.BatchEmbedContentsResponse {
+ if v == nil {
+ return nil
+ }
+ return &pb.BatchEmbedContentsResponse{
+ Embeddings: support.TransformSlice(v.Embeddings, (*ContentEmbedding).toProto),
+ }
+}
+
+func (BatchEmbedContentsResponse) fromProto(p *pb.BatchEmbedContentsResponse) *BatchEmbedContentsResponse {
+ if p == nil {
+ return nil
+ }
+ return &BatchEmbedContentsResponse{
+ Embeddings: support.TransformSlice(p.Embeddings, (ContentEmbedding{}).fromProto),
+ }
+}
+
+// Blob contains raw media bytes.
+//
+// Text should not be sent as raw bytes, use the 'text' field.
+type Blob struct {
+ // 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).
+ MIMEType string
+ // Raw bytes for media formats.
+ Data []byte
+}
+
+func (v *Blob) toProto() *pb.Blob {
+ if v == nil {
+ return nil
+ }
+ return &pb.Blob{
+ MimeType: v.MIMEType,
+ Data: v.Data,
+ }
+}
+
+func (Blob) fromProto(p *pb.Blob) *Blob {
+ if p == nil {
+ return nil
+ }
+ return &Blob{
+ MIMEType: p.MimeType,
+ Data: p.Data,
+ }
+}
+
+// BlockReason is specifies what was the reason why prompt was blocked.
+type BlockReason int32
+
+const (
+ // BlockReasonUnspecified means default value. This value is unused.
+ BlockReasonUnspecified BlockReason = 0
+ // 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 BlockReason = 2
+)
+
+var namesForBlockReason = map[BlockReason]string{
+ BlockReasonUnspecified: "BlockReasonUnspecified",
+ BlockReasonSafety: "BlockReasonSafety",
+ BlockReasonOther: "BlockReasonOther",
+}
+
+func (v BlockReason) String() string {
+ if n, ok := namesForBlockReason[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("BlockReason(%d)", v)
+}
+
+// Candidate is a response candidate generated from the model.
+type Candidate struct {
+ // Output only. Index of the candidate in the list of candidates.
+ Index int32
+ // Output only. Generated content returned from the model.
+ Content *Content
+ // Optional. Output only. The reason why the model stopped generating tokens.
+ //
+ // If empty, the model has not stopped generating the tokens.
+ FinishReason FinishReason
+ // List of ratings for the safety of a response candidate.
+ //
+ // There is at most one rating per category.
+ SafetyRatings []*SafetyRating
+ // 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.
+ CitationMetadata *CitationMetadata
+ // Output only. Token count for this candidate.
+ TokenCount int32
+}
+
+func (v *Candidate) toProto() *pb.Candidate {
+ if v == nil {
+ return nil
+ }
+ return &pb.Candidate{
+ Index: support.AddrOrNil(v.Index),
+ Content: v.Content.toProto(),
+ FinishReason: pb.Candidate_FinishReason(v.FinishReason),
+ SafetyRatings: support.TransformSlice(v.SafetyRatings, (*SafetyRating).toProto),
+ CitationMetadata: v.CitationMetadata.toProto(),
+ TokenCount: v.TokenCount,
+ }
+}
+
+func (Candidate) fromProto(p *pb.Candidate) *Candidate {
+ if p == nil {
+ return nil
+ }
+ return &Candidate{
+ Index: support.DerefOrZero(p.Index),
+ Content: (Content{}).fromProto(p.Content),
+ FinishReason: FinishReason(p.FinishReason),
+ SafetyRatings: support.TransformSlice(p.SafetyRatings, (SafetyRating{}).fromProto),
+ CitationMetadata: (CitationMetadata{}).fromProto(p.CitationMetadata),
+ TokenCount: p.TokenCount,
+ }
+}
+
+// CitationMetadata is a collection of source attributions for a piece of content.
+type CitationMetadata struct {
+ // Citations to sources for a specific response.
+ CitationSources []*CitationSource
+}
+
+func (v *CitationMetadata) toProto() *pb.CitationMetadata {
+ if v == nil {
+ return nil
+ }
+ return &pb.CitationMetadata{
+ CitationSources: support.TransformSlice(v.CitationSources, (*CitationSource).toProto),
+ }
+}
+
+func (CitationMetadata) fromProto(p *pb.CitationMetadata) *CitationMetadata {
+ if p == nil {
+ return nil
+ }
+ return &CitationMetadata{
+ CitationSources: support.TransformSlice(p.CitationSources, (CitationSource{}).fromProto),
+ }
+}
+
+// CitationSource contains a citation to a source for a portion of a specific response.
+type CitationSource struct {
+ // Optional. Start of segment of the response that is attributed to this
+ // source.
+ //
+ // Index indicates the start of the segment, measured in bytes.
+ StartIndex *int32
+ // Optional. End of the attributed segment, exclusive.
+ EndIndex *int32
+ // Optional. URI that is attributed as a source for a portion of the text.
+ URI *string
+ // Optional. License for the GitHub project that is attributed as a source for
+ // segment.
+ //
+ // License info is required for code citations.
+ License string
+}
+
+func (v *CitationSource) toProto() *pb.CitationSource {
+ if v == nil {
+ return nil
+ }
+ return &pb.CitationSource{
+ StartIndex: v.StartIndex,
+ EndIndex: v.EndIndex,
+ Uri: v.URI,
+ License: support.AddrOrNil(v.License),
+ }
+}
+
+func (CitationSource) fromProto(p *pb.CitationSource) *CitationSource {
+ if p == nil {
+ return nil
+ }
+ return &CitationSource{
+ StartIndex: p.StartIndex,
+ EndIndex: p.EndIndex,
+ URI: p.Uri,
+ License: support.DerefOrZero(p.License),
+ }
+}
+
+// Content is 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.
+type Content struct {
+ // Ordered `Parts` that constitute a single message. Parts may have different
+ // MIME types.
+ Parts []Part
+ // 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.
+ Role string
+}
+
+func (v *Content) toProto() *pb.Content {
+ if v == nil {
+ return nil
+ }
+ return &pb.Content{
+ Parts: support.TransformSlice(v.Parts, partToProto),
+ Role: v.Role,
+ }
+}
+
+func (Content) fromProto(p *pb.Content) *Content {
+ if p == nil {
+ return nil
+ }
+ return &Content{
+ Parts: support.TransformSlice(p.Parts, partFromProto),
+ Role: p.Role,
+ }
+}
+
+// ContentEmbedding is a list of floats representing an embedding.
+type ContentEmbedding struct {
+ // The embedding values.
+ Values []float32
+}
+
+func (v *ContentEmbedding) toProto() *pb.ContentEmbedding {
+ if v == nil {
+ return nil
+ }
+ return &pb.ContentEmbedding{
+ Values: v.Values,
+ }
+}
+
+func (ContentEmbedding) fromProto(p *pb.ContentEmbedding) *ContentEmbedding {
+ if p == nil {
+ return nil
+ }
+ return &ContentEmbedding{
+ Values: p.Values,
+ }
+}
+
+// CountTokensResponse is a response from `CountTokens`.
+//
+// It returns the model's `token_count` for the `prompt`.
+type CountTokensResponse struct {
+ // The number of tokens that the `model` tokenizes the `prompt` into.
+ //
+ // Always non-negative.
+ TotalTokens int32
+}
+
+func (v *CountTokensResponse) toProto() *pb.CountTokensResponse {
+ if v == nil {
+ return nil
+ }
+ return &pb.CountTokensResponse{
+ TotalTokens: v.TotalTokens,
+ }
+}
+
+func (CountTokensResponse) fromProto(p *pb.CountTokensResponse) *CountTokensResponse {
+ if p == nil {
+ return nil
+ }
+ return &CountTokensResponse{
+ TotalTokens: p.TotalTokens,
+ }
+}
+
+// EmbedContentResponse is the response to an `EmbedContentRequest`.
+type EmbedContentResponse struct {
+ // Output only. The embedding generated from the input content.
+ Embedding *ContentEmbedding
+}
+
+func (v *EmbedContentResponse) toProto() *pb.EmbedContentResponse {
+ if v == nil {
+ return nil
+ }
+ return &pb.EmbedContentResponse{
+ Embedding: v.Embedding.toProto(),
+ }
+}
+
+func (EmbedContentResponse) fromProto(p *pb.EmbedContentResponse) *EmbedContentResponse {
+ if p == nil {
+ return nil
+ }
+ return &EmbedContentResponse{
+ Embedding: (ContentEmbedding{}).fromProto(p.Embedding),
+ }
+}
+
+// File is a file uploaded to the API.
+type File struct {
+ // 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`
+ Name string
+ // 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"
+ DisplayName string
+ // Output only. MIME type of the file.
+ MIMEType string
+ // Output only. Size of the file in bytes.
+ SizeBytes int64
+ // Output only. The timestamp of when the `File` was created.
+ CreateTime time.Time
+ // Output only. The timestamp of when the `File` was last updated.
+ UpdateTime time.Time
+ // Output only. The timestamp of when the `File` will be deleted. Only set if
+ // the `File` is scheduled to expire.
+ ExpirationTime time.Time
+ // Output only. SHA-256 hash of the uploaded bytes.
+ Sha256Hash []byte
+ // Output only. The uri of the `File`.
+ URI string
+ // Output only. Processing state of the File.
+ State FileState
+}
+
+func (v *File) toProto() *pb.File {
+ if v == nil {
+ return nil
+ }
+ return &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),
+ Sha256Hash: v.Sha256Hash,
+ Uri: v.URI,
+ State: pb.File_State(v.State),
+ }
+}
+
+func (File) fromProto(p *pb.File) *File {
+ if p == nil {
+ return nil
+ }
+ return &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),
+ Sha256Hash: p.Sha256Hash,
+ URI: p.Uri,
+ State: FileState(p.State),
+ }
+}
+
+// FileData is URI based data.
+type FileData struct {
+ // Optional. The IANA standard MIME type of the source data.
+ MIMEType string
+ // Required. URI.
+ URI string
+}
+
+func (v *FileData) toProto() *pb.FileData {
+ if v == nil {
+ return nil
+ }
+ return &pb.FileData{
+ MimeType: v.MIMEType,
+ FileUri: v.URI,
+ }
+}
+
+func (FileData) fromProto(p *pb.FileData) *FileData {
+ if p == nil {
+ return nil
+ }
+ return &FileData{
+ MIMEType: p.MimeType,
+ URI: p.FileUri,
+ }
+}
+
+// FileState represents states for the lifecycle of a File.
+type FileState int32
+
+const (
+ // FileStateUnspecified means the default value. This value is used if the state is omitted.
+ FileStateUnspecified FileState = 0
+ // FileStateProcessing means file is being processed and cannot be used for inference yet.
+ FileStateProcessing FileState = 1
+ // FileStateActive means file is processed and available for inference.
+ FileStateActive FileState = 2
+ // FileStateFailed means file failed processing.
+ FileStateFailed FileState = 10
+)
+
+var namesForFileState = map[FileState]string{
+ FileStateUnspecified: "FileStateUnspecified",
+ FileStateProcessing: "FileStateProcessing",
+ FileStateActive: "FileStateActive",
+ FileStateFailed: "FileStateFailed",
+}
+
+func (v FileState) String() string {
+ if n, ok := namesForFileState[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("FileState(%d)", v)
+}
+
+// FinishReason is defines the reason why the model stopped generating tokens.
+type FinishReason int32
+
+const (
+ // FinishReasonUnspecified means default value. This value is unused.
+ FinishReasonUnspecified FinishReason = 0
+ // FinishReasonStop means natural stop point of the model or provided stop sequence.
+ FinishReasonStop FinishReason = 1
+ // FinishReasonMaxTokens means the maximum number of tokens as specified in the request was reached.
+ FinishReasonMaxTokens FinishReason = 2
+ // FinishReasonSafety means the candidate content was flagged for safety reasons.
+ FinishReasonSafety FinishReason = 3
+ // FinishReasonRecitation means the candidate content was flagged for recitation reasons.
+ FinishReasonRecitation FinishReason = 4
+ // FinishReasonOther means unknown reason.
+ FinishReasonOther FinishReason = 5
+)
+
+var namesForFinishReason = map[FinishReason]string{
+ FinishReasonUnspecified: "FinishReasonUnspecified",
+ FinishReasonStop: "FinishReasonStop",
+ FinishReasonMaxTokens: "FinishReasonMaxTokens",
+ FinishReasonSafety: "FinishReasonSafety",
+ FinishReasonRecitation: "FinishReasonRecitation",
+ FinishReasonOther: "FinishReasonOther",
+}
+
+func (v FinishReason) String() string {
+ if n, ok := namesForFinishReason[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("FinishReason(%d)", v)
+}
+
+// FunctionCall is a predicted `FunctionCall` returned from the model that contains
+// a string representing the `FunctionDeclaration.name` with the
+// arguments and their values.
+type FunctionCall struct {
+ // 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.
+ Name string
+ // Optional. The function parameters and values in JSON object format.
+ Args map[string]any
+}
+
+func (v *FunctionCall) toProto() *pb.FunctionCall {
+ if v == nil {
+ return nil
+ }
+ return &pb.FunctionCall{
+ Name: v.Name,
+ Args: support.MapToStructPB(v.Args),
+ }
+}
+
+func (FunctionCall) fromProto(p *pb.FunctionCall) *FunctionCall {
+ if p == nil {
+ return nil
+ }
+ return &FunctionCall{
+ Name: p.Name,
+ Args: support.MapFromStructPB(p.Args),
+ }
+}
+
+// FunctionCallingConfig holds configuration for function calling.
+type FunctionCallingConfig struct {
+ // Optional. Specifies the mode in which function calling should execute. If
+ // unspecified, the default value will be set to AUTO.
+ Mode FunctionCallingMode
+ // 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.
+ AllowedFunctionNames []string
+}
+
+func (v *FunctionCallingConfig) toProto() *pb.FunctionCallingConfig {
+ if v == nil {
+ return nil
+ }
+ return &pb.FunctionCallingConfig{
+ Mode: pb.FunctionCallingConfig_Mode(v.Mode),
+ AllowedFunctionNames: v.AllowedFunctionNames,
+ }
+}
+
+func (FunctionCallingConfig) fromProto(p *pb.FunctionCallingConfig) *FunctionCallingConfig {
+ if p == nil {
+ return nil
+ }
+ return &FunctionCallingConfig{
+ Mode: FunctionCallingMode(p.Mode),
+ AllowedFunctionNames: p.AllowedFunctionNames,
+ }
+}
+
+// FunctionCallingMode is defines the execution behavior for function calling by defining the
+// execution mode.
+type FunctionCallingMode int32
+
+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.
+ 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
+ // limited to any one of "allowed_function_names", else the predicted
+ // function call will be any one of the provided "function_declarations".
+ FunctionCallingAny FunctionCallingMode = 2
+ // FunctionCallingNone means model will not predict any function call. Model behavior is same as when
+ // not passing any function declarations.
+ FunctionCallingNone FunctionCallingMode = 3
+)
+
+var namesForFunctionCallingMode = map[FunctionCallingMode]string{
+ FunctionCallingUnspecified: "FunctionCallingUnspecified",
+ FunctionCallingAuto: "FunctionCallingAuto",
+ FunctionCallingAny: "FunctionCallingAny",
+ FunctionCallingNone: "FunctionCallingNone",
+}
+
+func (v FunctionCallingMode) String() string {
+ if n, ok := namesForFunctionCallingMode[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("FunctionCallingMode(%d)", v)
+}
+
+// FunctionDeclaration is 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 FunctionDeclaration struct {
+ // 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.
+ Name string
+ // Required. A brief description of the function.
+ Description string
+ // 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.
+ Parameters *Schema
+}
+
+func (v *FunctionDeclaration) toProto() *pb.FunctionDeclaration {
+ if v == nil {
+ return nil
+ }
+ return &pb.FunctionDeclaration{
+ Name: v.Name,
+ Description: v.Description,
+ Parameters: v.Parameters.toProto(),
+ }
+}
+
+func (FunctionDeclaration) fromProto(p *pb.FunctionDeclaration) *FunctionDeclaration {
+ if p == nil {
+ return nil
+ }
+ return &FunctionDeclaration{
+ Name: p.Name,
+ Description: p.Description,
+ Parameters: (Schema{}).fromProto(p.Parameters),
+ }
+}
+
+// FunctionResponse is 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 FunctionResponse struct {
+ // 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.
+ Name string
+ // Required. The function response in JSON object format.
+ Response map[string]any
+}
+
+func (v *FunctionResponse) toProto() *pb.FunctionResponse {
+ if v == nil {
+ return nil
+ }
+ return &pb.FunctionResponse{
+ Name: v.Name,
+ Response: support.MapToStructPB(v.Response),
+ }
+}
+
+func (FunctionResponse) fromProto(p *pb.FunctionResponse) *FunctionResponse {
+ if p == nil {
+ return nil
+ }
+ return &FunctionResponse{
+ Name: p.Name,
+ Response: support.MapFromStructPB(p.Response),
+ }
+}
+
+// GenerateContentResponse is the response from a GenerateContent or GenerateContentStream call.
+//
+// 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`.
+type GenerateContentResponse struct {
+ // Candidate responses from the model.
+ Candidates []*Candidate
+ // Returns the prompt's feedback related to the content filters.
+ PromptFeedback *PromptFeedback
+ // Output only. Metadata on the generation requests' token usage.
+ UsageMetadata *UsageMetadata
+}
+
+func (v *GenerateContentResponse) toProto() *pb.GenerateContentResponse {
+ if v == nil {
+ return nil
+ }
+ return &pb.GenerateContentResponse{
+ Candidates: support.TransformSlice(v.Candidates, (*Candidate).toProto),
+ PromptFeedback: v.PromptFeedback.toProto(),
+ UsageMetadata: v.UsageMetadata.toProto(),
+ }
+}
+
+func (GenerateContentResponse) fromProto(p *pb.GenerateContentResponse) *GenerateContentResponse {
+ if p == nil {
+ return nil
+ }
+ return &GenerateContentResponse{
+ Candidates: support.TransformSlice(p.Candidates, (Candidate{}).fromProto),
+ PromptFeedback: (PromptFeedback{}).fromProto(p.PromptFeedback),
+ UsageMetadata: (UsageMetadata{}).fromProto(p.UsageMetadata),
+ }
+}
+
+// GenerationConfig is configuration options for model generation and outputs. Not all parameters
+// may be configurable for every model.
+type GenerationConfig struct {
+ // Optional. Number of generated responses to return.
+ //
+ // Currently, this value can only be set to 1. If unset, this will default
+ // to 1.
+ CandidateCount *int32
+ // 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.
+ StopSequences []string
+ // 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.
+ MaxOutputTokens *int32
+ // 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].
+ Temperature *float32
+ // 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.
+ TopP *float32
+ // 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.
+ TopK *int32
+ // Optional. Output response mimetype of the generated candidate text.
+ // Supported mimetype:
+ // `text/plain`: (default) Text output.
+ // `application/json`: JSON response in the candidates.
+ ResponseMIMEType string
+ // 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.
+ ResponseSchema *Schema
+}
+
+func (v *GenerationConfig) toProto() *pb.GenerationConfig {
+ if v == nil {
+ return nil
+ }
+ return &pb.GenerationConfig{
+ CandidateCount: v.CandidateCount,
+ StopSequences: v.StopSequences,
+ MaxOutputTokens: v.MaxOutputTokens,
+ Temperature: v.Temperature,
+ TopP: v.TopP,
+ TopK: v.TopK,
+ ResponseMimeType: v.ResponseMIMEType,
+ ResponseSchema: v.ResponseSchema.toProto(),
+ }
+}
+
+func (GenerationConfig) fromProto(p *pb.GenerationConfig) *GenerationConfig {
+ if p == nil {
+ return nil
+ }
+ return &GenerationConfig{
+ CandidateCount: p.CandidateCount,
+ StopSequences: p.StopSequences,
+ MaxOutputTokens: p.MaxOutputTokens,
+ Temperature: p.Temperature,
+ TopP: p.TopP,
+ TopK: p.TopK,
+ ResponseMIMEType: p.ResponseMimeType,
+ ResponseSchema: (Schema{}).fromProto(p.ResponseSchema),
+ }
+}
+
+// HarmBlockThreshold specifies block at and beyond a specified harm probability.
+type HarmBlockThreshold int32
+
+const (
+ // HarmBlockUnspecified means threshold is unspecified.
+ HarmBlockUnspecified HarmBlockThreshold = 0
+ // HarmBlockLowAndAbove means content with NEGLIGIBLE will be allowed.
+ HarmBlockLowAndAbove HarmBlockThreshold = 1
+ // HarmBlockMediumAndAbove means content with NEGLIGIBLE and LOW will be allowed.
+ HarmBlockMediumAndAbove HarmBlockThreshold = 2
+ // HarmBlockOnlyHigh means content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.
+ HarmBlockOnlyHigh HarmBlockThreshold = 3
+ // HarmBlockNone means all content will be allowed.
+ HarmBlockNone HarmBlockThreshold = 4
+)
+
+var namesForHarmBlockThreshold = map[HarmBlockThreshold]string{
+ HarmBlockUnspecified: "HarmBlockUnspecified",
+ HarmBlockLowAndAbove: "HarmBlockLowAndAbove",
+ HarmBlockMediumAndAbove: "HarmBlockMediumAndAbove",
+ HarmBlockOnlyHigh: "HarmBlockOnlyHigh",
+ HarmBlockNone: "HarmBlockNone",
+}
+
+func (v HarmBlockThreshold) String() string {
+ if n, ok := namesForHarmBlockThreshold[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("HarmBlockThreshold(%d)", v)
+}
+
+// HarmCategory specifies the category of a rating.
+//
+// These categories cover various kinds of harms that developers
+// may wish to adjust.
+type HarmCategory int32
+
+const (
+ // HarmCategoryUnspecified means category is unspecified.
+ HarmCategoryUnspecified HarmCategory = 0
+ // HarmCategoryDerogatory means negative or harmful comments targeting identity and/or protected attribute.
+ HarmCategoryDerogatory HarmCategory = 1
+ // HarmCategoryToxicity means content that is rude, disrespectful, or profane.
+ HarmCategoryToxicity HarmCategory = 2
+ // HarmCategoryViolence means describes scenarios depicting violence against an individual or group, or
+ // general descriptions of gore.
+ HarmCategoryViolence HarmCategory = 3
+ // HarmCategorySexual means contains references to sexual acts or other lewd content.
+ HarmCategorySexual HarmCategory = 4
+ // HarmCategoryMedical means promotes unchecked medical advice.
+ HarmCategoryMedical HarmCategory = 5
+ // HarmCategoryDangerous means dangerous content that promotes, facilitates, or encourages harmful acts.
+ HarmCategoryDangerous HarmCategory = 6
+ // HarmCategoryHarassment means harasment content.
+ HarmCategoryHarassment HarmCategory = 7
+ // HarmCategoryHateSpeech means hate speech and content.
+ HarmCategoryHateSpeech HarmCategory = 8
+ // HarmCategorySexuallyExplicit means sexually explicit content.
+ HarmCategorySexuallyExplicit HarmCategory = 9
+ // HarmCategoryDangerousContent means dangerous content.
+ HarmCategoryDangerousContent HarmCategory = 10
+)
+
+var namesForHarmCategory = map[HarmCategory]string{
+ HarmCategoryUnspecified: "HarmCategoryUnspecified",
+ HarmCategoryDerogatory: "HarmCategoryDerogatory",
+ HarmCategoryToxicity: "HarmCategoryToxicity",
+ HarmCategoryViolence: "HarmCategoryViolence",
+ HarmCategorySexual: "HarmCategorySexual",
+ HarmCategoryMedical: "HarmCategoryMedical",
+ HarmCategoryDangerous: "HarmCategoryDangerous",
+ HarmCategoryHarassment: "HarmCategoryHarassment",
+ HarmCategoryHateSpeech: "HarmCategoryHateSpeech",
+ HarmCategorySexuallyExplicit: "HarmCategorySexuallyExplicit",
+ HarmCategoryDangerousContent: "HarmCategoryDangerousContent",
+}
+
+func (v HarmCategory) String() string {
+ if n, ok := namesForHarmCategory[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("HarmCategory(%d)", v)
+}
+
+// HarmProbability specifies the probability that a piece of content is harmful.
+//
+// The classification system gives the probability of the content being
+// unsafe. This does not indicate the severity of harm for a piece of content.
+type HarmProbability int32
+
+const (
+ // HarmProbabilityUnspecified means probability is unspecified.
+ HarmProbabilityUnspecified HarmProbability = 0
+ // HarmProbabilityNegligible means content has a negligible chance of being unsafe.
+ HarmProbabilityNegligible HarmProbability = 1
+ // HarmProbabilityLow means content has a low chance of being unsafe.
+ HarmProbabilityLow HarmProbability = 2
+ // HarmProbabilityMedium means content has a medium chance of being unsafe.
+ HarmProbabilityMedium HarmProbability = 3
+ // HarmProbabilityHigh means content has a high chance of being unsafe.
+ HarmProbabilityHigh HarmProbability = 4
+)
+
+var namesForHarmProbability = map[HarmProbability]string{
+ HarmProbabilityUnspecified: "HarmProbabilityUnspecified",
+ HarmProbabilityNegligible: "HarmProbabilityNegligible",
+ HarmProbabilityLow: "HarmProbabilityLow",
+ HarmProbabilityMedium: "HarmProbabilityMedium",
+ HarmProbabilityHigh: "HarmProbabilityHigh",
+}
+
+func (v HarmProbability) String() string {
+ if n, ok := namesForHarmProbability[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("HarmProbability(%d)", v)
+}
+
+// ModelInfo is information about a language model.
+type ModelInfo struct {
+ // 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`
+ Name string
+ // Required. The name of the base model, pass this to the generation request.
+ //
+ // Examples:
+ //
+ // * `chat-bison`
+ BaseModelID string
+ // Required. The version number of the model.
+ //
+ // This represents the major version
+ Version string
+ // 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.
+ DisplayName string
+ // A short description of the model.
+ Description string
+ // Maximum number of input tokens allowed for this model.
+ InputTokenLimit int32
+ // Maximum number of output tokens available for this model.
+ OutputTokenLimit int32
+ // The model's supported generation methods.
+ //
+ // The method names are defined as Pascal case
+ // strings, such as `generateMessage` which correspond to API methods.
+ 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.
+ // This value specifies default to be used by the backend while making the
+ // call to the model.
+ Temperature float32
+ // 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.
+ TopP float32
+ // 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.
+ TopK int32
+}
+
+func (v *ModelInfo) toProto() *pb.Model {
+ if v == nil {
+ return nil
+ }
+ return &pb.Model{
+ Name: v.Name,
+ BaseModelId: v.BaseModelID,
+ Version: v.Version,
+ DisplayName: v.DisplayName,
+ Description: v.Description,
+ InputTokenLimit: v.InputTokenLimit,
+ OutputTokenLimit: v.OutputTokenLimit,
+ SupportedGenerationMethods: v.SupportedGenerationMethods,
+ Temperature: support.AddrOrNil(v.Temperature),
+ TopP: support.AddrOrNil(v.TopP),
+ TopK: support.AddrOrNil(v.TopK),
+ }
+}
+
+func (ModelInfo) fromProto(p *pb.Model) *ModelInfo {
+ if p == nil {
+ return nil
+ }
+ return &ModelInfo{
+ Name: p.Name,
+ BaseModelID: p.BaseModelId,
+ Version: p.Version,
+ DisplayName: p.DisplayName,
+ Description: p.Description,
+ InputTokenLimit: p.InputTokenLimit,
+ OutputTokenLimit: p.OutputTokenLimit,
+ SupportedGenerationMethods: p.SupportedGenerationMethods,
+ Temperature: support.DerefOrZero(p.Temperature),
+ TopP: support.DerefOrZero(p.TopP),
+ TopK: support.DerefOrZero(p.TopK),
+ }
+}
+
+// PromptFeedback contains a set of the feedback metadata the prompt specified in
+// `GenerateContentRequest.content`.
+type PromptFeedback struct {
+ // Optional. If set, the prompt was blocked and no candidates are returned.
+ // Rephrase your prompt.
+ BlockReason BlockReason
+ // Ratings for safety of the prompt.
+ // There is at most one rating per category.
+ SafetyRatings []*SafetyRating
+}
+
+func (v *PromptFeedback) toProto() *pb.GenerateContentResponse_PromptFeedback {
+ if v == nil {
+ return nil
+ }
+ return &pb.GenerateContentResponse_PromptFeedback{
+ BlockReason: pb.GenerateContentResponse_PromptFeedback_BlockReason(v.BlockReason),
+ SafetyRatings: support.TransformSlice(v.SafetyRatings, (*SafetyRating).toProto),
+ }
+}
+
+func (PromptFeedback) fromProto(p *pb.GenerateContentResponse_PromptFeedback) *PromptFeedback {
+ if p == nil {
+ return nil
+ }
+ return &PromptFeedback{
+ BlockReason: BlockReason(p.BlockReason),
+ SafetyRatings: support.TransformSlice(p.SafetyRatings, (SafetyRating{}).fromProto),
+ }
+}
+
+// SafetyRating is the 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.
+type SafetyRating struct {
+ // Required. The category for this rating.
+ Category HarmCategory
+ // Required. The probability of harm for this content.
+ Probability HarmProbability
+ // Was this content blocked because of this rating?
+ Blocked bool
+}
+
+func (v *SafetyRating) toProto() *pb.SafetyRating {
+ if v == nil {
+ return nil
+ }
+ return &pb.SafetyRating{
+ Category: pb.HarmCategory(v.Category),
+ Probability: pb.SafetyRating_HarmProbability(v.Probability),
+ Blocked: v.Blocked,
+ }
+}
+
+func (SafetyRating) fromProto(p *pb.SafetyRating) *SafetyRating {
+ if p == nil {
+ return nil
+ }
+ return &SafetyRating{
+ Category: HarmCategory(p.Category),
+ Probability: HarmProbability(p.Probability),
+ Blocked: p.Blocked,
+ }
+}
+
+// SafetySetting is safety setting, affecting the safety-blocking behavior.
+//
+// Passing a safety setting for a category changes the allowed probability that
+// content is blocked.
+type SafetySetting struct {
+ // Required. The category for this setting.
+ Category HarmCategory
+ // Required. Controls the probability threshold at which harm is blocked.
+ Threshold HarmBlockThreshold
+}
+
+func (v *SafetySetting) toProto() *pb.SafetySetting {
+ if v == nil {
+ return nil
+ }
+ return &pb.SafetySetting{
+ Category: pb.HarmCategory(v.Category),
+ Threshold: pb.SafetySetting_HarmBlockThreshold(v.Threshold),
+ }
+}
+
+func (SafetySetting) fromProto(p *pb.SafetySetting) *SafetySetting {
+ if p == nil {
+ return nil
+ }
+ return &SafetySetting{
+ Category: HarmCategory(p.Category),
+ Threshold: HarmBlockThreshold(p.Threshold),
+ }
+}
+
+// Schema is 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).
+type Schema struct {
+ // Required. Data type.
+ Type Type
+ // 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
+ Format string
+ // Optional. A brief description of the parameter. This could contain examples
+ // of use. Parameter description may be formatted as Markdown.
+ Description string
+ // Optional. Indicates if the value may be null.
+ Nullable bool
+ // 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"]}
+ Enum []string
+ // Optional. Schema of the elements of Type.ARRAY.
+ Items *Schema
+ // Optional. Properties of Type.OBJECT.
+ Properties map[string]*Schema
+ // Optional. Required properties of Type.OBJECT.
+ Required []string
+}
+
+func (v *Schema) toProto() *pb.Schema {
+ if v == nil {
+ return nil
+ }
+ return &pb.Schema{
+ Type: pb.Type(v.Type),
+ Format: v.Format,
+ Description: v.Description,
+ Nullable: v.Nullable,
+ Enum: v.Enum,
+ Items: v.Items.toProto(),
+ Properties: support.TransformMapValues(v.Properties, (*Schema).toProto),
+ Required: v.Required,
+ }
+}
+
+func (Schema) fromProto(p *pb.Schema) *Schema {
+ if p == nil {
+ return nil
+ }
+ return &Schema{
+ Type: Type(p.Type),
+ Format: p.Format,
+ Description: p.Description,
+ Nullable: p.Nullable,
+ Enum: p.Enum,
+ Items: (Schema{}).fromProto(p.Items),
+ Properties: support.TransformMapValues(p.Properties, (Schema{}).fromProto),
+ Required: p.Required,
+ }
+}
+
+// TaskType is type of task for which the embedding will be used.
+type TaskType int32
+
+const (
+ // TaskTypeUnspecified means unset value, which will default to one of the other enum values.
+ TaskTypeUnspecified TaskType = 0
+ // TaskTypeRetrievalQuery means specifies the given text is a query in a search/retrieval setting.
+ TaskTypeRetrievalQuery TaskType = 1
+ // TaskTypeRetrievalDocument means specifies the given text is a document from the corpus being searched.
+ TaskTypeRetrievalDocument TaskType = 2
+ // TaskTypeSemanticSimilarity means specifies the given text will be used for STS.
+ TaskTypeSemanticSimilarity TaskType = 3
+ // TaskTypeClassification means specifies that the given text will be classified.
+ TaskTypeClassification TaskType = 4
+ // TaskTypeClustering means specifies that the embeddings will be used for clustering.
+ TaskTypeClustering TaskType = 5
+ // TaskTypeQuestionAnswering means specifies that the given text will be used for question answering.
+ TaskTypeQuestionAnswering TaskType = 6
+ // TaskTypeFactVerification means specifies that the given text will be used for fact verification.
+ TaskTypeFactVerification TaskType = 7
+)
+
+var namesForTaskType = map[TaskType]string{
+ TaskTypeUnspecified: "TaskTypeUnspecified",
+ TaskTypeRetrievalQuery: "TaskTypeRetrievalQuery",
+ TaskTypeRetrievalDocument: "TaskTypeRetrievalDocument",
+ TaskTypeSemanticSimilarity: "TaskTypeSemanticSimilarity",
+ TaskTypeClassification: "TaskTypeClassification",
+ TaskTypeClustering: "TaskTypeClustering",
+ TaskTypeQuestionAnswering: "TaskTypeQuestionAnswering",
+ TaskTypeFactVerification: "TaskTypeFactVerification",
+}
+
+func (v TaskType) String() string {
+ if n, ok := namesForTaskType[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("TaskType(%d)", v)
+}
+
+// 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 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.
+ FunctionDeclarations []*FunctionDeclaration
+}
+
+func (v *Tool) toProto() *pb.Tool {
+ if v == nil {
+ return nil
+ }
+ return &pb.Tool{
+ FunctionDeclarations: support.TransformSlice(v.FunctionDeclarations, (*FunctionDeclaration).toProto),
+ }
+}
+
+func (Tool) fromProto(p *pb.Tool) *Tool {
+ if p == nil {
+ return nil
+ }
+ return &Tool{
+ FunctionDeclarations: support.TransformSlice(p.FunctionDeclarations, (FunctionDeclaration{}).fromProto),
+ }
+}
+
+// ToolConfig is the Tool configuration containing parameters for specifying `Tool` use
+// in the request.
+type ToolConfig struct {
+ // Optional. Function calling config.
+ FunctionCallingConfig *FunctionCallingConfig
+}
+
+func (v *ToolConfig) toProto() *pb.ToolConfig {
+ if v == nil {
+ return nil
+ }
+ return &pb.ToolConfig{
+ FunctionCallingConfig: v.FunctionCallingConfig.toProto(),
+ }
+}
+
+func (ToolConfig) fromProto(p *pb.ToolConfig) *ToolConfig {
+ if p == nil {
+ return nil
+ }
+ return &ToolConfig{
+ FunctionCallingConfig: (FunctionCallingConfig{}).fromProto(p.FunctionCallingConfig),
+ }
+}
+
+// Type contains the list of OpenAPI data types as defined by
+// https://spec.openapis.org/oas/v3.0.3#data-types
+type Type int32
+
+const (
+ // TypeUnspecified means not specified, should not be used.
+ TypeUnspecified Type = 0
+ // TypeString means string type.
+ TypeString Type = 1
+ // TypeNumber means number type.
+ TypeNumber Type = 2
+ // TypeInteger means integer type.
+ TypeInteger Type = 3
+ // TypeBoolean means boolean type.
+ TypeBoolean Type = 4
+ // TypeArray means array type.
+ TypeArray Type = 5
+ // TypeObject means object type.
+ TypeObject Type = 6
+)
+
+var namesForType = map[Type]string{
+ TypeUnspecified: "TypeUnspecified",
+ TypeString: "TypeString",
+ TypeNumber: "TypeNumber",
+ TypeInteger: "TypeInteger",
+ TypeBoolean: "TypeBoolean",
+ TypeArray: "TypeArray",
+ TypeObject: "TypeObject",
+}
+
+func (v Type) String() string {
+ if n, ok := namesForType[v]; ok {
+ return n
+ }
+ return fmt.Sprintf("Type(%d)", v)
+}
+
+// UsageMetadata is metadata on the generation request's token usage.
+type UsageMetadata struct {
+ // Number of tokens in the prompt.
+ PromptTokenCount int32
+ // Total number of tokens across the generated candidates.
+ CandidatesTokenCount int32
+ // Total token count for the generation request (prompt + candidates).
+ TotalTokenCount int32
+}
+
+func (v *UsageMetadata) toProto() *pb.GenerateContentResponse_UsageMetadata {
+ if v == nil {
+ return nil
+ }
+ return &pb.GenerateContentResponse_UsageMetadata{
+ PromptTokenCount: v.PromptTokenCount,
+ CandidatesTokenCount: v.CandidatesTokenCount,
+ TotalTokenCount: v.TotalTokenCount,
+ }
+}
+
+func (UsageMetadata) fromProto(p *pb.GenerateContentResponse_UsageMetadata) *UsageMetadata {
+ if p == nil {
+ return nil
+ }
+ return &UsageMetadata{
+ PromptTokenCount: p.PromptTokenCount,
+ CandidatesTokenCount: p.CandidatesTokenCount,
+ TotalTokenCount: p.TotalTokenCount,
+ }
+}
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
new file mode 100644
index 000000000..0ec3a9bb7
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-api.json
@@ -0,0 +1,4052 @@
+{
+ "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."
+ },
+ "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"
+ }
+ }
+ }
+ },
+ "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"
+ },
+ "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"
+ },
+ "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"
+ }
+ }
+ },
+ "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
+ }
+ }
+ },
+ "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."
+ ]
+ }
+ }
+ },
+ "GroundingPassages": {
+ "description": "A repeated list of passages.",
+ "properties": {
+ "passages": {
+ "description": "List of passages.",
+ "items": {
+ "$ref": "GroundingPassage"
+ },
+ "type": "array"
+ }
+ },
+ "type": "object",
+ "id": "GroundingPassages"
+ },
+ "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."
+ },
+ "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."
+ },
+ "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"
+ ],
+ "type": "string",
+ "description": "Optional. Immutable. The type of the grantee."
+ },
+ "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
+ },
+ "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."
+ ],
+ "description": "Required. The role granted by this permission.",
+ "type": "string"
+ },
+ "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"
+ },
+ "model": {
+ "description": "Required. The model name to use with the format model=models/{model}.",
+ "type": "string"
+ }
+ }
+ },
+ "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"
+ }
+ },
+ "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"
+ }
+ },
+ "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"
+ },
+ "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"
+ }
+ },
+ "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"
+ },
+ "type": "array",
+ "description": "Candidate responses from the model."
+ },
+ "usageMetadata": {
+ "description": "Output only. Metadata on the generation requests' token usage.",
+ "readOnly": true,
+ "$ref": "UsageMetadata"
+ },
+ "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"
+ },
+ "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"
+ },
+ "description": "The embedding values.",
+ "type": "array"
+ }
+ },
+ "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"
+ },
+ "readOnly": true,
+ "type": "array"
+ }
+ }
+ },
+ "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": {
+ "$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."
+ },
+ "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."
+ },
+ "fileData": {
+ "description": "URI based data.",
+ "$ref": "FileData"
+ },
+ "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."
+ },
+ "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"
+ },
+ "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
+ },
+ "groundingAttributions": {
+ "items": {
+ "$ref": "GroundingAttribution"
+ },
+ "type": "array",
+ "readOnly": true,
+ "description": "Output only. Attribution information for sources that contributed to a grounded answer. This field is populated for `GenerateAnswer` calls."
+ },
+ "content": {
+ "description": "Output only. Generated content returned from the model.",
+ "$ref": "Content",
+ "readOnly": true
+ },
+ "index": {
+ "type": "integer",
+ "format": "int32",
+ "readOnly": true,
+ "description": "Output only. Index of the candidate in the list of candidates."
+ },
+ "safetyRatings": {
+ "items": {
+ "$ref": "SafetyRating"
+ },
+ "type": "array",
+ "description": "List of ratings for the safety of a response candidate. There is at most one rating per category."
+ },
+ "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"
+ },
+ "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"
+ ],
+ "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"
+ }
+ }
+ }
+ },
+ "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"
+ },
+ "error": {
+ "description": "The error result of the operation in case of failure or cancellation.",
+ "$ref": "Status"
+ },
+ "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"
+ },
+ "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"
+ }
+ },
+ "metadata": {
+ "additionalProperties": {
+ "description": "Properties of the object. Contains field @type with type URL.",
+ "type": "any"
+ },
+ "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."
+ },
+ "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"
+ },
+ "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`)"
+ }
+ },
+ "id": "GenerateAnswerResponse",
+ "description": "Response from the model for a grounded answer."
+ },
+ "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"
+ }
+ },
+ "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"
+ },
+ "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"
+ },
+ "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."
+ },
+ "generationConfig": {
+ "$ref": "GenerationConfig",
+ "description": "Optional. Configuration options for model generation and outputs."
+ }
+ },
+ "description": "Request to generate a completion from the model.",
+ "type": "object",
+ "id": "GenerateContentRequest"
+ },
+ "InputFeedback": {
+ "type": "object",
+ "properties": {
+ "safetyRatings": {
+ "type": "array",
+ "description": "Ratings for safety of the input. There is at most one rating per category.",
+ "items": {
+ "$ref": "SafetyRating"
+ }
+ },
+ "blockReason": {
+ "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."
+ ],
+ "enum": [
+ "BLOCK_REASON_UNSPECIFIED",
+ "SAFETY",
+ "OTHER"
+ ],
+ "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."
+ },
+ "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."
+ },
+ "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"
+ },
+ "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"
+ }
+ },
+ "id": "GenerateTextRequest",
+ "type": "object",
+ "description": "Request to generate a text completion response from the model."
+ },
+ "RelevantChunk": {
+ "properties": {
+ "chunkRelevanceScore": {
+ "type": "number",
+ "format": "float",
+ "description": "`Chunk` relevance to the query."
+ },
+ "chunk": {
+ "$ref": "Chunk",
+ "description": "`Chunk` associated with the query."
+ }
+ },
+ "id": "RelevantChunk",
+ "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"
+ },
+ "SemanticRetrieverConfig": {
+ "id": "SemanticRetrieverConfig",
+ "description": "Configuration for retrieving grounding content from a `Corpus` or `Document` created using the Semantic Retriever API.",
+ "type": "object",
+ "properties": {
+ "maxChunksCount": {
+ "type": "integer",
+ "description": "Optional. Maximum number of relevant `Chunk`s to retrieve.",
+ "format": "int32"
+ },
+ "metadataFilters": {
+ "type": "array",
+ "items": {
+ "$ref": "MetadataFilter"
+ },
+ "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."
+ }
+ }
+ },
+ "GenerateTextResponse": {
+ "properties": {
+ "candidates": {
+ "description": "Candidate responses from the model.",
+ "items": {
+ "$ref": "TextCompletion"
+ },
+ "type": "array"
+ },
+ "safetyFeedback": {
+ "description": "Returns any safety feedback related to content filtering.",
+ "type": "array",
+ "items": {
+ "$ref": "SafetyFeedback"
+ }
+ },
+ "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"
+ }
+ },
+ "type": "object",
+ "description": "The response from the model, including candidate completions.",
+ "id": "GenerateTextResponse"
+ },
+ "Chunk": {
+ "properties": {
+ "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"
+ }
+ },
+ "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"
+ },
+ "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).",
+ "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": {
+ "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\"]}",
+ "items": {
+ "type": "string"
+ }
+ },
+ "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"
+ },
+ "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.",
+ "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."
+ ],
+ "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"
+ ]
+ },
+ "probability": {
+ "type": "string",
+ "description": "Required. The probability of harm for this content.",
+ "enumDescriptions": [
+ "Probability is unspecified.",
+ "Content has a negligible chance of being unsafe.",
+ "Content has a low chance of being unsafe.",
+ "Content has a medium chance of being unsafe.",
+ "Content has a high chance of being unsafe."
+ ],
+ "enum": [
+ "HARM_PROBABILITY_UNSPECIFIED",
+ "NEGLIGIBLE",
+ "LOW",
+ "MEDIUM",
+ "HIGH"
+ ]
+ }
+ },
+ "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."
+ },
+ "File": {
+ "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`",
+ "type": "string"
+ },
+ "createTime": {
+ "type": "string",
+ "format": "google-datetime",
+ "description": "Output only. The timestamp of when the `File` was created.",
+ "readOnly": true
+ },
+ "sizeBytes": {
+ "type": "string",
+ "description": "Output only. Size of the file in bytes.",
+ "readOnly": true,
+ "format": "int64"
+ },
+ "sha256Hash": {
+ "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"
+ ],
+ "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."
+ ],
+ "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."
+ },
+ "uri": {
+ "readOnly": true,
+ "type": "string",
+ "description": "Output only. The uri of the `File`."
+ },
+ "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"
+ },
+ "mimeType": {
+ "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."
+ }
+ }
+ },
+ "CountMessageTokensResponse": {
+ "id": "CountMessageTokensResponse",
+ "properties": {
+ "tokenCount": {
+ "format": "int32",
+ "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"
+ },
+ "createTime": {
+ "description": "Output only. The Timestamp of when the `Corpus` was created.",
+ "type": "string",
+ "format": "google-datetime",
+ "readOnly": true
+ },
+ "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"
+ },
+ "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`"
+ }
+ },
+ "id": "Corpus",
+ "description": "A `Corpus` is a collection of `Document`s. A project can create up to 5 corpora.",
+ "type": "object"
+ },
+ "TuningExamples": {
+ "id": "TuningExamples",
+ "description": "A set of tuning examples. Can be training or validation data.",
+ "type": "object",
+ "properties": {
+ "examples": {
+ "items": {
+ "$ref": "TuningExample"
+ },
+ "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."
+ }
+ }
+ },
+ "Example": {
+ "description": "An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.",
+ "id": "Example",
+ "properties": {
+ "input": {
+ "$ref": "Message",
+ "description": "Required. An example of an input `Message` from the user."
+ },
+ "output": {
+ "$ref": "Message",
+ "description": "Required. An example of what the model should output given the input."
+ }
+ },
+ "type": "object"
+ },
+ "StringList": {
+ "id": "StringList",
+ "properties": {
+ "values": {
+ "description": "The string values of the metadata to store.",
+ "items": {
+ "type": "string"
+ },
+ "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",
+ "type": "object",
+ "description": "User provided metadata stored as key-value pairs.",
+ "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"
+ },
+ "numericValue": {
+ "description": "The numeric value of the metadata to store.",
+ "type": "number",
+ "format": "float"
+ },
+ "stringListValue": {
+ "description": "The StringList value of the metadata to store.",
+ "$ref": "StringList"
+ }
+ }
+ },
+ "MessagePrompt": {
+ "type": "object",
+ "id": "MessagePrompt",
+ "properties": {
+ "messages": {
+ "type": "array",
+ "description": "Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.",
+ "items": {
+ "$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",
+ "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`."
+ }
+ },
+ "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."
+ },
+ "CreateFileRequest": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "description": "Optional. Metadata for the file to create.",
+ "$ref": "File"
+ }
+ },
+ "description": "Request for `CreateFile`.",
+ "id": "CreateFileRequest"
+ },
+ "GenerateAnswerRequest": {
+ "description": "Request to generate a grounded answer from the model.",
+ "properties": {
+ "safetySettings": {
+ "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."
+ },
+ "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 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": {
+ "enumDescriptions": [
+ "Unspecified answer style.",
+ "Succint but abstract style.",
+ "Very brief and extractive style.",
+ "Verbose style including extra details. The response may be formatted as a sentence, paragraph, multiple paragraphs, or bullet points, etc."
+ ],
+ "enum": [
+ "ANSWER_STYLE_UNSPECIFIED",
+ "ABSTRACTIVE",
+ "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."
+ },
+ "inlinePassages": {
+ "$ref": "GroundingPassages",
+ "description": "Passages provided inline with the request."
+ }
+ },
+ "id": "GenerateAnswerRequest",
+ "type": "object"
+ },
+ "Message": {
+ "id": "Message",
+ "properties": {
+ "author": {
+ "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."
+ },
+ "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."
+ },
+ "content": {
+ "description": "Required. The text content of the structured `Message`.",
+ "type": "string"
+ }
+ },
+ "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": {
+ "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"
+ },
+ "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"
+ },
+ "uri": {
+ "description": "Optional. URI that is attributed as a source for a portion of the text.",
+ "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",
+ "type": "object"
+ },
+ "GenerateMessageRequest": {
+ "type": "object",
+ "description": "Request to generate a message response from the model.",
+ "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"
+ },
+ "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"
+ },
+ "temperature": {
+ "type": "number",
+ "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."
+ },
+ "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`."
+ },
+ "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"
+ }
+ },
+ "id": "GenerateMessageRequest"
+ },
+ "CreateFileResponse": {
+ "description": "Response for `CreateFile`.",
+ "id": "CreateFileResponse",
+ "type": "object",
+ "properties": {
+ "file": {
+ "$ref": "File",
+ "description": "Metadata for the created file."
+ }
+ }
+ },
+ "CountTextTokensResponse": {
+ "id": "CountTextTokensResponse",
+ "properties": {
+ "tokenCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative."
+ }
+ },
+ "type": "object",
+ "description": "A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`."
+ },
+ "ListChunksResponse": {
+ "type": "object",
+ "id": "ListChunksResponse",
+ "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": {
+ "type": "array",
+ "description": "The returned `Chunk`s.",
+ "items": {
+ "$ref": "Chunk"
+ }
+ }
+ },
+ "description": "Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`."
+ },
+ "TransferOwnershipResponse": {
+ "type": "object",
+ "description": "Response from `TransferOwnership`.",
+ "properties": {},
+ "id": "TransferOwnershipResponse"
+ },
+ "BatchDeleteChunksRequest": {
+ "id": "BatchDeleteChunksRequest",
+ "properties": {
+ "requests": {
+ "items": {
+ "$ref": "DeleteChunkRequest"
+ },
+ "description": "Required. The request messages specifying the `Chunk`s to delete.",
+ "type": "array"
+ }
+ },
+ "type": "object",
+ "description": "Request to batch delete `Chunk`s."
+ },
+ "ListPermissionsResponse": {
+ "properties": {
+ "permissions": {
+ "description": "Returned permissions.",
+ "type": "array",
+ "items": {
+ "$ref": "Permission"
+ }
+ },
+ "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",
+ "id": "ListPermissionsResponse",
+ "description": "Response from `ListPermissions` containing a paginated list of permissions."
+ },
+ "DeleteChunkRequest": {
+ "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`"
+ }
+ },
+ "id": "DeleteChunkRequest",
+ "description": "Request to delete a `Chunk`.",
+ "type": "object"
+ },
+ "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.",
+ "format": "int32"
+ },
+ "details": {
+ "items": {
+ "type": "object",
+ "additionalProperties": {
+ "description": "Properties of the object. Contains field @type with type URL.",
+ "type": "any"
+ }
+ },
+ "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.",
+ "type": "array"
+ }
+ },
+ "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",
+ "properties": {
+ "batchSize": {
+ "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.",
+ "type": "integer"
+ },
+ "epochCount": {
+ "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."
+ }
+ },
+ "id": "Hyperparameters",
+ "description": "Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance"
+ },
+ "BatchCreateChunksResponse": {
+ "id": "BatchCreateChunksResponse",
+ "properties": {
+ "chunks": {
+ "type": "array",
+ "description": "`Chunk`s created.",
+ "items": {
+ "$ref": "Chunk"
+ }
+ }
+ },
+ "description": "Response from `BatchCreateChunks` containing a list of created `Chunk`s.",
+ "type": "object"
+ },
+ "GroundingAttribution": {
+ "description": "Attribution for a source that contributed to an answer.",
+ "properties": {
+ "sourceId": {
+ "$ref": "AttributionSourceId",
+ "readOnly": true,
+ "description": "Output only. Identifier for the source contributing to this attribution."
+ },
+ "content": {
+ "description": "Grounding source content that makes up this attribution.",
+ "$ref": "Content"
+ }
+ },
+ "type": "object",
+ "id": "GroundingAttribution"
+ },
+ "Condition": {
+ "id": "Condition",
+ "type": "object",
+ "properties": {
+ "stringValue": {
+ "type": "string",
+ "description": "The string value to filter the metadata on."
+ },
+ "operation": {
+ "description": "Required. Operator applied to the given key-value pair to trigger the condition.",
+ "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`."
+ ]
+ },
+ "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": {
+ "items": {
+ "format": "float",
+ "type": "number"
+ },
+ "type": "array",
+ "description": "The embedding values."
+ }
+ },
+ "id": "ContentEmbedding",
+ "type": "object"
+ },
+ "UsageMetadata": {
+ "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"
+ },
+ "totalTokenCount": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total token count for the generation request (prompt + candidates)."
+ }
+ }
+ },
+ "TuningTask": {
+ "properties": {
+ "trainingData": {
+ "description": "Required. Input only. Immutable. The model training data.",
+ "$ref": "Dataset"
+ },
+ "snapshots": {
+ "items": {
+ "$ref": "TuningSnapshot"
+ },
+ "description": "Output only. Metrics collected during tuning.",
+ "readOnly": true,
+ "type": "array"
+ },
+ "completeTime": {
+ "format": "google-datetime",
+ "description": "Output only. The timestamp when tuning this model completed.",
+ "readOnly": true,
+ "type": "string"
+ },
+ "hyperparameters": {
+ "$ref": "Hyperparameters",
+ "description": "Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used."
+ },
+ "startTime": {
+ "format": "google-datetime",
+ "description": "Output only. The timestamp when tuning this model started.",
+ "readOnly": true,
+ "type": "string"
+ }
+ },
+ "type": "object",
+ "description": "Tuning tasks that create tuned models.",
+ "id": "TuningTask"
+ },
+ "QueryDocumentRequest": {
+ "type": "object",
+ "properties": {
+ "query": {
+ "type": "string",
+ "description": "Required. Query string to perform semantic search."
+ },
+ "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"
+ },
+ "metadataFilters": {
+ "type": "array",
+ "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."
+ }
+ },
+ "description": "Request for querying a `Document`.",
+ "id": "QueryDocumentRequest"
+ },
+ "BatchEmbedTextRequest": {
+ "id": "BatchEmbedTextRequest",
+ "type": "object",
+ "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": {
+ "items": {
+ "$ref": "EmbedTextRequest"
+ },
+ "type": "array",
+ "description": "Optional. Embed requests for the batch. Only one of `texts` or `requests` can be set."
+ }
+ },
+ "description": "Batch request to get a text embedding from the model."
+ },
+ "AttributionSourceId": {
+ "id": "AttributionSourceId",
+ "type": "object",
+ "properties": {
+ "semanticRetrieverChunk": {
+ "$ref": "SemanticRetrieverChunk",
+ "description": "Identifier for a `Chunk` fetched via Semantic Retriever."
+ },
+ "groundingPassage": {
+ "$ref": "GroundingPassageId",
+ "description": "Identifier for an inline passage."
+ }
+ },
+ "description": "Identifier for the source contributing to this attribution."
+ },
+ "EmbedTextResponse": {
+ "properties": {
+ "embedding": {
+ "description": "Output only. The embedding generated from the input text.",
+ "$ref": "Embedding",
+ "readOnly": true
+ }
+ },
+ "type": "object",
+ "description": "The response to a EmbedTextRequest.",
+ "id": "EmbedTextResponse"
+ },
+ "GroundingPassage": {
+ "id": "GroundingPassage",
+ "type": "object",
+ "description": "Passage included inline with a grounding configuration.",
+ "properties": {
+ "content": {
+ "$ref": "Content",
+ "description": "Content of the passage."
+ },
+ "id": {
+ "description": "Identifier for the passage for attributing this passage in grounded answers.",
+ "type": "string"
+ }
+ }
+ },
+ "FunctionCall": {
+ "id": "FunctionCall",
+ "properties": {
+ "args": {
+ "type": "object",
+ "description": "Optional. The function parameters and values in JSON object format.",
+ "additionalProperties": {
+ "description": "Properties of the object.",
+ "type": "any"
+ }
+ },
+ "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": "A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.",
+ "type": "object"
+ },
+ "GenerationConfig": {
+ "id": "GenerationConfig",
+ "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"
+ },
+ "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"
+ },
+ "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"
+ },
+ "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"
+ },
+ "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."
+ },
+ "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]."
+ },
+ "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."
+ },
+ "stopSequences": {
+ "items": {
+ "type": "string"
+ },
+ "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": "Configuration options for model generation and outputs. Not all parameters may be configurable for every model.",
+ "type": "object"
+ },
+ "TextCompletion": {
+ "id": "TextCompletion",
+ "type": "object",
+ "description": "Output text returned from a model.",
+ "properties": {
+ "safetyRatings": {
+ "items": {
+ "$ref": "SafetyRating"
+ },
+ "type": "array",
+ "description": "Ratings for the safety of a response. There is at most one rating per category."
+ },
+ "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`.",
+ "$ref": "CitationMetadata"
+ },
+ "output": {
+ "readOnly": true,
+ "type": "string",
+ "description": "Output only. The generated text returned from the model."
+ }
+ }
+ },
+ "BatchUpdateChunksResponse": {
+ "properties": {
+ "chunks": {
+ "description": "`Chunk`s updated.",
+ "items": {
+ "$ref": "Chunk"
+ },
+ "type": "array"
+ }
+ },
+ "description": "Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.",
+ "type": "object",
+ "id": "BatchUpdateChunksResponse"
+ },
+ "ListCorporaResponse": {
+ "properties": {
+ "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."
+ },
+ "corpora": {
+ "description": "The returned corpora.",
+ "type": "array",
+ "items": {
+ "$ref": "Corpus"
+ }
+ }
+ },
+ "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",
+ "properties": {
+ "documents": {
+ "description": "The returned `Document`s.",
+ "type": "array",
+ "items": {
+ "$ref": "Document"
+ }
+ },
+ "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"
+ },
+ "Dataset": {
+ "description": "Dataset for training or validation.",
+ "properties": {
+ "examples": {
+ "$ref": "TuningExamples",
+ "description": "Optional. Inline examples."
+ }
+ },
+ "id": "Dataset",
+ "type": "object"
+ },
+ "UpdateChunkRequest": {
+ "type": "object",
+ "properties": {
+ "updateMask": {
+ "description": "Required. The list of fields to update. Currently, this only supports updating `custom_metadata` and `data`.",
+ "type": "string",
+ "format": "google-fieldmask"
+ },
+ "chunk": {
+ "description": "Required. The `Chunk` to update.",
+ "$ref": "Chunk"
+ }
+ },
+ "id": "UpdateChunkRequest",
+ "description": "Request to update a `Chunk`."
+ },
+ "TextPrompt": {
+ "id": "TextPrompt",
+ "description": "Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.",
+ "properties": {
+ "text": {
+ "type": "string",
+ "description": "Required. The prompt text."
+ }
+ },
+ "type": "object"
+ },
+ "ListModelsResponse": {
+ "description": "Response from `ListModel` containing a paginated list of Models.",
+ "properties": {
+ "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."
+ },
+ "models": {
+ "items": {
+ "$ref": "Model"
+ },
+ "description": "The returned Models.",
+ "type": "array"
+ }
+ },
+ "type": "object",
+ "id": "ListModelsResponse"
+ },
+ "PromptFeedback": {
+ "id": "PromptFeedback",
+ "type": "object",
+ "description": "A set of the feedback metadata the prompt specified in `GenerateContentRequest.content`.",
+ "properties": {
+ "safetyRatings": {
+ "type": "array",
+ "description": "Ratings for safety of the prompt. There is at most one rating per category.",
+ "items": {
+ "$ref": "SafetyRating"
+ }
+ },
+ "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."
+ ],
+ "enum": [
+ "BLOCK_REASON_UNSPECIFIED",
+ "SAFETY",
+ "OTHER"
+ ],
+ "type": "string"
+ }
+ }
+ },
+ "ListFilesResponse": {
+ "id": "ListFilesResponse",
+ "description": "Response for `ListFiles`.",
+ "type": "object",
+ "properties": {
+ "files": {
+ "type": "array",
+ "description": "The list of `File`s.",
+ "items": {
+ "$ref": "File"
+ }
+ },
+ "nextPageToken": {
+ "description": "A token that can be sent as a `page_token` into a subsequent `ListFiles` call.",
+ "type": "string"
+ }
+ }
+ },
+ "EmbedContentRequest": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "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}`"
+ },
+ "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.",
+ "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": "Request containing the `Content` for the model to embed.",
+ "id": "EmbedContentRequest"
+ },
+ "TunedModel": {
+ "properties": {
+ "state": {
+ "readOnly": true,
+ "description": "Output only. The state of the tuned 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"
+ ]
+ },
+ "updateTime": {
+ "description": "Output only. The timestamp when this model was updated.",
+ "readOnly": true,
+ "format": "google-datetime",
+ "type": "string"
+ },
+ "name": {
+ "readOnly": true,
+ "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\""
+ },
+ "tuningTask": {
+ "description": "Required. The tuning task that creates the tuned model.",
+ "$ref": "TuningTask"
+ },
+ "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."
+ },
+ "createTime": {
+ "type": "string",
+ "format": "google-datetime",
+ "readOnly": true,
+ "description": "Output only. The timestamp when this model was created."
+ },
+ "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."
+ },
+ "description": {
+ "type": "string",
+ "description": "Optional. A short description of this model."
+ },
+ "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.",
+ "type": "number",
+ "format": "float"
+ },
+ "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"
+ },
+ "baseModel": {
+ "type": "string",
+ "description": "Immutable. The name of the `Model` to tune. Example: `models/text-bison-001`"
+ },
+ "tunedModelSource": {
+ "description": "Optional. TunedModel to use as the starting point for training the new model.",
+ "$ref": "TunedModelSource"
+ }
+ },
+ "description": "A fine-tuned model created using ModelService.CreateTunedModel.",
+ "type": "object",
+ "id": "TunedModel"
+ },
+ "BatchCreateChunksRequest": {
+ "type": "object",
+ "properties": {
+ "requests": {
+ "type": "array",
+ "description": "Required. The request messages specifying the `Chunk`s to create. A maximum of 100 `Chunk`s can be created in a batch.",
+ "items": {
+ "$ref": "CreateChunkRequest"
+ }
+ }
+ },
+ "id": "BatchCreateChunksRequest",
+ "description": "Request to batch create `Chunk`s."
+ },
+ "ChunkData": {
+ "properties": {
+ "stringValue": {
+ "description": "The `Chunk` content as a string. The maximum number of tokens per chunk is 2043.",
+ "type": "string"
+ }
+ },
+ "type": "object",
+ "description": "Extracted data that represents the `Chunk` content.",
+ "id": "ChunkData"
+ },
+ "FunctionCallingConfig": {
+ "properties": {
+ "mode": {
+ "enum": [
+ "MODE_UNSPECIFIED",
+ "AUTO",
+ "ANY",
+ "NONE"
+ ],
+ "description": "Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.",
+ "type": "string",
+ "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."
+ ]
+ },
+ "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.",
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "description": "Configuration for specifying function calling behavior.",
+ "id": "FunctionCallingConfig",
+ "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.",
+ "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."
+ ]
+ },
+ "threshold": {
+ "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."
+ ],
+ "enum": [
+ "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
+ "BLOCK_LOW_AND_ABOVE",
+ "BLOCK_MEDIUM_AND_ABOVE",
+ "BLOCK_ONLY_HIGH",
+ "BLOCK_NONE"
+ ],
+ "description": "Required. Controls the probability threshold at which harm is blocked."
+ }
+ }
+ },
+ "Document": {
+ "properties": {
+ "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`"
+ },
+ "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"
+ },
+ "customMetadata": {
+ "description": "Optional. User provided custom metadata stored as key-value pairs used for querying. A `Document` can have a maximum of 20 `CustomMetadata`.",
+ "type": "array",
+ "items": {
+ "$ref": "CustomMetadata"
+ }
+ },
+ "createTime": {
+ "type": "string",
+ "readOnly": true,
+ "description": "Output only. The Timestamp of when the `Document` was created.",
+ "format": "google-datetime"
+ },
+ "updateTime": {
+ "readOnly": true,
+ "format": "google-datetime",
+ "type": "string",
+ "description": "Output only. The Timestamp of when the `Document` was last updated."
+ }
+ },
+ "description": "A `Document` is a collection of `Chunk`s. A `Corpus` can have a maximum of 10,000 `Document`s.",
+ "type": "object",
+ "id": "Document"
+ },
+ "FunctionResponse": {
+ "id": "FunctionResponse",
+ "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"
+ }
+ },
+ "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": {
+ "properties": {
+ "embeddings": {
+ "readOnly": true,
+ "type": "array",
+ "description": "Output only. The embeddings for each request, in the same order as provided in the batch request.",
+ "items": {
+ "$ref": "ContentEmbedding"
+ }
+ }
+ },
+ "id": "BatchEmbedContentsResponse",
+ "type": "object",
+ "description": "The response to a `BatchEmbedContentsRequest`."
+ },
+ "TunedModelSource": {
+ "id": "TunedModelSource",
+ "description": "Tuned model as a source for training a new model.",
+ "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": {
+ "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`"
+ }
+ },
+ "type": "object"
+ },
+ "Tool": {
+ "properties": {
+ "functionDeclarations": {
+ "type": "array",
+ "items": {
+ "$ref": "FunctionDeclaration"
+ },
+ "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."
+ }
+ },
+ "id": "Tool",
+ "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."
+ },
+ "CountTokensResponse": {
+ "type": "object",
+ "properties": {
+ "totalTokens": {
+ "description": "The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.",
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "description": "A response from `CountTokens`. It returns the model's `token_count` for the `prompt`.",
+ "id": "CountTokensResponse"
+ },
+ "FileData": {
+ "id": "FileData",
+ "type": "object",
+ "properties": {
+ "fileUri": {
+ "type": "string",
+ "description": "Required. URI."
+ },
+ "mimeType": {
+ "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,
+ "type": "string",
+ "description": "Output only. Name of the `Chunk` containing the attributed text. Example: `corpora/123/documents/abc/chunks/xyz`"
+ },
+ "source": {
+ "readOnly": true,
+ "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"
+ },
+ "epoch": {
+ "readOnly": true,
+ "type": "integer",
+ "format": "int32",
+ "description": "Output only. The epoch this step was part of."
+ },
+ "computeTime": {
+ "description": "Output only. The timestamp when this metric was computed.",
+ "readOnly": true,
+ "format": "google-datetime",
+ "type": "string"
+ },
+ "step": {
+ "format": "int32",
+ "type": "integer",
+ "readOnly": true,
+ "description": "Output only. The tuning step."
+ }
+ },
+ "id": "TuningSnapshot",
+ "type": "object"
+ },
+ "ToolConfig": {
+ "type": "object",
+ "id": "ToolConfig",
+ "properties": {
+ "functionCallingConfig": {
+ "$ref": "FunctionCallingConfig",
+ "description": "Optional. Function calling config."
+ }
+ },
+ "description": "The Tool configuration containing parameters for specifying `Tool` use in the request."
+ },
+ "CountTextTokensRequest": {
+ "properties": {
+ "prompt": {
+ "description": "Required. The free-form input text given to the model as a prompt.",
+ "$ref": "TextPrompt"
+ }
+ },
+ "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": "CountTextTokensRequest"
+ },
+ "Model": {
+ "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": {
+ "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"
+ },
+ "version": {
+ "type": "string",
+ "description": "Required. The version number of the model. This represents the major version"
+ },
+ "supportedGenerationMethods": {
+ "items": {
+ "type": "string"
+ },
+ "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."
+ },
+ "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"
+ },
+ "description": {
+ "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"
+ }
+ },
+ "type": "object",
+ "id": "Model",
+ "description": "Information about a Generative Language Model."
+ },
+ "MetadataFilter": {
+ "properties": {
+ "conditions": {
+ "items": {
+ "$ref": "Condition"
+ },
+ "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"
+ }
+ },
+ "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"
+ },
+ "GroundingPassageId": {
+ "properties": {
+ "passageId": {
+ "type": "string",
+ "readOnly": true,
+ "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": "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"
+ ]
+ },
+ "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"
+ }
+ },
+ "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"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "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"
+ ]
+ }
+ }
+ }
+ },
+ "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"
+ },
+ "delete": {
+ "description": "Deletes a `Corpus`.",
+ "flatPath": "v1beta/corpora/{corporaId}",
+ "id": "generativelanguage.corpora.delete",
+ "parameterOrder": [
+ "name"
+ ],
+ "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": "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"
+ }
+ },
+ "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"
+ }
+ },
+ "get": {
+ "parameterOrder": [
+ "name"
+ ],
+ "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"
+ ],
+ "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}"
+ }
+ }
+ },
+ "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"
+ }
+ },
+ "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"
+ },
+ "id": "generativelanguage.models.countTextTokens"
+ },
+ "generateAnswer": {
+ "response": {
+ "$ref": "GenerateAnswerResponse"
+ },
+ "id": "generativelanguage.models.generateAnswer",
+ "request": {
+ "$ref": "GenerateAnswerRequest"
+ },
+ "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
+ }
+ }
+ }
+ }
+ }
+ },
+ "basePath": ""
+}
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
new file mode 100644
index 000000000..46501dd38
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go
@@ -0,0 +1,10168 @@
+// Copyright 2024 Google LLC.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Code generated file. DO NOT EDIT.
+
+// Package generativelanguage provides access to the Generative Language API.
+//
+// For product documentation, see: https://developers.generativeai.google/api
+//
+// # Library status
+//
+// These client libraries are officially supported by Google. However, this
+// library is considered complete and is in maintenance mode. This means
+// that we will address critical bugs and security issues but will not add
+// any new features.
+//
+// When possible, we recommend using our newer
+// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
+// that are still actively being worked and iterated on.
+//
+// # Creating a client
+//
+// Usage example:
+//
+// import "google.golang.org/api/generativelanguage/v1beta"
+// ...
+// ctx := context.Background()
+// generativelanguageService, err := generativelanguage.NewService(ctx)
+//
+// In this example, Google Application Default Credentials are used for
+// authentication. For information on how to create and obtain Application
+// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
+//
+// # Other authentication options
+//
+// To use an API key for authentication (note: some APIs do not support API
+// keys), use [google.golang.org/api/option.WithAPIKey]:
+//
+// generativelanguageService, err := generativelanguage.NewService(ctx, option.WithAPIKey("AIza..."))
+//
+// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
+// flow, use [google.golang.org/api/option.WithTokenSource]:
+//
+// config := &oauth2.Config{...}
+// // ...
+// token, err := config.Exchange(ctx, ...)
+// generativelanguageService, err := generativelanguage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
+//
+// See [google.golang.org/api/option.ClientOption] for details on options.
+package generativelanguage // import "google.golang.org/api/generativelanguage/v1beta"
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+
+ internal "github.com/google/generative-ai-go/genai/internal"
+ gensupport "github.com/google/generative-ai-go/genai/internal/gensupport"
+ googleapi "google.golang.org/api/googleapi"
+ option "google.golang.org/api/option"
+ internaloption "google.golang.org/api/option/internaloption"
+ htransport "google.golang.org/api/transport/http"
+)
+
+// Always reference these packages, just in case the auto-generated code
+// below doesn't.
+var _ = bytes.NewBuffer
+var _ = strconv.Itoa
+var _ = fmt.Sprintf
+var _ = json.NewDecoder
+var _ = io.Copy
+var _ = url.Parse
+var _ = gensupport.MarshalJSON
+var _ = googleapi.Version
+var _ = errors.New
+var _ = strings.Replace
+var _ = context.Canceled
+var _ = internaloption.WithDefaultEndpoint
+var _ = internal.Version
+
+const apiId = "generativelanguage:v1beta"
+const apiName = "generativelanguage"
+const apiVersion = "v1beta"
+const basePath = "https://generativelanguage.googleapis.com/"
+const basePathTemplate = "https://generativelanguage.UNIVERSE_DOMAIN/"
+const mtlsBasePath = "https://generativelanguage.mtls.googleapis.com/"
+
+// NewService creates a new Service.
+func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
+ opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
+ opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
+ opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
+ opts = append(opts, internaloption.EnableNewAuthLibrary())
+ client, endpoint, err := htransport.NewClient(ctx, opts...)
+ if err != nil {
+ return nil, err
+ }
+ s, err := New(client)
+ if err != nil {
+ return nil, err
+ }
+ if endpoint != "" {
+ s.BasePath = endpoint
+ }
+ return s, nil
+}
+
+// New creates a new Service. It uses the provided http.Client for requests.
+//
+// Deprecated: please use NewService instead.
+// To provide a custom HTTP client, use option.WithHTTPClient.
+// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
+func New(client *http.Client) (*Service, error) {
+ if client == nil {
+ return nil, errors.New("client is nil")
+ }
+ s := &Service{client: client, BasePath: basePath}
+ s.Corpora = NewCorporaService(s)
+ s.Files = NewFilesService(s)
+ s.Media = NewMediaService(s)
+ s.Models = NewModelsService(s)
+ s.TunedModels = NewTunedModelsService(s)
+ return s, nil
+}
+
+type Service struct {
+ client *http.Client
+ BasePath string // API endpoint base URL
+ UserAgent string // optional additional User-Agent fragment
+
+ Corpora *CorporaService
+
+ Files *FilesService
+
+ Media *MediaService
+
+ Models *ModelsService
+
+ TunedModels *TunedModelsService
+}
+
+func (s *Service) userAgent() string {
+ if s.UserAgent == "" {
+ return googleapi.UserAgent
+ }
+ return googleapi.UserAgent + " " + s.UserAgent
+}
+
+func NewCorporaService(s *Service) *CorporaService {
+ rs := &CorporaService{s: s}
+ rs.Documents = NewCorporaDocumentsService(s)
+ rs.Permissions = NewCorporaPermissionsService(s)
+ return rs
+}
+
+type CorporaService struct {
+ s *Service
+
+ Documents *CorporaDocumentsService
+
+ Permissions *CorporaPermissionsService
+}
+
+func NewCorporaDocumentsService(s *Service) *CorporaDocumentsService {
+ rs := &CorporaDocumentsService{s: s}
+ rs.Chunks = NewCorporaDocumentsChunksService(s)
+ return rs
+}
+
+type CorporaDocumentsService struct {
+ s *Service
+
+ Chunks *CorporaDocumentsChunksService
+}
+
+func NewCorporaDocumentsChunksService(s *Service) *CorporaDocumentsChunksService {
+ rs := &CorporaDocumentsChunksService{s: s}
+ return rs
+}
+
+type CorporaDocumentsChunksService struct {
+ s *Service
+}
+
+func NewCorporaPermissionsService(s *Service) *CorporaPermissionsService {
+ rs := &CorporaPermissionsService{s: s}
+ return rs
+}
+
+type CorporaPermissionsService struct {
+ s *Service
+}
+
+func NewFilesService(s *Service) *FilesService {
+ rs := &FilesService{s: s}
+ return rs
+}
+
+type FilesService struct {
+ s *Service
+}
+
+func NewMediaService(s *Service) *MediaService {
+ rs := &MediaService{s: s}
+ return rs
+}
+
+type MediaService struct {
+ s *Service
+}
+
+func NewModelsService(s *Service) *ModelsService {
+ rs := &ModelsService{s: s}
+ return rs
+}
+
+type ModelsService struct {
+ s *Service
+}
+
+func NewTunedModelsService(s *Service) *TunedModelsService {
+ rs := &TunedModelsService{s: s}
+ rs.Permissions = NewTunedModelsPermissionsService(s)
+ return rs
+}
+
+type TunedModelsService struct {
+ s *Service
+
+ Permissions *TunedModelsPermissionsService
+}
+
+func NewTunedModelsPermissionsService(s *Service) *TunedModelsPermissionsService {
+ rs := &TunedModelsPermissionsService{s: s}
+ return rs
+}
+
+type TunedModelsPermissionsService struct {
+ s *Service
+}
+
+// AttributionSourceId: Identifier for the source contributing to this
+// attribution.
+type AttributionSourceId struct {
+ // GroundingPassage: Identifier for an inline passage.
+ GroundingPassage *GroundingPassageId `json:"groundingPassage,omitempty"`
+ // SemanticRetrieverChunk: Identifier for a `Chunk` fetched via Semantic
+ // Retriever.
+ SemanticRetrieverChunk *SemanticRetrieverChunk `json:"semanticRetrieverChunk,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "GroundingPassage") 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. "GroundingPassage") 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 *AttributionSourceId) MarshalJSON() ([]byte, error) {
+ type NoMethod AttributionSourceId
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchCreateChunksRequest: Request to batch create `Chunk`s.
+type BatchCreateChunksRequest struct {
+ // Requests: Required. The request messages specifying the `Chunk`s to create.
+ // A maximum of 100 `Chunk`s can be created in a batch.
+ Requests []*CreateChunkRequest `json:"requests,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchCreateChunksRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchCreateChunksRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchCreateChunksResponse: Response from `BatchCreateChunks` containing a
+// list of created `Chunk`s.
+type BatchCreateChunksResponse struct {
+ // Chunks: `Chunk`s created.
+ Chunks []*Chunk `json:"chunks,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Chunks") 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. "Chunks") 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 *BatchCreateChunksResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchCreateChunksResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchDeleteChunksRequest: Request to batch delete `Chunk`s.
+type BatchDeleteChunksRequest struct {
+ // Requests: Required. The request messages specifying the `Chunk`s to delete.
+ Requests []*DeleteChunkRequest `json:"requests,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchDeleteChunksRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchDeleteChunksRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchEmbedContentsRequest: Batch request to get embeddings from the model
+// for a list of prompts.
+type BatchEmbedContentsRequest struct {
+ // Requests: Required. Embed requests for the batch. The model in each of these
+ // requests must match the model specified `BatchEmbedContentsRequest.model`.
+ Requests []*EmbedContentRequest `json:"requests,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchEmbedContentsRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchEmbedContentsRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchEmbedContentsResponse: The response to a `BatchEmbedContentsRequest`.
+type BatchEmbedContentsResponse struct {
+ // Embeddings: Output only. The embeddings for each request, in the same order
+ // as provided in the batch request.
+ Embeddings []*ContentEmbedding `json:"embeddings,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Embeddings") 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. "Embeddings") 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 *BatchEmbedContentsResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchEmbedContentsResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchEmbedTextRequest: Batch request to get a text embedding from the model.
+type BatchEmbedTextRequest struct {
+ // Requests: Optional. Embed requests for the batch. Only one of `texts` or
+ // `requests` can be set.
+ Requests []*EmbedTextRequest `json:"requests,omitempty"`
+ // Texts: 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.
+ Texts []string `json:"texts,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchEmbedTextRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchEmbedTextRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchEmbedTextResponse: The response to a EmbedTextRequest.
+type BatchEmbedTextResponse struct {
+ // Embeddings: Output only. The embeddings generated from the input text.
+ Embeddings []*Embedding `json:"embeddings,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Embeddings") 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. "Embeddings") 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 *BatchEmbedTextResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchEmbedTextResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchUpdateChunksRequest: Request to batch update `Chunk`s.
+type BatchUpdateChunksRequest struct {
+ // Requests: Required. The request messages specifying the `Chunk`s to update.
+ // A maximum of 100 `Chunk`s can be updated in a batch.
+ Requests []*UpdateChunkRequest `json:"requests,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchUpdateChunksRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchUpdateChunksRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// BatchUpdateChunksResponse: Response from `BatchUpdateChunks` containing a
+// list of updated `Chunk`s.
+type BatchUpdateChunksResponse struct {
+ // Chunks: `Chunk`s updated.
+ Chunks []*Chunk `json:"chunks,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Chunks") 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. "Chunks") 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 *BatchUpdateChunksResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod BatchUpdateChunksResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Blob: Raw media bytes. Text should not be sent as raw bytes, use the 'text'
+// field.
+type Blob struct {
+ // Data: Raw bytes for media formats.
+ Data string `json:"data,omitempty"`
+ // MimeType: 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).
+ MimeType string `json:"mimeType,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Data") 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. "Data") 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 *Blob) MarshalJSON() ([]byte, error) {
+ type NoMethod Blob
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Candidate: A response candidate generated from the model.
+type Candidate struct {
+ // CitationMetadata: 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.
+ CitationMetadata *CitationMetadata `json:"citationMetadata,omitempty"`
+ // Content: Output only. Generated content returned from the model.
+ Content *Content `json:"content,omitempty"`
+ // FinishReason: Optional. Output only. The reason why the model stopped
+ // generating tokens. If empty, the model has not stopped generating the
+ // tokens.
+ //
+ // Possible values:
+ // "FINISH_REASON_UNSPECIFIED" - Default value. This value is unused.
+ // "STOP" - Natural stop point of the model or provided stop sequence.
+ // "MAX_TOKENS" - The maximum number of tokens as specified in the request
+ // was reached.
+ // "SAFETY" - The candidate content was flagged for safety reasons.
+ // "RECITATION" - The candidate content was flagged for recitation reasons.
+ // "OTHER" - Unknown reason.
+ FinishReason string `json:"finishReason,omitempty"`
+ // GroundingAttributions: Output only. Attribution information for sources that
+ // contributed to a grounded answer. This field is populated for
+ // `GenerateAnswer` calls.
+ GroundingAttributions []*GroundingAttribution `json:"groundingAttributions,omitempty"`
+ // Index: Output only. Index of the candidate in the list of candidates.
+ Index int64 `json:"index,omitempty"`
+ // SafetyRatings: List of ratings for the safety of a response candidate. There
+ // is at most one rating per category.
+ SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`
+ // TokenCount: Output only. Token count for this candidate.
+ TokenCount int64 `json:"tokenCount,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CitationMetadata") 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. "CitationMetadata") 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 *Candidate) MarshalJSON() ([]byte, error) {
+ type NoMethod Candidate
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Chunk: 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 Chunk struct {
+ // CreateTime: Output only. The Timestamp of when the `Chunk` was created.
+ CreateTime string `json:"createTime,omitempty"`
+ // CustomMetadata: Optional. User provided custom metadata stored as key-value
+ // pairs. The maximum number of `CustomMetadata` per chunk is 20.
+ CustomMetadata []*CustomMetadata `json:"customMetadata,omitempty"`
+ // Data: Required. The content for the `Chunk`, such as the text string. The
+ // maximum number of tokens per chunk is 2043.
+ Data *ChunkData `json:"data,omitempty"`
+ // Name: 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`
+ Name string `json:"name,omitempty"`
+ // State: Output only. Current state of the `Chunk`.
+ //
+ // Possible values:
+ // "STATE_UNSPECIFIED" - The default value. This value is used if the state
+ // is omitted.
+ // "STATE_PENDING_PROCESSING" - `Chunk` is being processed (embedding and
+ // vector storage).
+ // "STATE_ACTIVE" - `Chunk` is processed and available for querying.
+ // "STATE_FAILED" - `Chunk` failed processing.
+ State string `json:"state,omitempty"`
+ // UpdateTime: Output only. The Timestamp of when the `Chunk` was last updated.
+ UpdateTime string `json:"updateTime,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 *Chunk) MarshalJSON() ([]byte, error) {
+ type NoMethod Chunk
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ChunkData: Extracted data that represents the `Chunk` content.
+type ChunkData struct {
+ // StringValue: The `Chunk` content as a string. The maximum number of tokens
+ // per chunk is 2043.
+ StringValue string `json:"stringValue,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "StringValue") 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. "StringValue") 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 *ChunkData) MarshalJSON() ([]byte, error) {
+ type NoMethod ChunkData
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CitationMetadata: A collection of source attributions for a piece of
+// content.
+type CitationMetadata struct {
+ // CitationSources: Citations to sources for a specific response.
+ CitationSources []*CitationSource `json:"citationSources,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CitationSources") 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. "CitationSources") 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 *CitationMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod CitationMetadata
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CitationSource: A citation to a source for a portion of a specific response.
+type CitationSource struct {
+ // EndIndex: Optional. End of the attributed segment, exclusive.
+ EndIndex int64 `json:"endIndex,omitempty"`
+ // License: Optional. License for the GitHub project that is attributed as a
+ // source for segment. License info is required for code citations.
+ License string `json:"license,omitempty"`
+ // StartIndex: Optional. Start of segment of the response that is attributed to
+ // this source. Index indicates the start of the segment, measured in bytes.
+ StartIndex int64 `json:"startIndex,omitempty"`
+ // Uri: Optional. URI that is attributed as a source for a portion of the text.
+ Uri string `json:"uri,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "EndIndex") 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. "EndIndex") 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 *CitationSource) MarshalJSON() ([]byte, error) {
+ type NoMethod CitationSource
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Condition: Filter condition applicable to a single key.
+type Condition struct {
+ // NumericValue: The numeric value to filter the metadata on.
+ NumericValue float64 `json:"numericValue,omitempty"`
+ // Operation: Required. Operator applied to the given key-value pair to trigger
+ // the condition.
+ //
+ // Possible values:
+ // "OPERATOR_UNSPECIFIED" - The default value. This value is unused.
+ // "LESS" - Supported by numeric.
+ // "LESS_EQUAL" - Supported by numeric.
+ // "EQUAL" - Supported by numeric & string.
+ // "GREATER_EQUAL" - Supported by numeric.
+ // "GREATER" - Supported by numeric.
+ // "NOT_EQUAL" - Supported by numeric & string.
+ // "INCLUDES" - Supported by string only when `CustomMetadata` value type for
+ // the given key has a `string_list_value`.
+ // "EXCLUDES" - Supported by string only when `CustomMetadata` value type for
+ // the given key has a `string_list_value`.
+ Operation string `json:"operation,omitempty"`
+ // StringValue: The string value to filter the metadata on.
+ StringValue string `json:"stringValue,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "NumericValue") 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. "NumericValue") 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 *Condition) MarshalJSON() ([]byte, error) {
+ type NoMethod Condition
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *Condition) UnmarshalJSON(data []byte) error {
+ type NoMethod Condition
+ var s1 struct {
+ NumericValue gensupport.JSONFloat64 `json:"numericValue"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.NumericValue = float64(s1.NumericValue)
+ return nil
+}
+
+// Content: 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.
+type Content struct {
+ // Parts: Ordered `Parts` that constitute a single message. Parts may have
+ // different MIME types.
+ Parts []*Part `json:"parts,omitempty"`
+ // Role: 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.
+ Role string `json:"role,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Parts") 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. "Parts") 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 *Content) MarshalJSON() ([]byte, error) {
+ type NoMethod Content
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ContentEmbedding: A list of floats representing an embedding.
+type ContentEmbedding struct {
+ // Values: The embedding values.
+ Values []float64 `json:"values,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Values") 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. "Values") 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 *ContentEmbedding) MarshalJSON() ([]byte, error) {
+ type NoMethod ContentEmbedding
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *ContentEmbedding) UnmarshalJSON(data []byte) error {
+ type NoMethod ContentEmbedding
+ var s1 struct {
+ Values []gensupport.JSONFloat64 `json:"values"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.Values = make([]float64, len(s1.Values))
+ for i := range s1.Values {
+ s.Values[i] = float64(s1.Values[i])
+ }
+ return nil
+}
+
+// ContentFilter: Content filtering metadata associated with processing a
+// single request. ContentFilter contains a reason and an optional supporting
+// string. The reason may be unspecified.
+type ContentFilter struct {
+ // Message: A string that describes the filtering behavior in more detail.
+ Message string `json:"message,omitempty"`
+ // Reason: The reason content was blocked during request processing.
+ //
+ // Possible values:
+ // "BLOCKED_REASON_UNSPECIFIED" - A blocked reason was not specified.
+ // "SAFETY" - Content was blocked by safety settings.
+ // "OTHER" - Content was blocked, but the reason is uncategorized.
+ Reason string `json:"reason,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Message") 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. "Message") 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 *ContentFilter) MarshalJSON() ([]byte, error) {
+ type NoMethod ContentFilter
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Corpus: A `Corpus` is a collection of `Document`s. A project can create up
+// to 5 corpora.
+type Corpus struct {
+ // CreateTime: Output only. The Timestamp of when the `Corpus` was created.
+ CreateTime string `json:"createTime,omitempty"`
+ // DisplayName: 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"
+ DisplayName string `json:"displayName,omitempty"`
+ // Name: 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`
+ Name string `json:"name,omitempty"`
+ // UpdateTime: Output only. The Timestamp of when the `Corpus` was last
+ // updated.
+ UpdateTime string `json:"updateTime,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 *Corpus) MarshalJSON() ([]byte, error) {
+ type NoMethod Corpus
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CountMessageTokensRequest: 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 CountMessageTokensRequest struct {
+ // Prompt: Required. The prompt, whose token count is to be returned.
+ Prompt *MessagePrompt `json:"prompt,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Prompt") 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. "Prompt") 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 *CountMessageTokensRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod CountMessageTokensRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CountMessageTokensResponse: A response from `CountMessageTokens`. It returns
+// the model's `token_count` for the `prompt`.
+type CountMessageTokensResponse struct {
+ // TokenCount: The number of tokens that the `model` tokenizes the `prompt`
+ // into. Always non-negative.
+ TokenCount int64 `json:"tokenCount,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "TokenCount") 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. "TokenCount") 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 *CountMessageTokensResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod CountMessageTokensResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CountTextTokensRequest: 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 CountTextTokensRequest struct {
+ // Prompt: Required. The free-form input text given to the model as a prompt.
+ Prompt *TextPrompt `json:"prompt,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Prompt") 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. "Prompt") 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 *CountTextTokensRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod CountTextTokensRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CountTextTokensResponse: A response from `CountTextTokens`. It returns the
+// model's `token_count` for the `prompt`.
+type CountTextTokensResponse struct {
+ // TokenCount: The number of tokens that the `model` tokenizes the `prompt`
+ // into. Always non-negative.
+ TokenCount int64 `json:"tokenCount,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "TokenCount") 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. "TokenCount") 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 *CountTextTokensResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod CountTextTokensResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CountTokensRequest: 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 CountTokensRequest struct {
+ // Contents: Optional. The input given to the model as a prompt. This field is
+ // ignored when `generate_content_request` is set.
+ Contents []*Content `json:"contents,omitempty"`
+ // GenerateContentRequest: Optional. The overall input given to the model.
+ // CountTokens will count prompt, function calling, etc.
+ GenerateContentRequest *GenerateContentRequest `json:"generateContentRequest,omitempty"`
+ // 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 *CountTokensRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod CountTokensRequest
+ 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.
+ TotalTokens int64 `json:"totalTokens,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "TotalTokens") 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. "TotalTokens") 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 *CountTokensResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod CountTokensResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CreateChunkRequest: Request to create a `Chunk`.
+type CreateChunkRequest struct {
+ // Chunk: Required. The `Chunk` to create.
+ Chunk *Chunk `json:"chunk,omitempty"`
+ // Parent: Required. The name of the `Document` where this `Chunk` will be
+ // created. Example: `corpora/my-corpus-123/documents/the-doc-abc`
+ Parent string `json:"parent,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Chunk") 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. "Chunk") 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 *CreateChunkRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod CreateChunkRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CreateFileRequest: Request for `CreateFile`.
+type CreateFileRequest struct {
+ // File: Optional. Metadata for the file to create.
+ File *File `json:"file,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "File") 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. "File") 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 *CreateFileRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod CreateFileRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CreateFileResponse: Response for `CreateFile`.
+type CreateFileResponse struct {
+ // File: Metadata for the created file.
+ File *File `json:"file,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "File") 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. "File") 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 *CreateFileResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod CreateFileResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// CustomMetadata: User provided metadata stored as key-value pairs.
+type CustomMetadata struct {
+ // Key: Required. The key of the metadata to store.
+ Key string `json:"key,omitempty"`
+ // NumericValue: The numeric value of the metadata to store.
+ NumericValue float64 `json:"numericValue,omitempty"`
+ // StringListValue: The StringList value of the metadata to store.
+ StringListValue *StringList `json:"stringListValue,omitempty"`
+ // StringValue: The string value of the metadata to store.
+ StringValue string `json:"stringValue,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *CustomMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod CustomMetadata
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *CustomMetadata) UnmarshalJSON(data []byte) error {
+ type NoMethod CustomMetadata
+ var s1 struct {
+ NumericValue gensupport.JSONFloat64 `json:"numericValue"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.NumericValue = float64(s1.NumericValue)
+ return nil
+}
+
+// Dataset: Dataset for training or validation.
+type Dataset struct {
+ // Examples: Optional. Inline examples.
+ Examples *TuningExamples `json:"examples,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Examples") 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. "Examples") 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 *Dataset) MarshalJSON() ([]byte, error) {
+ type NoMethod Dataset
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// DeleteChunkRequest: Request to delete a `Chunk`.
+type DeleteChunkRequest struct {
+ // Name: Required. The resource name of the `Chunk` to delete. Example:
+ // `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`
+ Name string `json:"name,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 *DeleteChunkRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod DeleteChunkRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Document: A `Document` is a collection of `Chunk`s. A `Corpus` can have a
+// maximum of 10,000 `Document`s.
+type Document struct {
+ // CreateTime: Output only. The Timestamp of when the `Document` was created.
+ CreateTime string `json:"createTime,omitempty"`
+ // CustomMetadata: Optional. User provided custom metadata stored as key-value
+ // pairs used for querying. A `Document` can have a maximum of 20
+ // `CustomMetadata`.
+ CustomMetadata []*CustomMetadata `json:"customMetadata,omitempty"`
+ // DisplayName: 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"
+ DisplayName string `json:"displayName,omitempty"`
+ // Name: 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`
+ Name string `json:"name,omitempty"`
+ // UpdateTime: Output only. The Timestamp of when the `Document` was last
+ // updated.
+ UpdateTime string `json:"updateTime,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 *Document) MarshalJSON() ([]byte, error) {
+ type NoMethod Document
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// EmbedContentRequest: Request containing the `Content` for the model to
+// embed.
+type EmbedContentRequest struct {
+ // Content: Required. The content to embed. Only the `parts.text` fields will
+ // be counted.
+ Content *Content `json:"content,omitempty"`
+ // Model: 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}`
+ Model string `json:"model,omitempty"`
+ // OutputDimensionality: 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.
+ OutputDimensionality int64 `json:"outputDimensionality,omitempty"`
+ // TaskType: Optional. Optional task type for which the embeddings will be
+ // used. Can only be set for `models/embedding-001`.
+ //
+ // Possible values:
+ // "TASK_TYPE_UNSPECIFIED" - Unset value, which will default to one of the
+ // other enum values.
+ // "RETRIEVAL_QUERY" - Specifies the given text is a query in a
+ // search/retrieval setting.
+ // "RETRIEVAL_DOCUMENT" - Specifies the given text is a document from the
+ // corpus being searched.
+ // "SEMANTIC_SIMILARITY" - Specifies the given text will be used for STS.
+ // "CLASSIFICATION" - Specifies that the given text will be classified.
+ // "CLUSTERING" - Specifies that the embeddings will be used for clustering.
+ // "QUESTION_ANSWERING" - Specifies that the given text will be used for
+ // question answering.
+ // "FACT_VERIFICATION" - Specifies that the given text will be used for fact
+ // verification.
+ TaskType string `json:"taskType,omitempty"`
+ // Title: 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.
+ Title string `json:"title,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Content") 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. "Content") 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 *EmbedContentRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod EmbedContentRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// EmbedContentResponse: The response to an `EmbedContentRequest`.
+type EmbedContentResponse struct {
+ // Embedding: Output only. The embedding generated from the input content.
+ Embedding *ContentEmbedding `json:"embedding,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Embedding") 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. "Embedding") 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 *EmbedContentResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod EmbedContentResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// EmbedTextRequest: Request to get a text embedding from the model.
+type EmbedTextRequest struct {
+ // Model: Required. The model name to use with the format model=models/{model}.
+ Model string `json:"model,omitempty"`
+ // Text: Optional. The free-form input text that the model will turn into an
+ // embedding.
+ Text string `json:"text,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Model") 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. "Model") 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 *EmbedTextRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod EmbedTextRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// EmbedTextResponse: The response to a EmbedTextRequest.
+type EmbedTextResponse struct {
+ // Embedding: Output only. The embedding generated from the input text.
+ Embedding *Embedding `json:"embedding,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Embedding") 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. "Embedding") 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 *EmbedTextResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod EmbedTextResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Embedding: A list of floats representing the embedding.
+type Embedding struct {
+ // Value: The embedding values.
+ Value []float64 `json:"value,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Value") 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. "Value") 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 *Embedding) MarshalJSON() ([]byte, error) {
+ type NoMethod Embedding
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *Embedding) UnmarshalJSON(data []byte) error {
+ type NoMethod Embedding
+ var s1 struct {
+ Value []gensupport.JSONFloat64 `json:"value"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.Value = make([]float64, len(s1.Value))
+ for i := range s1.Value {
+ s.Value[i] = float64(s1.Value[i])
+ }
+ return nil
+}
+
+// Empty: 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 Empty struct {
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+}
+
+// Example: An input/output example used to instruct the Model. It demonstrates
+// how the model should respond or format its response.
+type Example struct {
+ // Input: Required. An example of an input `Message` from the user.
+ Input *Message `json:"input,omitempty"`
+ // Output: Required. An example of what the model should output given the
+ // input.
+ Output *Message `json:"output,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Input") 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. "Input") 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 *Example) MarshalJSON() ([]byte, error) {
+ type NoMethod Example
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// File: A file uploaded to the API.
+type File struct {
+ // CreateTime: Output only. The timestamp of when the `File` was created.
+ CreateTime string `json:"createTime,omitempty"`
+ // DisplayName: 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"
+ DisplayName string `json:"displayName,omitempty"`
+ // Error: Output only. Error status if File processing failed.
+ Error *Status `json:"error,omitempty"`
+ // ExpirationTime: Output only. The timestamp of when the `File` will be
+ // deleted. Only set if the `File` is scheduled to expire.
+ ExpirationTime string `json:"expirationTime,omitempty"`
+ // MimeType: Output only. MIME type of the file.
+ MimeType string `json:"mimeType,omitempty"`
+ // Name: 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`
+ Name string `json:"name,omitempty"`
+ // Sha256Hash: Output only. SHA-256 hash of the uploaded bytes.
+ Sha256Hash string `json:"sha256Hash,omitempty"`
+ // SizeBytes: Output only. Size of the file in bytes.
+ SizeBytes int64 `json:"sizeBytes,omitempty,string"`
+ // State: Output only. Processing state of the File.
+ //
+ // Possible values:
+ // "STATE_UNSPECIFIED" - The default value. This value is used if the state
+ // is omitted.
+ // "PROCESSING" - File is being processed and cannot be used for inference
+ // yet.
+ // "ACTIVE" - File is processed and available for inference.
+ // "FAILED" - File failed processing.
+ State string `json:"state,omitempty"`
+ // UpdateTime: Output only. The timestamp of when the `File` was last updated.
+ UpdateTime string `json:"updateTime,omitempty"`
+ // Uri: Output only. The uri of the `File`.
+ Uri string `json:"uri,omitempty"`
+ // VideoMetadata: Output only. Metadata for a video.
+ VideoMetadata *VideoMetadata `json:"videoMetadata,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 *File) MarshalJSON() ([]byte, error) {
+ type NoMethod File
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// FileData: URI based data.
+type FileData struct {
+ // FileUri: Required. URI.
+ FileUri string `json:"fileUri,omitempty"`
+ // MimeType: Optional. The IANA standard MIME type of the source data.
+ MimeType string `json:"mimeType,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "FileUri") 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. "FileUri") 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 *FileData) MarshalJSON() ([]byte, error) {
+ type NoMethod FileData
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// FunctionCall: A predicted `FunctionCall` returned from the model that
+// contains a string representing the `FunctionDeclaration.name` with the
+// arguments and their values.
+type FunctionCall struct {
+ // Args: Optional. The function parameters and values in JSON object format.
+ Args googleapi.RawMessage `json:"args,omitempty"`
+ // Name: 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.
+ Name string `json:"name,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Args") 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. "Args") 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 *FunctionCall) MarshalJSON() ([]byte, error) {
+ type NoMethod FunctionCall
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// FunctionCallingConfig: Configuration for specifying function calling
+// behavior.
+type FunctionCallingConfig struct {
+ // AllowedFunctionNames: 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.
+ AllowedFunctionNames []string `json:"allowedFunctionNames,omitempty"`
+ // Mode: Optional. Specifies the mode in which function calling should execute.
+ // If unspecified, the default value will be set to AUTO.
+ //
+ // Possible values:
+ // "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.
+ // "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
+ // call will be any one of the provided "function_declarations".
+ // "NONE" - Model will not predict any function call. Model behavior is same
+ // as when not passing any function declarations.
+ Mode string `json:"mode,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "AllowedFunctionNames") 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. "AllowedFunctionNames") 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 *FunctionCallingConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod FunctionCallingConfig
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// FunctionDeclaration: 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 FunctionDeclaration struct {
+ // Description: Required. A brief description of the function.
+ Description string `json:"description,omitempty"`
+ // Name: 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.
+ Name string `json:"name,omitempty"`
+ // Parameters: 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.
+ Parameters *Schema `json:"parameters,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Description") 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. "Description") 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 *FunctionDeclaration) MarshalJSON() ([]byte, error) {
+ type NoMethod FunctionDeclaration
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// FunctionResponse: 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 FunctionResponse struct {
+ // Name: 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.
+ Name string `json:"name,omitempty"`
+ // Response: Required. The function response in JSON object format.
+ Response googleapi.RawMessage `json:"response,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 *FunctionResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod FunctionResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GenerateAnswerRequest: Request to generate a grounded answer from the model.
+type GenerateAnswerRequest struct {
+ // AnswerStyle: Required. Style in which answers should be returned.
+ //
+ // Possible values:
+ // "ANSWER_STYLE_UNSPECIFIED" - Unspecified answer style.
+ // "ABSTRACTIVE" - Succint but abstract style.
+ // "EXTRACTIVE" - Very brief and extractive style.
+ // "VERBOSE" - Verbose style including extra details. The response may be
+ // formatted as a sentence, paragraph, multiple paragraphs, or bullet points,
+ // etc.
+ AnswerStyle string `json:"answerStyle,omitempty"`
+ // Contents: 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.
+ Contents []*Content `json:"contents,omitempty"`
+ // InlinePassages: Passages provided inline with the request.
+ InlinePassages *GroundingPassages `json:"inlinePassages,omitempty"`
+ // SafetySettings: 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.
+ SafetySettings []*SafetySetting `json:"safetySettings,omitempty"`
+ // SemanticRetriever: Content retrieved from resources created via the Semantic
+ // Retriever API.
+ SemanticRetriever *SemanticRetrieverConfig `json:"semanticRetriever,omitempty"`
+ // Temperature: 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.
+ Temperature float64 `json:"temperature,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "AnswerStyle") 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. "AnswerStyle") 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 *GenerateAnswerRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateAnswerRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *GenerateAnswerRequest) UnmarshalJSON(data []byte) error {
+ type NoMethod GenerateAnswerRequest
+ var s1 struct {
+ Temperature gensupport.JSONFloat64 `json:"temperature"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.Temperature = float64(s1.Temperature)
+ return nil
+}
+
+// GenerateAnswerResponse: Response from the model for a grounded answer.
+type GenerateAnswerResponse struct {
+ // Answer: 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`.
+ Answer *Candidate `json:"answer,omitempty"`
+ // AnswerableProbability: 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.
+ AnswerableProbability float64 `json:"answerableProbability,omitempty"`
+ // InputFeedback: 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`)
+ InputFeedback *InputFeedback `json:"inputFeedback,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Answer") 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. "Answer") 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 *GenerateAnswerResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateAnswerResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *GenerateAnswerResponse) UnmarshalJSON(data []byte) error {
+ type NoMethod GenerateAnswerResponse
+ var s1 struct {
+ AnswerableProbability gensupport.JSONFloat64 `json:"answerableProbability"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.AnswerableProbability = float64(s1.AnswerableProbability)
+ return nil
+}
+
+// GenerateContentRequest: Request to generate a completion from the model.
+type GenerateContentRequest struct {
+ // 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
+ // request.
+ Contents []*Content `json:"contents,omitempty"`
+ // GenerationConfig: Optional. Configuration options for model generation and
+ // outputs.
+ GenerationConfig *GenerationConfig `json:"generationConfig,omitempty"`
+ // Model: Required. The name of the `Model` to use for generating the
+ // completion. Format: `name=models/{model}`.
+ Model string `json:"model,omitempty"`
+ // SafetySettings: 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.
+ SafetySettings []*SafetySetting `json:"safetySettings,omitempty"`
+ // SystemInstruction: Optional. Developer set system instruction. Currently,
+ // text only.
+ SystemInstruction *Content `json:"systemInstruction,omitempty"`
+ // ToolConfig: Optional. Tool configuration for any `Tool` specified in the
+ // request.
+ ToolConfig *ToolConfig `json:"toolConfig,omitempty"`
+ // Tools: 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`.
+ Tools []*Tool `json:"tools,omitempty"`
+ // 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 *GenerateContentRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateContentRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GenerateContentResponse: 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`.
+type GenerateContentResponse struct {
+ // Candidates: Candidate responses from the model.
+ Candidates []*Candidate `json:"candidates,omitempty"`
+ // PromptFeedback: Returns the prompt's feedback related to the content
+ // filters.
+ PromptFeedback *PromptFeedback `json:"promptFeedback,omitempty"`
+ // UsageMetadata: Output only. Metadata on the generation requests' token
+ // usage.
+ UsageMetadata *UsageMetadata `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. "Candidates") 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. "Candidates") 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 *GenerateContentResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateContentResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GenerateMessageRequest: Request to generate a message response from the
+// model.
+type GenerateMessageRequest struct {
+ // CandidateCount: Optional. The number of generated response messages to
+ // return. This value must be between `[1, 8]`, inclusive. If unset, this will
+ // default to `1`.
+ CandidateCount int64 `json:"candidateCount,omitempty"`
+ // Prompt: 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.
+ Prompt *MessagePrompt `json:"prompt,omitempty"`
+ // Temperature: 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.
+ Temperature float64 `json:"temperature,omitempty"`
+ // TopK: 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.
+ TopK int64 `json:"topK,omitempty"`
+ // TopP: 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`.
+ TopP float64 `json:"topP,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CandidateCount") 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. "CandidateCount") 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 *GenerateMessageRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateMessageRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *GenerateMessageRequest) UnmarshalJSON(data []byte) error {
+ type NoMethod GenerateMessageRequest
+ var s1 struct {
+ 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.Temperature = float64(s1.Temperature)
+ s.TopP = float64(s1.TopP)
+ return nil
+}
+
+// GenerateMessageResponse: The response from the model. This includes
+// candidate messages and conversation history in the form of
+// chronologically-ordered messages.
+type GenerateMessageResponse struct {
+ // Candidates: Candidate response messages from the model.
+ Candidates []*Message `json:"candidates,omitempty"`
+ // Filters: 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.
+ Filters []*ContentFilter `json:"filters,omitempty"`
+ // Messages: The conversation history used by the model.
+ Messages []*Message `json:"messages,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Candidates") 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. "Candidates") 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 *GenerateMessageResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateMessageResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GenerateTextRequest: Request to generate a text completion response from the
+// model.
+type GenerateTextRequest struct {
+ // CandidateCount: Optional. Number of generated responses to return. This
+ // value must be between [1, 8], inclusive. If unset, this will default to 1.
+ CandidateCount int64 `json:"candidateCount,omitempty"`
+ // MaxOutputTokens: 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.
+ MaxOutputTokens int64 `json:"maxOutputTokens,omitempty"`
+ // Prompt: 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.
+ Prompt *TextPrompt `json:"prompt,omitempty"`
+ // SafetySettings: 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.
+ SafetySettings []*SafetySetting `json:"safetySettings,omitempty"`
+ // StopSequences: 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.
+ StopSequences []string `json:"stopSequences,omitempty"`
+ // Temperature: 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.
+ Temperature float64 `json:"temperature,omitempty"`
+ // TopK: 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.
+ TopK int64 `json:"topK,omitempty"`
+ // TopP: 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.
+ TopP float64 `json:"topP,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CandidateCount") 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. "CandidateCount") 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 *GenerateTextRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateTextRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *GenerateTextRequest) UnmarshalJSON(data []byte) error {
+ type NoMethod GenerateTextRequest
+ var s1 struct {
+ 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.Temperature = float64(s1.Temperature)
+ s.TopP = float64(s1.TopP)
+ return nil
+}
+
+// GenerateTextResponse: The response from the model, including candidate
+// completions.
+type GenerateTextResponse struct {
+ // Candidates: Candidate responses from the model.
+ Candidates []*TextCompletion `json:"candidates,omitempty"`
+ // Filters: 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).
+ Filters []*ContentFilter `json:"filters,omitempty"`
+ // SafetyFeedback: Returns any safety feedback related to content filtering.
+ SafetyFeedback []*SafetyFeedback `json:"safetyFeedback,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Candidates") 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. "Candidates") 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 *GenerateTextResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerateTextResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GenerationConfig: Configuration options for model generation and outputs.
+// Not all parameters may be configurable for every model.
+type GenerationConfig struct {
+ // CandidateCount: Optional. Number of generated responses to return.
+ // Currently, this value can only be set to 1. If unset, this will default to
+ // 1.
+ CandidateCount int64 `json:"candidateCount,omitempty"`
+ // MaxOutputTokens: 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.
+ MaxOutputTokens int64 `json:"maxOutputTokens,omitempty"`
+ // ResponseMimeType: Optional. Output response mimetype of the generated
+ // candidate text. Supported mimetype: `text/plain`: (default) Text output.
+ // `application/json`: JSON response in the candidates.
+ ResponseMimeType string `json:"responseMimeType,omitempty"`
+ // ResponseSchema: 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.
+ ResponseSchema *Schema `json:"responseSchema,omitempty"`
+ // StopSequences: 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.
+ StopSequences []string `json:"stopSequences,omitempty"`
+ // Temperature: 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].
+ Temperature float64 `json:"temperature,omitempty"`
+ // TopK: 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.
+ TopK int64 `json:"topK,omitempty"`
+ // TopP: 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.
+ TopP float64 `json:"topP,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CandidateCount") 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. "CandidateCount") 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 *GenerationConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod GenerationConfig
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *GenerationConfig) UnmarshalJSON(data []byte) error {
+ type NoMethod GenerationConfig
+ var s1 struct {
+ 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.Temperature = float64(s1.Temperature)
+ s.TopP = float64(s1.TopP)
+ return nil
+}
+
+// GroundingAttribution: Attribution for a source that contributed to an
+// answer.
+type GroundingAttribution struct {
+ // Content: Grounding source content that makes up this attribution.
+ Content *Content `json:"content,omitempty"`
+ // SourceId: Output only. Identifier for the source contributing to this
+ // attribution.
+ SourceId *AttributionSourceId `json:"sourceId,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Content") 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. "Content") 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 *GroundingAttribution) MarshalJSON() ([]byte, error) {
+ type NoMethod GroundingAttribution
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GroundingPassage: Passage included inline with a grounding configuration.
+type GroundingPassage struct {
+ // Content: Content of the passage.
+ Content *Content `json:"content,omitempty"`
+ // Id: Identifier for the passage for attributing this passage in grounded
+ // answers.
+ Id string `json:"id,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Content") 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. "Content") 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 *GroundingPassage) MarshalJSON() ([]byte, error) {
+ type NoMethod GroundingPassage
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GroundingPassageId: Identifier for a part within a `GroundingPassage`.
+type GroundingPassageId struct {
+ // PartIndex: Output only. Index of the part within the
+ // `GenerateAnswerRequest`'s `GroundingPassage.content`.
+ PartIndex int64 `json:"partIndex,omitempty"`
+ // PassageId: Output only. ID of the passage matching the
+ // `GenerateAnswerRequest`'s `GroundingPassage.id`.
+ PassageId string `json:"passageId,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "PartIndex") 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. "PartIndex") 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 *GroundingPassageId) MarshalJSON() ([]byte, error) {
+ type NoMethod GroundingPassageId
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// GroundingPassages: A repeated list of passages.
+type GroundingPassages struct {
+ // Passages: List of passages.
+ Passages []*GroundingPassage `json:"passages,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Passages") 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. "Passages") 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 *GroundingPassages) MarshalJSON() ([]byte, error) {
+ type NoMethod GroundingPassages
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Hyperparameters: Hyperparameters controlling the tuning process. Read more
+// at https://ai.google.dev/docs/model_tuning_guidance
+type Hyperparameters struct {
+ // BatchSize: 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.
+ BatchSize int64 `json:"batchSize,omitempty"`
+ // EpochCount: 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.
+ EpochCount int64 `json:"epochCount,omitempty"`
+ // LearningRate: 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.
+ LearningRate float64 `json:"learningRate,omitempty"`
+ // LearningRateMultiplier: 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.
+ LearningRateMultiplier float64 `json:"learningRateMultiplier,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "BatchSize") 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. "BatchSize") 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 *Hyperparameters) MarshalJSON() ([]byte, error) {
+ type NoMethod Hyperparameters
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *Hyperparameters) UnmarshalJSON(data []byte) error {
+ type NoMethod Hyperparameters
+ var s1 struct {
+ LearningRate gensupport.JSONFloat64 `json:"learningRate"`
+ LearningRateMultiplier gensupport.JSONFloat64 `json:"learningRateMultiplier"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.LearningRate = float64(s1.LearningRate)
+ s.LearningRateMultiplier = float64(s1.LearningRateMultiplier)
+ return nil
+}
+
+// InputFeedback: Feedback related to the input data used to answer the
+// question, as opposed to model-generated response to the question.
+type InputFeedback struct {
+ // BlockReason: Optional. If set, the input was blocked and no candidates are
+ // returned. Rephrase your input.
+ //
+ // Possible values:
+ // "BLOCK_REASON_UNSPECIFIED" - Default value. This value is unused.
+ // "SAFETY" - Input was blocked due to safety reasons. You can inspect
+ // `safety_ratings` to understand which safety category blocked it.
+ // "OTHER" - Input was blocked due to other reasons.
+ BlockReason string `json:"blockReason,omitempty"`
+ // SafetyRatings: Ratings for safety of the input. There is at most one rating
+ // per category.
+ SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "BlockReason") 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. "BlockReason") 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 *InputFeedback) MarshalJSON() ([]byte, error) {
+ type NoMethod InputFeedback
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ListChunksResponse: Response from `ListChunks` containing a paginated list
+// of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`.
+type ListChunksResponse struct {
+ // Chunks: The returned `Chunk`s.
+ Chunks []*Chunk `json:"chunks,omitempty"`
+ // NextPageToken: A token, which can be sent as `page_token` to retrieve the
+ // next page. If this field is omitted, there are no more 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. "Chunks") 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. "Chunks") 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 *ListChunksResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListChunksResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ListCorporaResponse: Response from `ListCorpora` containing a paginated list
+// of `Corpora`. The results are sorted by ascending `corpus.create_time`.
+type ListCorporaResponse struct {
+ // Corpora: The returned corpora.
+ Corpora []*Corpus `json:"corpora,omitempty"`
+ // NextPageToken: A token, which can be sent as `page_token` to retrieve the
+ // next page. If this field is omitted, there are no more 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. "Corpora") 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. "Corpora") 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 *ListCorporaResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListCorporaResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ListDocumentsResponse: Response from `ListDocuments` containing a paginated
+// list of `Document`s. The `Document`s are sorted by ascending
+// `document.create_time`.
+type ListDocumentsResponse struct {
+ // Documents: The returned `Document`s.
+ Documents []*Document `json:"documents,omitempty"`
+ // NextPageToken: A token, which can be sent as `page_token` to retrieve the
+ // next page. If this field is omitted, there are no more 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. "Documents") 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. "Documents") 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 *ListDocumentsResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListDocumentsResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ListFilesResponse: Response for `ListFiles`.
+type ListFilesResponse struct {
+ // Files: The list of `File`s.
+ Files []*File `json:"files,omitempty"`
+ // NextPageToken: A token that can be sent as a `page_token` into a subsequent
+ // `ListFiles` call.
+ 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. "Files") 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. "Files") 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 *ListFilesResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListFilesResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ListModelsResponse: Response from `ListModel` containing a paginated list of
+// Models.
+type ListModelsResponse struct {
+ // Models: The returned Models.
+ Models []*Model `json:"models,omitempty"`
+ // NextPageToken: A token, which can be sent as `page_token` to retrieve the
+ // next page. If this field is omitted, there are no more 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. "Models") 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. "Models") 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 *ListModelsResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListModelsResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ListPermissionsResponse: Response from `ListPermissions` containing a
+// paginated list of permissions.
+type ListPermissionsResponse struct {
+ // NextPageToken: A token, which can be sent as `page_token` to retrieve the
+ // next page. If this field is omitted, there are no more pages.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // Permissions: Returned permissions.
+ Permissions []*Permission `json:"permissions,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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 *ListPermissionsResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListPermissionsResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ListTunedModelsResponse: Response from `ListTunedModels` containing a
+// paginated list of Models.
+type ListTunedModelsResponse struct {
+ // NextPageToken: A token, which can be sent as `page_token` to retrieve the
+ // next page. If this field is omitted, there are no more pages.
+ NextPageToken string `json:"nextPageToken,omitempty"`
+ // TunedModels: The returned Models.
+ TunedModels []*TunedModel `json:"tunedModels,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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 *ListTunedModelsResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod ListTunedModelsResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Message: 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 Message struct {
+ // Author: 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.
+ Author string `json:"author,omitempty"`
+ // CitationMetadata: 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.
+ CitationMetadata *CitationMetadata `json:"citationMetadata,omitempty"`
+ // Content: Required. The text content of the structured `Message`.
+ Content string `json:"content,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Author") 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. "Author") 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 *Message) MarshalJSON() ([]byte, error) {
+ type NoMethod Message
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// MessagePrompt: 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.
+type MessagePrompt struct {
+ // Context: 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.
+ Context string `json:"context,omitempty"`
+ // Examples: 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`.
+ Examples []*Example `json:"examples,omitempty"`
+ // Messages: Required. A snapshot of the recent conversation history sorted
+ // chronologically. Turns alternate between two authors. If the total input
+ // size exceeds the model's `input_token_limit` the input will be truncated:
+ // The oldest items will be dropped from `messages`.
+ Messages []*Message `json:"messages,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Context") 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. "Context") 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 *MessagePrompt) MarshalJSON() ([]byte, error) {
+ type NoMethod MessagePrompt
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// MetadataFilter: 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 MetadataFilter struct {
+ // Conditions: Required. The `Condition`s for the given key that will trigger
+ // this filter. Multiple `Condition`s are joined by logical ORs.
+ Conditions []*Condition `json:"conditions,omitempty"`
+ // Key: Required. The key of the metadata to filter on.
+ Key string `json:"key,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Conditions") 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. "Conditions") 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 *MetadataFilter) MarshalJSON() ([]byte, error) {
+ type NoMethod MetadataFilter
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Model: Information about a Generative Language Model.
+type Model struct {
+ // BaseModelId: Required. The name of the base model, pass this to the
+ // generation request. Examples: * `chat-bison`
+ BaseModelId string `json:"baseModelId,omitempty"`
+ // Description: A short description of the model.
+ Description string `json:"description,omitempty"`
+ // DisplayName: 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.
+ DisplayName string `json:"displayName,omitempty"`
+ // InputTokenLimit: Maximum number of input tokens allowed for this model.
+ InputTokenLimit int64 `json:"inputTokenLimit,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`
+ Name string `json:"name,omitempty"`
+ // OutputTokenLimit: Maximum number of output tokens available for this model.
+ OutputTokenLimit int64 `json:"outputTokenLimit,omitempty"`
+ // SupportedGenerationMethods: The model's supported generation methods. The
+ // method names are defined as Pascal case strings, such as `generateMessage`
+ // 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.
+ 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
+ // 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.
+ TopK int64 `json:"topK,omitempty"`
+ // TopP: 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.
+ TopP float64 `json:"topP,omitempty"`
+ // Version: Required. The version number of the model. This represents the
+ // major version
+ Version string `json:"version,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "BaseModelId") 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. "BaseModelId") 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 *Model) MarshalJSON() ([]byte, error) {
+ type NoMethod Model
+ 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"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.Temperature = float64(s1.Temperature)
+ s.TopP = float64(s1.TopP)
+ return nil
+}
+
+// Operation: This resource represents a long-running operation that is the
+// result of a network API call.
+type Operation struct {
+ // Done: 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.
+ Done bool `json:"done,omitempty"`
+ // Error: The error result of the operation in case of failure or cancellation.
+ Error *Status `json:"error,omitempty"`
+ // Metadata: 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.
+ Metadata googleapi.RawMessage `json:"metadata,omitempty"`
+ // Name: 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}`.
+ Name string `json:"name,omitempty"`
+ // Response: 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`.
+ Response googleapi.RawMessage `json:"response,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "Done") 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. "Done") 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 *Operation) MarshalJSON() ([]byte, error) {
+ type NoMethod Operation
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Part: 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.
+type Part struct {
+ // FileData: URI based data.
+ FileData *FileData `json:"fileData,omitempty"`
+ // FunctionCall: A predicted `FunctionCall` returned from the model that
+ // contains a string representing the `FunctionDeclaration.name` with the
+ // arguments and their values.
+ FunctionCall *FunctionCall `json:"functionCall,omitempty"`
+ // FunctionResponse: 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.
+ FunctionResponse *FunctionResponse `json:"functionResponse,omitempty"`
+ // InlineData: Inline media bytes.
+ InlineData *Blob `json:"inlineData,omitempty"`
+ // Text: Inline text.
+ Text string `json:"text,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "FileData") 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
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s *Part) MarshalJSON() ([]byte, error) {
+ type NoMethod Part
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Permission: 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 Permission struct {
+ // EmailAddress: 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.
+ EmailAddress string `json:"emailAddress,omitempty"`
+ // GranteeType: Optional. Immutable. The type of the grantee.
+ //
+ // Possible values:
+ // "GRANTEE_TYPE_UNSPECIFIED" - The default value. This value is unused.
+ // "USER" - Represents a user. When set, you must provide email_address for
+ // the user.
+ // "GROUP" - Represents a group. When set, you must provide email_address for
+ // the group.
+ // "EVERYONE" - Represents access to everyone. No extra information is
+ // required.
+ GranteeType string `json:"granteeType,omitempty"`
+ // Name: 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.
+ Name string `json:"name,omitempty"`
+ // Role: Required. The role granted by this permission.
+ //
+ // Possible values:
+ // "ROLE_UNSPECIFIED" - The default value. This value is unused.
+ // "OWNER" - Owner can use, update, share and delete the resource.
+ // "WRITER" - Writer can use, update and share the resource.
+ // "READER" - Reader can use the resource.
+ Role string `json:"role,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "EmailAddress") 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. "EmailAddress") 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 *Permission) MarshalJSON() ([]byte, error) {
+ type NoMethod Permission
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// PromptFeedback: A set of the feedback metadata the prompt specified in
+// `GenerateContentRequest.content`.
+type PromptFeedback struct {
+ // BlockReason: Optional. If set, the prompt was blocked and no candidates are
+ // returned. Rephrase your prompt.
+ //
+ // Possible values:
+ // "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.
+ BlockReason string `json:"blockReason,omitempty"`
+ // SafetyRatings: Ratings for safety of the prompt. There is at most one rating
+ // per category.
+ SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "BlockReason") 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. "BlockReason") 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 *PromptFeedback) MarshalJSON() ([]byte, error) {
+ type NoMethod PromptFeedback
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// QueryCorpusRequest: Request for querying a `Corpus`.
+type QueryCorpusRequest struct {
+ // MetadataFilters: 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 >= 2020 OR year < 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 > 2015 AND year <=
+ // 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.
+ MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
+ // Query: Required. Query string to perform semantic search.
+ Query string `json:"query,omitempty"`
+ // ResultsCount: 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.
+ ResultsCount int64 `json:"resultsCount,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "MetadataFilters") 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. "MetadataFilters") 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 *QueryCorpusRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod QueryCorpusRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// QueryCorpusResponse: Response from `QueryCorpus` containing a list of
+// relevant chunks.
+type QueryCorpusResponse struct {
+ // RelevantChunks: The relevant chunks.
+ RelevantChunks []*RelevantChunk `json:"relevantChunks,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "RelevantChunks") 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. "RelevantChunks") 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 *QueryCorpusResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod QueryCorpusResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// QueryDocumentRequest: Request for querying a `Document`.
+type QueryDocumentRequest struct {
+ // MetadataFilters: 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 >= 2020 OR year <
+ // 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 > 2015 AND year <= 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.
+ MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
+ // Query: Required. Query string to perform semantic search.
+ Query string `json:"query,omitempty"`
+ // ResultsCount: 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.
+ ResultsCount int64 `json:"resultsCount,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "MetadataFilters") 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. "MetadataFilters") 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 *QueryDocumentRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod QueryDocumentRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// QueryDocumentResponse: Response from `QueryDocument` containing a list of
+// relevant chunks.
+type QueryDocumentResponse struct {
+ // RelevantChunks: The returned relevant chunks.
+ RelevantChunks []*RelevantChunk `json:"relevantChunks,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "RelevantChunks") 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. "RelevantChunks") 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 *QueryDocumentResponse) MarshalJSON() ([]byte, error) {
+ type NoMethod QueryDocumentResponse
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// RelevantChunk: The information for a chunk relevant to a query.
+type RelevantChunk struct {
+ // Chunk: `Chunk` associated with the query.
+ Chunk *Chunk `json:"chunk,omitempty"`
+ // ChunkRelevanceScore: `Chunk` relevance to the query.
+ ChunkRelevanceScore float64 `json:"chunkRelevanceScore,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Chunk") 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. "Chunk") 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 *RelevantChunk) MarshalJSON() ([]byte, error) {
+ type NoMethod RelevantChunk
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *RelevantChunk) UnmarshalJSON(data []byte) error {
+ type NoMethod RelevantChunk
+ var s1 struct {
+ ChunkRelevanceScore gensupport.JSONFloat64 `json:"chunkRelevanceScore"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.ChunkRelevanceScore = float64(s1.ChunkRelevanceScore)
+ return nil
+}
+
+// SafetyFeedback: 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.
+type SafetyFeedback struct {
+ // Rating: Safety rating evaluated from content.
+ Rating *SafetyRating `json:"rating,omitempty"`
+ // Setting: Safety settings applied to the request.
+ Setting *SafetySetting `json:"setting,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Rating") 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. "Rating") 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 *SafetyFeedback) MarshalJSON() ([]byte, error) {
+ type NoMethod SafetyFeedback
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// SafetyRating: 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.
+type SafetyRating struct {
+ // Blocked: Was this content blocked because of this rating?
+ Blocked bool `json:"blocked,omitempty"`
+ // Category: Required. The category for this rating.
+ //
+ // Possible values:
+ // "HARM_CATEGORY_UNSPECIFIED" - Category is unspecified.
+ // "HARM_CATEGORY_DEROGATORY" - Negative or harmful comments targeting
+ // identity and/or protected attribute.
+ // "HARM_CATEGORY_TOXICITY" - Content that is rude, disrespectful, or
+ // profane.
+ // "HARM_CATEGORY_VIOLENCE" - Describes scenarios depicting violence against
+ // an individual or group, or general descriptions of gore.
+ // "HARM_CATEGORY_SEXUAL" - Contains references to sexual acts or other lewd
+ // content.
+ // "HARM_CATEGORY_MEDICAL" - Promotes unchecked medical advice.
+ // "HARM_CATEGORY_DANGEROUS" - Dangerous content that promotes, facilitates,
+ // or encourages harmful acts.
+ // "HARM_CATEGORY_HARASSMENT" - Harasment content.
+ // "HARM_CATEGORY_HATE_SPEECH" - Hate speech and content.
+ // "HARM_CATEGORY_SEXUALLY_EXPLICIT" - Sexually explicit content.
+ // "HARM_CATEGORY_DANGEROUS_CONTENT" - Dangerous content.
+ Category string `json:"category,omitempty"`
+ // Probability: Required. The probability of harm for this content.
+ //
+ // Possible values:
+ // "HARM_PROBABILITY_UNSPECIFIED" - Probability is unspecified.
+ // "NEGLIGIBLE" - Content has a negligible chance of being unsafe.
+ // "LOW" - Content has a low chance of being unsafe.
+ // "MEDIUM" - Content has a medium chance of being unsafe.
+ // "HIGH" - Content has a high chance of being unsafe.
+ Probability string `json:"probability,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Blocked") 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. "Blocked") 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 *SafetyRating) MarshalJSON() ([]byte, error) {
+ type NoMethod SafetyRating
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// SafetySetting: Safety setting, affecting the safety-blocking behavior.
+// Passing a safety setting for a category changes the allowed probability that
+// content is blocked.
+type SafetySetting struct {
+ // Category: Required. The category for this setting.
+ //
+ // Possible values:
+ // "HARM_CATEGORY_UNSPECIFIED" - Category is unspecified.
+ // "HARM_CATEGORY_DEROGATORY" - Negative or harmful comments targeting
+ // identity and/or protected attribute.
+ // "HARM_CATEGORY_TOXICITY" - Content that is rude, disrespectful, or
+ // profane.
+ // "HARM_CATEGORY_VIOLENCE" - Describes scenarios depicting violence against
+ // an individual or group, or general descriptions of gore.
+ // "HARM_CATEGORY_SEXUAL" - Contains references to sexual acts or other lewd
+ // content.
+ // "HARM_CATEGORY_MEDICAL" - Promotes unchecked medical advice.
+ // "HARM_CATEGORY_DANGEROUS" - Dangerous content that promotes, facilitates,
+ // or encourages harmful acts.
+ // "HARM_CATEGORY_HARASSMENT" - Harasment content.
+ // "HARM_CATEGORY_HATE_SPEECH" - Hate speech and content.
+ // "HARM_CATEGORY_SEXUALLY_EXPLICIT" - Sexually explicit content.
+ // "HARM_CATEGORY_DANGEROUS_CONTENT" - Dangerous content.
+ Category string `json:"category,omitempty"`
+ // Threshold: Required. Controls the probability threshold at which harm is
+ // blocked.
+ //
+ // Possible values:
+ // "HARM_BLOCK_THRESHOLD_UNSPECIFIED" - Threshold is unspecified.
+ // "BLOCK_LOW_AND_ABOVE" - Content with NEGLIGIBLE will be allowed.
+ // "BLOCK_MEDIUM_AND_ABOVE" - Content with NEGLIGIBLE and LOW will be
+ // allowed.
+ // "BLOCK_ONLY_HIGH" - Content with NEGLIGIBLE, LOW, and MEDIUM will be
+ // allowed.
+ // "BLOCK_NONE" - All content will be allowed.
+ Threshold string `json:"threshold,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Category") 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. "Category") 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 *SafetySetting) MarshalJSON() ([]byte, error) {
+ type NoMethod SafetySetting
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Schema: 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).
+type Schema struct {
+ // Description: Optional. A brief description of the parameter. This could
+ // contain examples of use. Parameter description may be formatted as Markdown.
+ Description string `json:"description,omitempty"`
+ // Enum: 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"]}
+ 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
+ Format string `json:"format,omitempty"`
+ // Items: Optional. Schema of the elements of Type.ARRAY.
+ Items *Schema `json:"items,omitempty"`
+ // Nullable: Optional. Indicates if the value may be null.
+ Nullable bool `json:"nullable,omitempty"`
+ // Properties: Optional. Properties of Type.OBJECT.
+ Properties map[string]Schema `json:"properties,omitempty"`
+ // Required: Optional. Required properties of Type.OBJECT.
+ Required []string `json:"required,omitempty"`
+ // Type: Required. Data type.
+ //
+ // Possible values:
+ // "TYPE_UNSPECIFIED" - Not specified, should not be used.
+ // "STRING" - String type.
+ // "NUMBER" - Number type.
+ // "INTEGER" - Integer type.
+ // "BOOLEAN" - Boolean type.
+ // "ARRAY" - Array type.
+ // "OBJECT" - Object type.
+ Type string `json:"type,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Description") 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. "Description") 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 *Schema) MarshalJSON() ([]byte, error) {
+ type NoMethod Schema
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// SemanticRetrieverChunk: Identifier for a `Chunk` retrieved via Semantic
+// Retriever specified in the `GenerateAnswerRequest` using
+// `SemanticRetrieverConfig`.
+type SemanticRetrieverChunk struct {
+ // Chunk: Output only. Name of the `Chunk` containing the attributed text.
+ // Example: `corpora/123/documents/abc/chunks/xyz`
+ Chunk string `json:"chunk,omitempty"`
+ // Source: Output only. Name of the source matching the request's
+ // `SemanticRetrieverConfig.source`. Example: `corpora/123` or
+ // `corpora/123/documents/abc`
+ Source string `json:"source,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Chunk") 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. "Chunk") 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 *SemanticRetrieverChunk) MarshalJSON() ([]byte, error) {
+ type NoMethod SemanticRetrieverChunk
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// SemanticRetrieverConfig: Configuration for retrieving grounding content from
+// a `Corpus` or `Document` created using the Semantic Retriever API.
+type SemanticRetrieverConfig struct {
+ // MaxChunksCount: Optional. Maximum number of relevant `Chunk`s to retrieve.
+ MaxChunksCount int64 `json:"maxChunksCount,omitempty"`
+ // MetadataFilters: Optional. Filters for selecting `Document`s and/or `Chunk`s
+ // from the resource.
+ MetadataFilters []*MetadataFilter `json:"metadataFilters,omitempty"`
+ // MinimumRelevanceScore: Optional. Minimum relevance score for retrieved
+ // relevant `Chunk`s.
+ MinimumRelevanceScore float64 `json:"minimumRelevanceScore,omitempty"`
+ // Query: Required. Query to use for similarity matching `Chunk`s in the given
+ // resource.
+ Query *Content `json:"query,omitempty"`
+ // Source: Required. Name of the resource for retrieval, e.g. corpora/123 or
+ // corpora/123/documents/abc.
+ Source string `json:"source,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "MaxChunksCount") 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. "MaxChunksCount") 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 *SemanticRetrieverConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod SemanticRetrieverConfig
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *SemanticRetrieverConfig) UnmarshalJSON(data []byte) error {
+ type NoMethod SemanticRetrieverConfig
+ var s1 struct {
+ MinimumRelevanceScore gensupport.JSONFloat64 `json:"minimumRelevanceScore"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.MinimumRelevanceScore = float64(s1.MinimumRelevanceScore)
+ return nil
+}
+
+// Status: 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 Status struct {
+ // Code: The status code, which should be an enum value of google.rpc.Code.
+ Code int64 `json:"code,omitempty"`
+ // Details: A list of messages that carry the error details. There is a common
+ // set of message types for APIs to use.
+ Details []googleapi.RawMessage `json:"details,omitempty"`
+ // Message: 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.
+ Message string `json:"message,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 *Status) MarshalJSON() ([]byte, error) {
+ type NoMethod Status
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// StringList: User provided string values assigned to a single metadata key.
+type StringList struct {
+ // Values: The string values of the metadata to store.
+ Values []string `json:"values,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Values") 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. "Values") 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 *StringList) MarshalJSON() ([]byte, error) {
+ type NoMethod StringList
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// TextCompletion: Output text returned from a model.
+type TextCompletion struct {
+ // CitationMetadata: 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`.
+ CitationMetadata *CitationMetadata `json:"citationMetadata,omitempty"`
+ // Output: Output only. The generated text returned from the model.
+ Output string `json:"output,omitempty"`
+ // SafetyRatings: Ratings for the safety of a response. There is at most one
+ // rating per category.
+ SafetyRatings []*SafetyRating `json:"safetyRatings,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CitationMetadata") 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. "CitationMetadata") 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 *TextCompletion) MarshalJSON() ([]byte, error) {
+ type NoMethod TextCompletion
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// TextPrompt: Text given to the model as a prompt. The Model will use this
+// TextPrompt to Generate a text completion.
+type TextPrompt struct {
+ // Text: Required. The prompt text.
+ Text string `json:"text,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Text") 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. "Text") 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 *TextPrompt) MarshalJSON() ([]byte, error) {
+ type NoMethod TextPrompt
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// Tool: 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 Tool struct {
+ // 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
+ // 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.
+ FunctionDeclarations []*FunctionDeclaration `json:"functionDeclarations,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "FunctionDeclarations") 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
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s *Tool) MarshalJSON() ([]byte, error) {
+ type NoMethod Tool
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// ToolConfig: The Tool configuration containing parameters for specifying
+// `Tool` use in the request.
+type ToolConfig struct {
+ // FunctionCallingConfig: Optional. Function calling config.
+ FunctionCallingConfig *FunctionCallingConfig `json:"functionCallingConfig,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "FunctionCallingConfig") 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. "FunctionCallingConfig") 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 *ToolConfig) MarshalJSON() ([]byte, error) {
+ type NoMethod ToolConfig
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// TransferOwnershipRequest: Request to transfer the ownership of the tuned
+// model.
+type TransferOwnershipRequest struct {
+ // EmailAddress: Required. The email address of the user to whom the tuned
+ // model is being transferred to.
+ EmailAddress string `json:"emailAddress,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "EmailAddress") 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. "EmailAddress") 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 *TransferOwnershipRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod TransferOwnershipRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// TransferOwnershipResponse: Response from `TransferOwnership`.
+type TransferOwnershipResponse struct {
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+}
+
+// TunedModel: A fine-tuned model created using ModelService.CreateTunedModel.
+type TunedModel struct {
+ // BaseModel: Immutable. The name of the `Model` to tune. Example:
+ // `models/text-bison-001`
+ BaseModel string `json:"baseModel,omitempty"`
+ // CreateTime: Output only. The timestamp when this model was created.
+ CreateTime string `json:"createTime,omitempty"`
+ // Description: Optional. A short description of this model.
+ Description string `json:"description,omitempty"`
+ // DisplayName: Optional. The name to display for this model in user
+ // interfaces. The display name must be up to 40 characters including spaces.
+ DisplayName string `json:"displayName,omitempty"`
+ // Name: 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"
+ Name string `json:"name,omitempty"`
+ // State: Output only. The state of the tuned model.
+ //
+ // Possible values:
+ // "STATE_UNSPECIFIED" - The default value. This value is unused.
+ // "CREATING" - The model is being created.
+ // "ACTIVE" - The model is ready to be used.
+ // "FAILED" - The model failed to be created.
+ State string `json:"state,omitempty"`
+ // Temperature: 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.
+ Temperature float64 `json:"temperature,omitempty"`
+ // TopK: 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.
+ TopK int64 `json:"topK,omitempty"`
+ // TopP: 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.
+ TopP float64 `json:"topP,omitempty"`
+ // TunedModelSource: Optional. TunedModel to use as the starting point for
+ // training the new model.
+ TunedModelSource *TunedModelSource `json:"tunedModelSource,omitempty"`
+ // TuningTask: Required. The tuning task that creates the tuned model.
+ TuningTask *TuningTask `json:"tuningTask,omitempty"`
+ // UpdateTime: Output only. The timestamp when this model was updated.
+ UpdateTime string `json:"updateTime,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the server.
+ googleapi.ServerResponse `json:"-"`
+ // ForceSendFields is a list of field names (e.g. "BaseModel") 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. "BaseModel") 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 *TunedModel) MarshalJSON() ([]byte, error) {
+ type NoMethod TunedModel
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *TunedModel) UnmarshalJSON(data []byte) error {
+ type NoMethod TunedModel
+ var s1 struct {
+ 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.Temperature = float64(s1.Temperature)
+ s.TopP = float64(s1.TopP)
+ return nil
+}
+
+// TunedModelSource: Tuned model as a source for training a new model.
+type TunedModelSource struct {
+ // BaseModel: Output only. The name of the base `Model` this `TunedModel` was
+ // tuned from. Example: `models/text-bison-001`
+ BaseModel string `json:"baseModel,omitempty"`
+ // TunedModel: Immutable. The name of the `TunedModel` to use as the starting
+ // point for training the new model. Example: `tunedModels/my-tuned-model`
+ TunedModel string `json:"tunedModel,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "BaseModel") 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. "BaseModel") 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 *TunedModelSource) MarshalJSON() ([]byte, error) {
+ type NoMethod TunedModelSource
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// TuningExample: A single example for tuning.
+type TuningExample struct {
+ // Output: Required. The expected model output.
+ Output string `json:"output,omitempty"`
+ // TextInput: Optional. Text model input.
+ TextInput string `json:"textInput,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Output") 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. "Output") 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 *TuningExample) MarshalJSON() ([]byte, error) {
+ type NoMethod TuningExample
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// TuningExamples: A set of tuning examples. Can be training or validation
+// data.
+type TuningExamples struct {
+ // Examples: Required. The examples. Example input can be for text or discuss,
+ // but all examples in a set must be of the same type.
+ Examples []*TuningExample `json:"examples,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Examples") 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. "Examples") 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 *TuningExamples) MarshalJSON() ([]byte, error) {
+ type NoMethod TuningExamples
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// TuningSnapshot: Record for a single tuning step.
+type TuningSnapshot struct {
+ // ComputeTime: Output only. The timestamp when this metric was computed.
+ ComputeTime string `json:"computeTime,omitempty"`
+ // Epoch: Output only. The epoch this step was part of.
+ Epoch int64 `json:"epoch,omitempty"`
+ // MeanLoss: Output only. The mean loss of the training examples for this step.
+ MeanLoss float64 `json:"meanLoss,omitempty"`
+ // Step: Output only. The tuning step.
+ Step int64 `json:"step,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "ComputeTime") 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. "ComputeTime") 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 *TuningSnapshot) MarshalJSON() ([]byte, error) {
+ type NoMethod TuningSnapshot
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+func (s *TuningSnapshot) UnmarshalJSON(data []byte) error {
+ type NoMethod TuningSnapshot
+ var s1 struct {
+ MeanLoss gensupport.JSONFloat64 `json:"meanLoss"`
+ *NoMethod
+ }
+ s1.NoMethod = (*NoMethod)(s)
+ if err := json.Unmarshal(data, &s1); err != nil {
+ return err
+ }
+ s.MeanLoss = float64(s1.MeanLoss)
+ return nil
+}
+
+// TuningTask: Tuning tasks that create tuned models.
+type TuningTask struct {
+ // CompleteTime: Output only. The timestamp when tuning this model completed.
+ CompleteTime string `json:"completeTime,omitempty"`
+ // Hyperparameters: Immutable. Hyperparameters controlling the tuning process.
+ // If not provided, default values will be used.
+ Hyperparameters *Hyperparameters `json:"hyperparameters,omitempty"`
+ // Snapshots: Output only. Metrics collected during tuning.
+ Snapshots []*TuningSnapshot `json:"snapshots,omitempty"`
+ // StartTime: Output only. The timestamp when tuning this model started.
+ StartTime string `json:"startTime,omitempty"`
+ // TrainingData: Required. Input only. Immutable. The model training data.
+ TrainingData *Dataset `json:"trainingData,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "CompleteTime") 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. "CompleteTime") 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 *TuningTask) MarshalJSON() ([]byte, error) {
+ type NoMethod TuningTask
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// UpdateChunkRequest: Request to update a `Chunk`.
+type UpdateChunkRequest struct {
+ // Chunk: Required. The `Chunk` to update.
+ Chunk *Chunk `json:"chunk,omitempty"`
+ // UpdateMask: Required. The list of fields to update. Currently, this only
+ // supports updating `custom_metadata` and `data`.
+ UpdateMask string `json:"updateMask,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "Chunk") 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. "Chunk") 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 *UpdateChunkRequest) MarshalJSON() ([]byte, error) {
+ type NoMethod UpdateChunkRequest
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// UsageMetadata: Metadata on the generation request's token usage.
+type UsageMetadata struct {
+ // CandidatesTokenCount: Total number of tokens across the generated
+ // candidates.
+ CandidatesTokenCount int64 `json:"candidatesTokenCount,omitempty"`
+ // PromptTokenCount: Number of tokens in the prompt.
+ 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
+ // 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
+ // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
+ NullFields []string `json:"-"`
+}
+
+func (s *UsageMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod UsageMetadata
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+// VideoMetadata: Metadata for a video `File`.
+type VideoMetadata struct {
+ // VideoDuration: Duration of the video.
+ VideoDuration string `json:"videoDuration,omitempty"`
+ // ForceSendFields is a list of field names (e.g. "VideoDuration") 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. "VideoDuration") 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 *VideoMetadata) MarshalJSON() ([]byte, error) {
+ type NoMethod VideoMetadata
+ return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
+}
+
+type CorporaCreateCall struct {
+ s *Service
+ corpus *Corpus
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: Creates an empty `Corpus`.
+func (r *CorporaService) Create(corpus *Corpus) *CorporaCreateCall {
+ c := &CorporaCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.corpus = corpus
+ 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 *CorporaCreateCall) Fields(s ...googleapi.Field) *CorporaCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaCreateCall) Context(ctx context.Context) *CorporaCreateCall {
+ 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 *CorporaCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaCreateCall) 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.corpus)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/corpora")
+ 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.corpora.create" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Corpus.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 *CorporaCreateCall) Do(opts ...googleapi.CallOption) (*Corpus, 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 := &Corpus{
+ 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 CorporaDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes a `Corpus`.
+//
+// - name: The resource name of the `Corpus`. Example: `corpora/my-corpus-123`.
+func (r *CorporaService) Delete(name string) *CorporaDeleteCall {
+ c := &CorporaDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ return c
+}
+
+// Force sets the optional parameter "force": 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.
+func (c *CorporaDeleteCall) Force(force bool) *CorporaDeleteCall {
+ c.urlParams_.Set("force", fmt.Sprint(force))
+ 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 *CorporaDeleteCall) Fields(s ...googleapi.Field) *CorporaDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDeleteCall) Context(ctx context.Context) *CorporaDeleteCall {
+ 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 *CorporaDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDeleteCall) 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.corpora.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 *CorporaDeleteCall) 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 CorporaGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets information about a specific `Corpus`.
+//
+// - name: The name of the `Corpus`. Example: `corpora/my-corpus-123`.
+func (r *CorporaService) Get(name string) *CorporaGetCall {
+ c := &CorporaGetCall{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 *CorporaGetCall) Fields(s ...googleapi.Field) *CorporaGetCall {
+ 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 *CorporaGetCall) IfNoneMatch(entityTag string) *CorporaGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaGetCall) Context(ctx context.Context) *CorporaGetCall {
+ 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 *CorporaGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaGetCall) 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.corpora.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Corpus.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 *CorporaGetCall) Do(opts ...googleapi.CallOption) (*Corpus, 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 := &Corpus{
+ 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 CorporaListCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists all `Corpora` owned by the user.
+func (r *CorporaService) List() *CorporaListCall {
+ c := &CorporaListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": 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.
+func (c *CorporaListCall) PageSize(pageSize int64) *CorporaListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": 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.
+func (c *CorporaListCall) PageToken(pageToken string) *CorporaListCall {
+ 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 *CorporaListCall) Fields(s ...googleapi.Field) *CorporaListCall {
+ 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 *CorporaListCall) IfNoneMatch(entityTag string) *CorporaListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaListCall) Context(ctx context.Context) *CorporaListCall {
+ 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 *CorporaListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaListCall) 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/corpora")
+ 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.corpora.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListCorporaResponse.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 *CorporaListCall) Do(opts ...googleapi.CallOption) (*ListCorporaResponse, 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 := &ListCorporaResponse{
+ 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 *CorporaListCall) Pages(ctx context.Context, f func(*ListCorporaResponse) 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 CorporaPatchCall struct {
+ s *Service
+ name string
+ corpus *Corpus
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates a `Corpus`.
+//
+// - name: 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`.
+func (r *CorporaService) Patch(name string, corpus *Corpus) *CorporaPatchCall {
+ c := &CorporaPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.corpus = corpus
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": Required. The list of
+// fields to update. Currently, this only supports updating `display_name`.
+func (c *CorporaPatchCall) UpdateMask(updateMask string) *CorporaPatchCall {
+ 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 *CorporaPatchCall) Fields(s ...googleapi.Field) *CorporaPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaPatchCall) Context(ctx context.Context) *CorporaPatchCall {
+ 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 *CorporaPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaPatchCall) 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.corpus)
+ 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.corpora.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Corpus.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 *CorporaPatchCall) Do(opts ...googleapi.CallOption) (*Corpus, 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 := &Corpus{
+ 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 CorporaQueryCall struct {
+ s *Service
+ name string
+ querycorpusrequest *QueryCorpusRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Query: Performs semantic search over a `Corpus`.
+//
+// - name: The name of the `Corpus` to query. Example: `corpora/my-corpus-123`.
+func (r *CorporaService) Query(name string, querycorpusrequest *QueryCorpusRequest) *CorporaQueryCall {
+ c := &CorporaQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.querycorpusrequest = querycorpusrequest
+ 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 *CorporaQueryCall) Fields(s ...googleapi.Field) *CorporaQueryCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaQueryCall) Context(ctx context.Context) *CorporaQueryCall {
+ 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 *CorporaQueryCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaQueryCall) 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.querycorpusrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:query")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", 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.corpora.query" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *QueryCorpusResponse.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 *CorporaQueryCall) Do(opts ...googleapi.CallOption) (*QueryCorpusResponse, 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 := &QueryCorpusResponse{
+ 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 CorporaDocumentsCreateCall struct {
+ s *Service
+ parent string
+ document *Document
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: Creates an empty `Document`.
+//
+// - parent: The name of the `Corpus` where this `Document` will be created.
+// Example: `corpora/my-corpus-123`.
+func (r *CorporaDocumentsService) Create(parent string, document *Document) *CorporaDocumentsCreateCall {
+ c := &CorporaDocumentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ c.document = document
+ 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 *CorporaDocumentsCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsCreateCall) Context(ctx context.Context) *CorporaDocumentsCreateCall {
+ 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 *CorporaDocumentsCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsCreateCall) 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.document)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/documents")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.documents.create" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Document.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 *CorporaDocumentsCreateCall) Do(opts ...googleapi.CallOption) (*Document, 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 := &Document{
+ 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 CorporaDocumentsDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes a `Document`.
+//
+// - name: The resource name of the `Document` to delete. Example:
+// `corpora/my-corpus-123/documents/the-doc-abc`.
+func (r *CorporaDocumentsService) Delete(name string) *CorporaDocumentsDeleteCall {
+ c := &CorporaDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ return c
+}
+
+// Force sets the optional parameter "force": 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.
+func (c *CorporaDocumentsDeleteCall) Force(force bool) *CorporaDocumentsDeleteCall {
+ c.urlParams_.Set("force", fmt.Sprint(force))
+ 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 *CorporaDocumentsDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsDeleteCall) Context(ctx context.Context) *CorporaDocumentsDeleteCall {
+ 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 *CorporaDocumentsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsDeleteCall) 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.corpora.documents.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 *CorporaDocumentsDeleteCall) 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 CorporaDocumentsGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets information about a specific `Document`.
+//
+// - name: The name of the `Document` to retrieve. Example:
+// `corpora/my-corpus-123/documents/the-doc-abc`.
+func (r *CorporaDocumentsService) Get(name string) *CorporaDocumentsGetCall {
+ c := &CorporaDocumentsGetCall{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 *CorporaDocumentsGetCall) Fields(s ...googleapi.Field) *CorporaDocumentsGetCall {
+ 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 *CorporaDocumentsGetCall) IfNoneMatch(entityTag string) *CorporaDocumentsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsGetCall) Context(ctx context.Context) *CorporaDocumentsGetCall {
+ 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 *CorporaDocumentsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsGetCall) 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.corpora.documents.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Document.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 *CorporaDocumentsGetCall) Do(opts ...googleapi.CallOption) (*Document, 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 := &Document{
+ 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 CorporaDocumentsListCall struct {
+ s *Service
+ parent string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists all `Document`s in a `Corpus`.
+//
+// - parent: The name of the `Corpus` containing `Document`s. Example:
+// `corpora/my-corpus-123`.
+func (r *CorporaDocumentsService) List(parent string) *CorporaDocumentsListCall {
+ c := &CorporaDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": 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.
+func (c *CorporaDocumentsListCall) PageSize(pageSize int64) *CorporaDocumentsListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": 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.
+func (c *CorporaDocumentsListCall) PageToken(pageToken string) *CorporaDocumentsListCall {
+ 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 *CorporaDocumentsListCall) Fields(s ...googleapi.Field) *CorporaDocumentsListCall {
+ 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 *CorporaDocumentsListCall) IfNoneMatch(entityTag string) *CorporaDocumentsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsListCall) Context(ctx context.Context) *CorporaDocumentsListCall {
+ 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 *CorporaDocumentsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsListCall) 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/{+parent}/documents")
+ 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{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.documents.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListDocumentsResponse.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 *CorporaDocumentsListCall) Do(opts ...googleapi.CallOption) (*ListDocumentsResponse, 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 := &ListDocumentsResponse{
+ 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 *CorporaDocumentsListCall) Pages(ctx context.Context, f func(*ListDocumentsResponse) 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 CorporaDocumentsPatchCall struct {
+ s *Service
+ name string
+ document *Document
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates a `Document`.
+//
+// - name: 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`.
+func (r *CorporaDocumentsService) Patch(name string, document *Document) *CorporaDocumentsPatchCall {
+ c := &CorporaDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.document = document
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": Required. The list of
+// fields to update. Currently, this only supports updating `display_name` and
+// `custom_metadata`.
+func (c *CorporaDocumentsPatchCall) UpdateMask(updateMask string) *CorporaDocumentsPatchCall {
+ 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 *CorporaDocumentsPatchCall) Fields(s ...googleapi.Field) *CorporaDocumentsPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsPatchCall) Context(ctx context.Context) *CorporaDocumentsPatchCall {
+ 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 *CorporaDocumentsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsPatchCall) 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.document)
+ 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.corpora.documents.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Document.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 *CorporaDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*Document, 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 := &Document{
+ 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 CorporaDocumentsQueryCall struct {
+ s *Service
+ name string
+ querydocumentrequest *QueryDocumentRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Query: Performs semantic search over a `Document`.
+//
+// - name: The name of the `Document` to query. Example:
+// `corpora/my-corpus-123/documents/the-doc-abc`.
+func (r *CorporaDocumentsService) Query(name string, querydocumentrequest *QueryDocumentRequest) *CorporaDocumentsQueryCall {
+ c := &CorporaDocumentsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.querydocumentrequest = querydocumentrequest
+ 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 *CorporaDocumentsQueryCall) Fields(s ...googleapi.Field) *CorporaDocumentsQueryCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsQueryCall) Context(ctx context.Context) *CorporaDocumentsQueryCall {
+ 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 *CorporaDocumentsQueryCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsQueryCall) 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.querydocumentrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:query")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", 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.corpora.documents.query" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *QueryDocumentResponse.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 *CorporaDocumentsQueryCall) Do(opts ...googleapi.CallOption) (*QueryDocumentResponse, 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 := &QueryDocumentResponse{
+ 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 CorporaDocumentsChunksBatchCreateCall struct {
+ s *Service
+ parent string
+ batchcreatechunksrequest *BatchCreateChunksRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// BatchCreate: Batch create `Chunk`s.
+//
+// - parent: 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`.
+func (r *CorporaDocumentsChunksService) BatchCreate(parent string, batchcreatechunksrequest *BatchCreateChunksRequest) *CorporaDocumentsChunksBatchCreateCall {
+ c := &CorporaDocumentsChunksBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ c.batchcreatechunksrequest = batchcreatechunksrequest
+ 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 *CorporaDocumentsChunksBatchCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksBatchCreateCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchCreateCall {
+ 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 *CorporaDocumentsChunksBatchCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksBatchCreateCall) 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.batchcreatechunksrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/chunks:batchCreate")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.documents.chunks.batchCreate" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BatchCreateChunksResponse.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 *CorporaDocumentsChunksBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateChunksResponse, 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 := &BatchCreateChunksResponse{
+ 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 CorporaDocumentsChunksBatchDeleteCall struct {
+ s *Service
+ parent string
+ batchdeletechunksrequest *BatchDeleteChunksRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// BatchDelete: Batch delete `Chunk`s.
+//
+// - parent: 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`.
+func (r *CorporaDocumentsChunksService) BatchDelete(parent string, batchdeletechunksrequest *BatchDeleteChunksRequest) *CorporaDocumentsChunksBatchDeleteCall {
+ c := &CorporaDocumentsChunksBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ c.batchdeletechunksrequest = batchdeletechunksrequest
+ 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 *CorporaDocumentsChunksBatchDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksBatchDeleteCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchDeleteCall {
+ 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 *CorporaDocumentsChunksBatchDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksBatchDeleteCall) 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.batchdeletechunksrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/chunks:batchDelete")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.documents.chunks.batchDelete" 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 *CorporaDocumentsChunksBatchDeleteCall) 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 CorporaDocumentsChunksBatchUpdateCall struct {
+ s *Service
+ parent string
+ batchupdatechunksrequest *BatchUpdateChunksRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// BatchUpdate: Batch update `Chunk`s.
+//
+// - parent: 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`.
+func (r *CorporaDocumentsChunksService) BatchUpdate(parent string, batchupdatechunksrequest *BatchUpdateChunksRequest) *CorporaDocumentsChunksBatchUpdateCall {
+ c := &CorporaDocumentsChunksBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ c.batchupdatechunksrequest = batchupdatechunksrequest
+ 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 *CorporaDocumentsChunksBatchUpdateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksBatchUpdateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksBatchUpdateCall) Context(ctx context.Context) *CorporaDocumentsChunksBatchUpdateCall {
+ 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 *CorporaDocumentsChunksBatchUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksBatchUpdateCall) 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.batchupdatechunksrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/chunks:batchUpdate")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.documents.chunks.batchUpdate" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BatchUpdateChunksResponse.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 *CorporaDocumentsChunksBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateChunksResponse, 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 := &BatchUpdateChunksResponse{
+ 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 CorporaDocumentsChunksCreateCall struct {
+ s *Service
+ parent string
+ chunk *Chunk
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: Creates a `Chunk`.
+//
+// - parent: The name of the `Document` where this `Chunk` will be created.
+// Example: `corpora/my-corpus-123/documents/the-doc-abc`.
+func (r *CorporaDocumentsChunksService) Create(parent string, chunk *Chunk) *CorporaDocumentsChunksCreateCall {
+ c := &CorporaDocumentsChunksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ c.chunk = chunk
+ 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 *CorporaDocumentsChunksCreateCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksCreateCall) Context(ctx context.Context) *CorporaDocumentsChunksCreateCall {
+ 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 *CorporaDocumentsChunksCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksCreateCall) 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.chunk)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/chunks")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.documents.chunks.create" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Chunk.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 *CorporaDocumentsChunksCreateCall) Do(opts ...googleapi.CallOption) (*Chunk, 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 := &Chunk{
+ 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 CorporaDocumentsChunksDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes a `Chunk`.
+//
+// - name: The resource name of the `Chunk` to delete. Example:
+// `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`.
+func (r *CorporaDocumentsChunksService) Delete(name string) *CorporaDocumentsChunksDeleteCall {
+ c := &CorporaDocumentsChunksDeleteCall{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 *CorporaDocumentsChunksDeleteCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksDeleteCall) Context(ctx context.Context) *CorporaDocumentsChunksDeleteCall {
+ 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 *CorporaDocumentsChunksDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksDeleteCall) 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.corpora.documents.chunks.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 *CorporaDocumentsChunksDeleteCall) 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 CorporaDocumentsChunksGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets information about a specific `Chunk`.
+//
+// - name: The name of the `Chunk` to retrieve. Example:
+// `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`.
+func (r *CorporaDocumentsChunksService) Get(name string) *CorporaDocumentsChunksGetCall {
+ c := &CorporaDocumentsChunksGetCall{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 *CorporaDocumentsChunksGetCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksGetCall {
+ 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 *CorporaDocumentsChunksGetCall) IfNoneMatch(entityTag string) *CorporaDocumentsChunksGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksGetCall) Context(ctx context.Context) *CorporaDocumentsChunksGetCall {
+ 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 *CorporaDocumentsChunksGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksGetCall) 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.corpora.documents.chunks.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Chunk.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 *CorporaDocumentsChunksGetCall) Do(opts ...googleapi.CallOption) (*Chunk, 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 := &Chunk{
+ 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 CorporaDocumentsChunksListCall struct {
+ s *Service
+ parent string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists all `Chunk`s in a `Document`.
+//
+// - parent: The name of the `Document` containing `Chunk`s. Example:
+// `corpora/my-corpus-123/documents/the-doc-abc`.
+func (r *CorporaDocumentsChunksService) List(parent string) *CorporaDocumentsChunksListCall {
+ c := &CorporaDocumentsChunksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": 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.
+func (c *CorporaDocumentsChunksListCall) PageSize(pageSize int64) *CorporaDocumentsChunksListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": 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.
+func (c *CorporaDocumentsChunksListCall) PageToken(pageToken string) *CorporaDocumentsChunksListCall {
+ 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 *CorporaDocumentsChunksListCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksListCall {
+ 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 *CorporaDocumentsChunksListCall) IfNoneMatch(entityTag string) *CorporaDocumentsChunksListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksListCall) Context(ctx context.Context) *CorporaDocumentsChunksListCall {
+ 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 *CorporaDocumentsChunksListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksListCall) 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/{+parent}/chunks")
+ 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{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.documents.chunks.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListChunksResponse.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 *CorporaDocumentsChunksListCall) Do(opts ...googleapi.CallOption) (*ListChunksResponse, 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 := &ListChunksResponse{
+ 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 *CorporaDocumentsChunksListCall) Pages(ctx context.Context, f func(*ListChunksResponse) 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 CorporaDocumentsChunksPatchCall struct {
+ s *Service
+ name string
+ chunk *Chunk
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates a `Chunk`.
+//
+// - name: 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`.
+func (r *CorporaDocumentsChunksService) Patch(name string, chunk *Chunk) *CorporaDocumentsChunksPatchCall {
+ c := &CorporaDocumentsChunksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.chunk = chunk
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": Required. The list of
+// fields to update. Currently, this only supports updating `custom_metadata`
+// and `data`.
+func (c *CorporaDocumentsChunksPatchCall) UpdateMask(updateMask string) *CorporaDocumentsChunksPatchCall {
+ 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 *CorporaDocumentsChunksPatchCall) Fields(s ...googleapi.Field) *CorporaDocumentsChunksPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaDocumentsChunksPatchCall) Context(ctx context.Context) *CorporaDocumentsChunksPatchCall {
+ 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 *CorporaDocumentsChunksPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaDocumentsChunksPatchCall) 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.chunk)
+ 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.corpora.documents.chunks.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Chunk.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 *CorporaDocumentsChunksPatchCall) Do(opts ...googleapi.CallOption) (*Chunk, 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 := &Chunk{
+ 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 CorporaPermissionsCreateCall struct {
+ s *Service
+ parent string
+ permission *Permission
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: Create a permission to a specific resource.
+//
+// - parent: The parent resource of the `Permission`. Formats:
+// `tunedModels/{tuned_model}` `corpora/{corpus}`.
+func (r *CorporaPermissionsService) Create(parent string, permission *Permission) *CorporaPermissionsCreateCall {
+ c := &CorporaPermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ c.permission = permission
+ 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 *CorporaPermissionsCreateCall) Fields(s ...googleapi.Field) *CorporaPermissionsCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaPermissionsCreateCall) Context(ctx context.Context) *CorporaPermissionsCreateCall {
+ 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 *CorporaPermissionsCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaPermissionsCreateCall) 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.permission)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/permissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.permissions.create" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Permission.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 *CorporaPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, 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 := &Permission{
+ 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 CorporaPermissionsDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the permission.
+//
+// - name: The resource name of the permission. Formats:
+// `tunedModels/{tuned_model}/permissions/{permission}`
+// `corpora/{corpus}/permissions/{permission}`.
+func (r *CorporaPermissionsService) Delete(name string) *CorporaPermissionsDeleteCall {
+ c := &CorporaPermissionsDeleteCall{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 *CorporaPermissionsDeleteCall) Fields(s ...googleapi.Field) *CorporaPermissionsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaPermissionsDeleteCall) Context(ctx context.Context) *CorporaPermissionsDeleteCall {
+ 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 *CorporaPermissionsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaPermissionsDeleteCall) 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.corpora.permissions.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 *CorporaPermissionsDeleteCall) 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 CorporaPermissionsGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets information about a specific Permission.
+//
+// - name: The resource name of the permission. Formats:
+// `tunedModels/{tuned_model}/permissions/{permission}`
+// `corpora/{corpus}/permissions/{permission}`.
+func (r *CorporaPermissionsService) Get(name string) *CorporaPermissionsGetCall {
+ c := &CorporaPermissionsGetCall{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 *CorporaPermissionsGetCall) Fields(s ...googleapi.Field) *CorporaPermissionsGetCall {
+ 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 *CorporaPermissionsGetCall) IfNoneMatch(entityTag string) *CorporaPermissionsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaPermissionsGetCall) Context(ctx context.Context) *CorporaPermissionsGetCall {
+ 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 *CorporaPermissionsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaPermissionsGetCall) 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.corpora.permissions.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Permission.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 *CorporaPermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, 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 := &Permission{
+ 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 CorporaPermissionsListCall struct {
+ s *Service
+ parent string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists permissions for the specific resource.
+//
+// - parent: The parent resource of the permissions. Formats:
+// `tunedModels/{tuned_model}` `corpora/{corpus}`.
+func (r *CorporaPermissionsService) List(parent string) *CorporaPermissionsListCall {
+ c := &CorporaPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": 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.
+func (c *CorporaPermissionsListCall) PageSize(pageSize int64) *CorporaPermissionsListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": 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.
+func (c *CorporaPermissionsListCall) PageToken(pageToken string) *CorporaPermissionsListCall {
+ 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 *CorporaPermissionsListCall) Fields(s ...googleapi.Field) *CorporaPermissionsListCall {
+ 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 *CorporaPermissionsListCall) IfNoneMatch(entityTag string) *CorporaPermissionsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaPermissionsListCall) Context(ctx context.Context) *CorporaPermissionsListCall {
+ 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 *CorporaPermissionsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaPermissionsListCall) 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/{+parent}/permissions")
+ 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{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.corpora.permissions.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListPermissionsResponse.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 *CorporaPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListPermissionsResponse, 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 := &ListPermissionsResponse{
+ 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 *CorporaPermissionsListCall) Pages(ctx context.Context, f func(*ListPermissionsResponse) 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 CorporaPermissionsPatchCall struct {
+ s *Service
+ name string
+ permission *Permission
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates the permission.
+//
+// - name: 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.
+func (r *CorporaPermissionsService) Patch(name string, permission *Permission) *CorporaPermissionsPatchCall {
+ c := &CorporaPermissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.permission = permission
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": Required. The list of
+// fields to update. Accepted ones: - role (`Permission.role` field)
+func (c *CorporaPermissionsPatchCall) UpdateMask(updateMask string) *CorporaPermissionsPatchCall {
+ 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 *CorporaPermissionsPatchCall) Fields(s ...googleapi.Field) *CorporaPermissionsPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *CorporaPermissionsPatchCall) Context(ctx context.Context) *CorporaPermissionsPatchCall {
+ 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 *CorporaPermissionsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *CorporaPermissionsPatchCall) 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.permission)
+ 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.corpora.permissions.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Permission.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 *CorporaPermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, 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 := &Permission{
+ 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 FilesDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the `File`.
+//
+// - name: The name of the `File` to delete. Example: `files/abc-123`.
+func (r *FilesService) Delete(name string) *FilesDeleteCall {
+ c := &FilesDeleteCall{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 *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall {
+ 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 *FilesDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FilesDeleteCall) 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.files.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 *FilesDeleteCall) 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 FilesGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets the metadata for the given `File`.
+//
+// - name: The name of the `File` to get. Example: `files/abc-123`.
+func (r *FilesService) Get(name string) *FilesGetCall {
+ c := &FilesGetCall{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 *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
+ 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 *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
+ 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 *FilesGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FilesGetCall) 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.files.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *File.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 *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, 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 := &File{
+ 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 FilesListCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists the metadata for `File`s owned by the requesting project.
+func (r *FilesService) List() *FilesListCall {
+ c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": Maximum number of `File`s
+// to return per page. If unspecified, defaults to 10. Maximum `page_size` is
+// 100.
+func (c *FilesListCall) PageSize(pageSize int64) *FilesListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": A page token from a
+// previous `ListFiles` call.
+func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
+ 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 *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
+ 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 *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
+ 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 *FilesListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *FilesListCall) 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/files")
+ 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.files.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListFilesResponse.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 *FilesListCall) Do(opts ...googleapi.CallOption) (*ListFilesResponse, 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 := &ListFilesResponse{
+ 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 *FilesListCall) Pages(ctx context.Context, f func(*ListFilesResponse) 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 MediaUploadCall struct {
+ s *Service
+ createfilerequest *CreateFileRequest
+ urlParams_ gensupport.URLParams
+ mediaInfo_ *gensupport.MediaInfo
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Upload: Creates a `File`.
+func (r *MediaService) Upload(createfilerequest *CreateFileRequest) *MediaUploadCall {
+ c := &MediaUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.createfilerequest = createfilerequest
+ return c
+}
+
+// Media specifies the media to upload in one or more chunks. The chunk size
+// may be controlled by supplying a MediaOption generated by
+// googleapi.ChunkSize. The chunk size defaults to
+// googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
+// request will be determined by sniffing the contents of r, unless a
+// MediaOption generated by googleapi.ContentType is supplied.
+// At most one of Media and ResumableMedia may be set.
+func (c *MediaUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *MediaUploadCall {
+ c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
+ return c
+}
+
+// ResumableMedia specifies the media to upload in chunks and can be canceled
+// with ctx.
+//
+// Deprecated: use Media instead.
+//
+// At most one of Media and ResumableMedia may be set. mediaType identifies the
+// MIME media type of the upload, such as "image/png". If mediaType is "", it
+// will be auto-detected. The provided ctx will supersede any context
+// previously provided to the Context method.
+func (c *MediaUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaUploadCall {
+ c.ctx_ = ctx
+ c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
+ return c
+}
+
+// ProgressUpdater provides a callback function that will be called after every
+// chunk. It should be a low-latency function in order to not slow down the
+// upload operation. This should only be called when using ResumableMedia (as
+// opposed to Media).
+func (c *MediaUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaUploadCall {
+ c.mediaInfo_.SetProgressUpdater(pu)
+ 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 *MediaUploadCall) Fields(s ...googleapi.Field) *MediaUploadCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+// This context will supersede any context previously provided to the
+// ResumableMedia method.
+func (c *MediaUploadCall) Context(ctx context.Context) *MediaUploadCall {
+ 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 *MediaUploadCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *MediaUploadCall) 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.createfilerequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/files")
+ if c.mediaInfo_ != nil {
+ urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v1beta/files")
+ c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
+ }
+ if body == nil {
+ body = new(bytes.Buffer)
+ reqHeaders.Set("Content-Type", "application/json")
+ }
+ body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
+ defer cleanup()
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ req.GetBody = getBody
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.media.upload" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *CreateFileResponse.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 *MediaUploadCall) Do(opts ...googleapi.CallOption) (*CreateFileResponse, 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)
+ }
+ rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
+ if rx != nil {
+ rx.Client = c.s.client
+ rx.UserAgent = c.s.userAgent()
+ ctx := c.ctx_
+ if ctx == nil {
+ ctx = context.TODO()
+ }
+ res, err = rx.Upload(ctx)
+ if err != nil {
+ return nil, err
+ }
+ defer res.Body.Close()
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, gensupport.WrapError(err)
+ }
+ }
+ ret := &CreateFileResponse{
+ 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 ModelsBatchEmbedContentsCall struct {
+ s *Service
+ model string
+ batchembedcontentsrequest *BatchEmbedContentsRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// BatchEmbedContents: Generates multiple embeddings from the model given input
+// text in a synchronous call.
+//
+// - model: 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}`.
+func (r *ModelsService) BatchEmbedContents(model string, batchembedcontentsrequest *BatchEmbedContentsRequest) *ModelsBatchEmbedContentsCall {
+ c := &ModelsBatchEmbedContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.batchembedcontentsrequest = batchembedcontentsrequest
+ 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 *ModelsBatchEmbedContentsCall) Fields(s ...googleapi.Field) *ModelsBatchEmbedContentsCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsBatchEmbedContentsCall) Context(ctx context.Context) *ModelsBatchEmbedContentsCall {
+ 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 *ModelsBatchEmbedContentsCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsBatchEmbedContentsCall) 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.batchembedcontentsrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:batchEmbedContents")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.batchEmbedContents" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BatchEmbedContentsResponse.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 *ModelsBatchEmbedContentsCall) Do(opts ...googleapi.CallOption) (*BatchEmbedContentsResponse, 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 := &BatchEmbedContentsResponse{
+ 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 ModelsBatchEmbedTextCall struct {
+ s *Service
+ model string
+ batchembedtextrequest *BatchEmbedTextRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// BatchEmbedText: Generates multiple embeddings from the model given input
+// text in a synchronous call.
+//
+// - model: The name of the `Model` to use for generating the embedding.
+// Examples: models/embedding-gecko-001.
+func (r *ModelsService) BatchEmbedText(model string, batchembedtextrequest *BatchEmbedTextRequest) *ModelsBatchEmbedTextCall {
+ c := &ModelsBatchEmbedTextCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.batchembedtextrequest = batchembedtextrequest
+ 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 *ModelsBatchEmbedTextCall) Fields(s ...googleapi.Field) *ModelsBatchEmbedTextCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsBatchEmbedTextCall) Context(ctx context.Context) *ModelsBatchEmbedTextCall {
+ 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 *ModelsBatchEmbedTextCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsBatchEmbedTextCall) 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.batchembedtextrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:batchEmbedText")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.batchEmbedText" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *BatchEmbedTextResponse.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 *ModelsBatchEmbedTextCall) Do(opts ...googleapi.CallOption) (*BatchEmbedTextResponse, 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 := &BatchEmbedTextResponse{
+ 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 ModelsCountMessageTokensCall struct {
+ s *Service
+ model string
+ countmessagetokensrequest *CountMessageTokensRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// CountMessageTokens: Runs a model's tokenizer on a string and returns the
+// token count.
+//
+// - model: 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}`.
+func (r *ModelsService) CountMessageTokens(model string, countmessagetokensrequest *CountMessageTokensRequest) *ModelsCountMessageTokensCall {
+ c := &ModelsCountMessageTokensCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.countmessagetokensrequest = countmessagetokensrequest
+ 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 *ModelsCountMessageTokensCall) Fields(s ...googleapi.Field) *ModelsCountMessageTokensCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsCountMessageTokensCall) Context(ctx context.Context) *ModelsCountMessageTokensCall {
+ 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 *ModelsCountMessageTokensCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsCountMessageTokensCall) 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.countmessagetokensrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:countMessageTokens")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.countMessageTokens" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *CountMessageTokensResponse.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 *ModelsCountMessageTokensCall) Do(opts ...googleapi.CallOption) (*CountMessageTokensResponse, 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 := &CountMessageTokensResponse{
+ 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 ModelsCountTextTokensCall struct {
+ s *Service
+ model string
+ counttexttokensrequest *CountTextTokensRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// CountTextTokens: Runs a model's tokenizer on a text and returns the token
+// count.
+//
+// - model: 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}`.
+func (r *ModelsService) CountTextTokens(model string, counttexttokensrequest *CountTextTokensRequest) *ModelsCountTextTokensCall {
+ c := &ModelsCountTextTokensCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.counttexttokensrequest = counttexttokensrequest
+ 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 *ModelsCountTextTokensCall) Fields(s ...googleapi.Field) *ModelsCountTextTokensCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsCountTextTokensCall) Context(ctx context.Context) *ModelsCountTextTokensCall {
+ 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 *ModelsCountTextTokensCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsCountTextTokensCall) 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.counttexttokensrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:countTextTokens")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.countTextTokens" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *CountTextTokensResponse.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 *ModelsCountTextTokensCall) Do(opts ...googleapi.CallOption) (*CountTextTokensResponse, 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 := &CountTextTokensResponse{
+ 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 ModelsCountTokensCall struct {
+ s *Service
+ model string
+ counttokensrequest *CountTokensRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// CountTokens: Runs a model's tokenizer on input content and returns the token
+// count.
+//
+// - model: 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}`.
+func (r *ModelsService) CountTokens(model string, counttokensrequest *CountTokensRequest) *ModelsCountTokensCall {
+ c := &ModelsCountTokensCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.counttokensrequest = counttokensrequest
+ 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 *ModelsCountTokensCall) Fields(s ...googleapi.Field) *ModelsCountTokensCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsCountTokensCall) Context(ctx context.Context) *ModelsCountTokensCall {
+ 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 *ModelsCountTokensCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsCountTokensCall) 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.counttokensrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:countTokens")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.countTokens" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *CountTokensResponse.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 *ModelsCountTokensCall) Do(opts ...googleapi.CallOption) (*CountTokensResponse, 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 := &CountTokensResponse{
+ 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 ModelsEmbedContentCall struct {
+ s *Service
+ model string
+ embedcontentrequest *EmbedContentRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// EmbedContent: Generates an embedding from the model given an input
+// `Content`.
+//
+// - model: 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}`.
+func (r *ModelsService) EmbedContent(model string, embedcontentrequest *EmbedContentRequest) *ModelsEmbedContentCall {
+ c := &ModelsEmbedContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.embedcontentrequest = embedcontentrequest
+ 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 *ModelsEmbedContentCall) Fields(s ...googleapi.Field) *ModelsEmbedContentCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsEmbedContentCall) Context(ctx context.Context) *ModelsEmbedContentCall {
+ 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 *ModelsEmbedContentCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsEmbedContentCall) 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.embedcontentrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:embedContent")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.embedContent" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *EmbedContentResponse.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 *ModelsEmbedContentCall) Do(opts ...googleapi.CallOption) (*EmbedContentResponse, 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 := &EmbedContentResponse{
+ 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 ModelsEmbedTextCall struct {
+ s *Service
+ model string
+ embedtextrequest *EmbedTextRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// EmbedText: Generates an embedding from the model given an input message.
+//
+// - model: The model name to use with the format model=models/{model}.
+func (r *ModelsService) EmbedText(model string, embedtextrequest *EmbedTextRequest) *ModelsEmbedTextCall {
+ c := &ModelsEmbedTextCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.embedtextrequest = embedtextrequest
+ 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 *ModelsEmbedTextCall) Fields(s ...googleapi.Field) *ModelsEmbedTextCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsEmbedTextCall) Context(ctx context.Context) *ModelsEmbedTextCall {
+ 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 *ModelsEmbedTextCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsEmbedTextCall) 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.embedtextrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:embedText")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.embedText" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *EmbedTextResponse.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 *ModelsEmbedTextCall) Do(opts ...googleapi.CallOption) (*EmbedTextResponse, 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 := &EmbedTextResponse{
+ 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 ModelsGenerateAnswerCall struct {
+ s *Service
+ model string
+ generateanswerrequest *GenerateAnswerRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GenerateAnswer: Generates a grounded answer from the model given an input
+// `GenerateAnswerRequest`.
+//
+// - model: The name of the `Model` to use for generating the grounded
+// response. Format: `model=models/{model}`.
+func (r *ModelsService) GenerateAnswer(model string, generateanswerrequest *GenerateAnswerRequest) *ModelsGenerateAnswerCall {
+ c := &ModelsGenerateAnswerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.generateanswerrequest = generateanswerrequest
+ 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 *ModelsGenerateAnswerCall) Fields(s ...googleapi.Field) *ModelsGenerateAnswerCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsGenerateAnswerCall) Context(ctx context.Context) *ModelsGenerateAnswerCall {
+ 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 *ModelsGenerateAnswerCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsGenerateAnswerCall) 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.generateanswerrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:generateAnswer")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.generateAnswer" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *GenerateAnswerResponse.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 *ModelsGenerateAnswerCall) Do(opts ...googleapi.CallOption) (*GenerateAnswerResponse, 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 := &GenerateAnswerResponse{
+ 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 ModelsGenerateContentCall struct {
+ s *Service
+ model string
+ generatecontentrequest *GenerateContentRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GenerateContent: 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.
+//
+// - model: The name of the `Model` to use for generating the completion.
+// Format: `name=models/{model}`.
+func (r *ModelsService) GenerateContent(model string, generatecontentrequest *GenerateContentRequest) *ModelsGenerateContentCall {
+ c := &ModelsGenerateContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.generatecontentrequest = generatecontentrequest
+ 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 *ModelsGenerateContentCall) Fields(s ...googleapi.Field) *ModelsGenerateContentCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsGenerateContentCall) Context(ctx context.Context) *ModelsGenerateContentCall {
+ 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 *ModelsGenerateContentCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsGenerateContentCall) 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.generatecontentrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:generateContent")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.generateContent" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *GenerateContentResponse.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 *ModelsGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, 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 := &GenerateContentResponse{
+ 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 ModelsGenerateMessageCall struct {
+ s *Service
+ model string
+ generatemessagerequest *GenerateMessageRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GenerateMessage: Generates a response from the model given an input
+// `MessagePrompt`.
+//
+// - model: The name of the model to use. Format: `name=models/{model}`.
+func (r *ModelsService) GenerateMessage(model string, generatemessagerequest *GenerateMessageRequest) *ModelsGenerateMessageCall {
+ c := &ModelsGenerateMessageCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.generatemessagerequest = generatemessagerequest
+ 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 *ModelsGenerateMessageCall) Fields(s ...googleapi.Field) *ModelsGenerateMessageCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsGenerateMessageCall) Context(ctx context.Context) *ModelsGenerateMessageCall {
+ 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 *ModelsGenerateMessageCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsGenerateMessageCall) 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.generatemessagerequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:generateMessage")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.generateMessage" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *GenerateMessageResponse.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 *ModelsGenerateMessageCall) Do(opts ...googleapi.CallOption) (*GenerateMessageResponse, 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 := &GenerateMessageResponse{
+ 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 ModelsGenerateTextCall struct {
+ s *Service
+ model string
+ generatetextrequest *GenerateTextRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GenerateText: Generates a response from the model given an input message.
+//
+// - model: The name of the `Model` or `TunedModel` to use for generating the
+// completion. Examples: models/text-bison-001
+// tunedModels/sentence-translator-u3b7m.
+func (r *ModelsService) GenerateText(model string, generatetextrequest *GenerateTextRequest) *ModelsGenerateTextCall {
+ c := &ModelsGenerateTextCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.generatetextrequest = generatetextrequest
+ 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 *ModelsGenerateTextCall) Fields(s ...googleapi.Field) *ModelsGenerateTextCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsGenerateTextCall) Context(ctx context.Context) *ModelsGenerateTextCall {
+ 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 *ModelsGenerateTextCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsGenerateTextCall) 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.generatetextrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:generateText")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.generateText" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *GenerateTextResponse.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 *ModelsGenerateTextCall) Do(opts ...googleapi.CallOption) (*GenerateTextResponse, 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 := &GenerateTextResponse{
+ 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 ModelsGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets information about a specific Model.
+//
+// - name: The resource name of the model. This name should match a model name
+// returned by the `ListModels` method. Format: `models/{model}`.
+func (r *ModelsService) Get(name string) *ModelsGetCall {
+ c := &ModelsGetCall{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 *ModelsGetCall) Fields(s ...googleapi.Field) *ModelsGetCall {
+ 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 *ModelsGetCall) IfNoneMatch(entityTag string) *ModelsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsGetCall) Context(ctx context.Context) *ModelsGetCall {
+ 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 *ModelsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsGetCall) 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.models.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Model.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 *ModelsGetCall) Do(opts ...googleapi.CallOption) (*Model, 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 := &Model{
+ 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 ModelsListCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists models available through the API.
+func (r *ModelsService) List() *ModelsListCall {
+ c := &ModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": 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.
+func (c *ModelsListCall) PageSize(pageSize int64) *ModelsListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": 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.
+func (c *ModelsListCall) PageToken(pageToken string) *ModelsListCall {
+ 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 *ModelsListCall) Fields(s ...googleapi.Field) *ModelsListCall {
+ 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 *ModelsListCall) IfNoneMatch(entityTag string) *ModelsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsListCall) Context(ctx context.Context) *ModelsListCall {
+ 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 *ModelsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsListCall) 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/models")
+ 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.models.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListModelsResponse.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 *ModelsListCall) Do(opts ...googleapi.CallOption) (*ListModelsResponse, 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 := &ListModelsResponse{
+ 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 *ModelsListCall) Pages(ctx context.Context, f func(*ListModelsResponse) 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 ModelsStreamGenerateContentCall struct {
+ s *Service
+ model string
+ generatecontentrequest *GenerateContentRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// StreamGenerateContent: Generates a streamed response from the model given an
+// input `GenerateContentRequest`.
+//
+// - model: The name of the `Model` to use for generating the completion.
+// Format: `name=models/{model}`.
+func (r *ModelsService) StreamGenerateContent(model string, generatecontentrequest *GenerateContentRequest) *ModelsStreamGenerateContentCall {
+ c := &ModelsStreamGenerateContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.generatecontentrequest = generatecontentrequest
+ 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 *ModelsStreamGenerateContentCall) Fields(s ...googleapi.Field) *ModelsStreamGenerateContentCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *ModelsStreamGenerateContentCall) Context(ctx context.Context) *ModelsStreamGenerateContentCall {
+ 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 *ModelsStreamGenerateContentCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ModelsStreamGenerateContentCall) 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.generatecontentrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:streamGenerateContent")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.models.streamGenerateContent" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *GenerateContentResponse.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 *ModelsStreamGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, 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 := &GenerateContentResponse{
+ 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 TunedModelsCreateCall struct {
+ s *Service
+ tunedmodel *TunedModel
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: 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
+func (r *TunedModelsService) Create(tunedmodel *TunedModel) *TunedModelsCreateCall {
+ c := &TunedModelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.tunedmodel = tunedmodel
+ return c
+}
+
+// TunedModelId sets the optional parameter "tunedModelId": 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])?.
+func (c *TunedModelsCreateCall) TunedModelId(tunedModelId string) *TunedModelsCreateCall {
+ c.urlParams_.Set("tunedModelId", tunedModelId)
+ 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 *TunedModelsCreateCall) Fields(s ...googleapi.Field) *TunedModelsCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsCreateCall) Context(ctx context.Context) *TunedModelsCreateCall {
+ 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 *TunedModelsCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsCreateCall) 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.tunedmodel)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/tunedModels")
+ 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.tunedModels.create" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Operation.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 *TunedModelsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, 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 := &Operation{
+ 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 TunedModelsDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes a tuned model.
+//
+// - name: The resource name of the model. Format: `tunedModels/my-model-id`.
+func (r *TunedModelsService) Delete(name string) *TunedModelsDeleteCall {
+ c := &TunedModelsDeleteCall{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 *TunedModelsDeleteCall) Fields(s ...googleapi.Field) *TunedModelsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsDeleteCall) Context(ctx context.Context) *TunedModelsDeleteCall {
+ 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 *TunedModelsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsDeleteCall) 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.tunedModels.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 *TunedModelsDeleteCall) 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 TunedModelsGenerateContentCall struct {
+ s *Service
+ model string
+ generatecontentrequest *GenerateContentRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GenerateContent: 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.
+//
+// - model: The name of the `Model` to use for generating the completion.
+// Format: `name=models/{model}`.
+func (r *TunedModelsService) GenerateContent(model string, generatecontentrequest *GenerateContentRequest) *TunedModelsGenerateContentCall {
+ c := &TunedModelsGenerateContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.generatecontentrequest = generatecontentrequest
+ 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 *TunedModelsGenerateContentCall) Fields(s ...googleapi.Field) *TunedModelsGenerateContentCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsGenerateContentCall) Context(ctx context.Context) *TunedModelsGenerateContentCall {
+ 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 *TunedModelsGenerateContentCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsGenerateContentCall) 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.generatecontentrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:generateContent")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.tunedModels.generateContent" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *GenerateContentResponse.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 *TunedModelsGenerateContentCall) Do(opts ...googleapi.CallOption) (*GenerateContentResponse, 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 := &GenerateContentResponse{
+ 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 TunedModelsGenerateTextCall struct {
+ s *Service
+ model string
+ generatetextrequest *GenerateTextRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// GenerateText: Generates a response from the model given an input message.
+//
+// - model: The name of the `Model` or `TunedModel` to use for generating the
+// completion. Examples: models/text-bison-001
+// tunedModels/sentence-translator-u3b7m.
+func (r *TunedModelsService) GenerateText(model string, generatetextrequest *GenerateTextRequest) *TunedModelsGenerateTextCall {
+ c := &TunedModelsGenerateTextCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.model = model
+ c.generatetextrequest = generatetextrequest
+ 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 *TunedModelsGenerateTextCall) Fields(s ...googleapi.Field) *TunedModelsGenerateTextCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsGenerateTextCall) Context(ctx context.Context) *TunedModelsGenerateTextCall {
+ 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 *TunedModelsGenerateTextCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsGenerateTextCall) 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.generatetextrequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+model}:generateText")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "model": c.model,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.tunedModels.generateText" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *GenerateTextResponse.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 *TunedModelsGenerateTextCall) Do(opts ...googleapi.CallOption) (*GenerateTextResponse, 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 := &GenerateTextResponse{
+ 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 TunedModelsGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets information about a specific TunedModel.
+//
+// - name: The resource name of the model. Format: `tunedModels/my-model-id`.
+func (r *TunedModelsService) Get(name string) *TunedModelsGetCall {
+ c := &TunedModelsGetCall{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 *TunedModelsGetCall) Fields(s ...googleapi.Field) *TunedModelsGetCall {
+ 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 *TunedModelsGetCall) IfNoneMatch(entityTag string) *TunedModelsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsGetCall) Context(ctx context.Context) *TunedModelsGetCall {
+ 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 *TunedModelsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsGetCall) 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.tunedModels.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TunedModel.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 *TunedModelsGetCall) Do(opts ...googleapi.CallOption) (*TunedModel, 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 := &TunedModel{
+ 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 TunedModelsListCall struct {
+ s *Service
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists tuned models owned by the user.
+func (r *TunedModelsService) List() *TunedModelsListCall {
+ c := &TunedModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ return c
+}
+
+// Filter sets the optional parameter "filter": 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
+func (c *TunedModelsListCall) Filter(filter string) *TunedModelsListCall {
+ c.urlParams_.Set("filter", filter)
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": 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.
+func (c *TunedModelsListCall) PageSize(pageSize int64) *TunedModelsListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": 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.
+func (c *TunedModelsListCall) PageToken(pageToken string) *TunedModelsListCall {
+ 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 *TunedModelsListCall) Fields(s ...googleapi.Field) *TunedModelsListCall {
+ 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 *TunedModelsListCall) IfNoneMatch(entityTag string) *TunedModelsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsListCall) Context(ctx context.Context) *TunedModelsListCall {
+ 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 *TunedModelsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsListCall) 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/tunedModels")
+ 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.tunedModels.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListTunedModelsResponse.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 *TunedModelsListCall) Do(opts ...googleapi.CallOption) (*ListTunedModelsResponse, 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 := &ListTunedModelsResponse{
+ 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 *TunedModelsListCall) Pages(ctx context.Context, f func(*ListTunedModelsResponse) 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 TunedModelsPatchCall struct {
+ s *Service
+ name string
+ tunedmodel *TunedModel
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates a tuned model.
+//
+// - name: 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".
+func (r *TunedModelsService) Patch(name string, tunedmodel *TunedModel) *TunedModelsPatchCall {
+ c := &TunedModelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.tunedmodel = tunedmodel
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": Required. The list of
+// fields to update.
+func (c *TunedModelsPatchCall) UpdateMask(updateMask string) *TunedModelsPatchCall {
+ 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 *TunedModelsPatchCall) Fields(s ...googleapi.Field) *TunedModelsPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsPatchCall) Context(ctx context.Context) *TunedModelsPatchCall {
+ 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 *TunedModelsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsPatchCall) 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.tunedmodel)
+ 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.tunedModels.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TunedModel.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 *TunedModelsPatchCall) Do(opts ...googleapi.CallOption) (*TunedModel, 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 := &TunedModel{
+ 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 TunedModelsTransferOwnershipCall struct {
+ s *Service
+ name string
+ transferownershiprequest *TransferOwnershipRequest
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// TransferOwnership: 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.
+//
+// - name: The resource name of the tuned model to transfer ownership. Format:
+// `tunedModels/my-model-id`.
+func (r *TunedModelsService) TransferOwnership(name string, transferownershiprequest *TransferOwnershipRequest) *TunedModelsTransferOwnershipCall {
+ c := &TunedModelsTransferOwnershipCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.transferownershiprequest = transferownershiprequest
+ 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 *TunedModelsTransferOwnershipCall) Fields(s ...googleapi.Field) *TunedModelsTransferOwnershipCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsTransferOwnershipCall) Context(ctx context.Context) *TunedModelsTransferOwnershipCall {
+ 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 *TunedModelsTransferOwnershipCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsTransferOwnershipCall) 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.transferownershiprequest)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:transferOwnership")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", 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.tunedModels.transferOwnership" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *TransferOwnershipResponse.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 *TunedModelsTransferOwnershipCall) Do(opts ...googleapi.CallOption) (*TransferOwnershipResponse, 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 := &TransferOwnershipResponse{
+ 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 TunedModelsPermissionsCreateCall struct {
+ s *Service
+ parent string
+ permission *Permission
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Create: Create a permission to a specific resource.
+//
+// - parent: The parent resource of the `Permission`. Formats:
+// `tunedModels/{tuned_model}` `corpora/{corpus}`.
+func (r *TunedModelsPermissionsService) Create(parent string, permission *Permission) *TunedModelsPermissionsCreateCall {
+ c := &TunedModelsPermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ c.permission = permission
+ 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 *TunedModelsPermissionsCreateCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsCreateCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsPermissionsCreateCall) Context(ctx context.Context) *TunedModelsPermissionsCreateCall {
+ 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 *TunedModelsPermissionsCreateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsPermissionsCreateCall) 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.permission)
+ if err != nil {
+ return nil, err
+ }
+ c.urlParams_.Set("alt", alt)
+ c.urlParams_.Set("prettyPrint", "false")
+ urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/permissions")
+ urls += "?" + c.urlParams_.Encode()
+ req, err := http.NewRequest("POST", urls, body)
+ if err != nil {
+ return nil, err
+ }
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.tunedModels.permissions.create" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Permission.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 *TunedModelsPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, 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 := &Permission{
+ 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 TunedModelsPermissionsDeleteCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Deletes the permission.
+//
+// - name: The resource name of the permission. Formats:
+// `tunedModels/{tuned_model}/permissions/{permission}`
+// `corpora/{corpus}/permissions/{permission}`.
+func (r *TunedModelsPermissionsService) Delete(name string) *TunedModelsPermissionsDeleteCall {
+ c := &TunedModelsPermissionsDeleteCall{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 *TunedModelsPermissionsDeleteCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsPermissionsDeleteCall) Context(ctx context.Context) *TunedModelsPermissionsDeleteCall {
+ 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 *TunedModelsPermissionsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsPermissionsDeleteCall) 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.tunedModels.permissions.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 *TunedModelsPermissionsDeleteCall) 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 TunedModelsPermissionsGetCall struct {
+ s *Service
+ name string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Gets information about a specific Permission.
+//
+// - name: The resource name of the permission. Formats:
+// `tunedModels/{tuned_model}/permissions/{permission}`
+// `corpora/{corpus}/permissions/{permission}`.
+func (r *TunedModelsPermissionsService) Get(name string) *TunedModelsPermissionsGetCall {
+ c := &TunedModelsPermissionsGetCall{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 *TunedModelsPermissionsGetCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsGetCall {
+ 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 *TunedModelsPermissionsGetCall) IfNoneMatch(entityTag string) *TunedModelsPermissionsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsPermissionsGetCall) Context(ctx context.Context) *TunedModelsPermissionsGetCall {
+ 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 *TunedModelsPermissionsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsPermissionsGetCall) 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.tunedModels.permissions.get" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Permission.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 *TunedModelsPermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, 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 := &Permission{
+ 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 TunedModelsPermissionsListCall struct {
+ s *Service
+ parent string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Lists permissions for the specific resource.
+//
+// - parent: The parent resource of the permissions. Formats:
+// `tunedModels/{tuned_model}` `corpora/{corpus}`.
+func (r *TunedModelsPermissionsService) List(parent string) *TunedModelsPermissionsListCall {
+ c := &TunedModelsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.parent = parent
+ return c
+}
+
+// PageSize sets the optional parameter "pageSize": 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.
+func (c *TunedModelsPermissionsListCall) PageSize(pageSize int64) *TunedModelsPermissionsListCall {
+ c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
+ return c
+}
+
+// PageToken sets the optional parameter "pageToken": 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.
+func (c *TunedModelsPermissionsListCall) PageToken(pageToken string) *TunedModelsPermissionsListCall {
+ 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 *TunedModelsPermissionsListCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsListCall {
+ 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 *TunedModelsPermissionsListCall) IfNoneMatch(entityTag string) *TunedModelsPermissionsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsPermissionsListCall) Context(ctx context.Context) *TunedModelsPermissionsListCall {
+ 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 *TunedModelsPermissionsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsPermissionsListCall) 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/{+parent}/permissions")
+ 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{
+ "parent": c.parent,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "generativelanguage.tunedModels.permissions.list" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *ListPermissionsResponse.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 *TunedModelsPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListPermissionsResponse, 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 := &ListPermissionsResponse{
+ 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 *TunedModelsPermissionsListCall) Pages(ctx context.Context, f func(*ListPermissionsResponse) 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 TunedModelsPermissionsPatchCall struct {
+ s *Service
+ name string
+ permission *Permission
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Patch: Updates the permission.
+//
+// - name: 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.
+func (r *TunedModelsPermissionsService) Patch(name string, permission *Permission) *TunedModelsPermissionsPatchCall {
+ c := &TunedModelsPermissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.name = name
+ c.permission = permission
+ return c
+}
+
+// UpdateMask sets the optional parameter "updateMask": Required. The list of
+// fields to update. Accepted ones: - role (`Permission.role` field)
+func (c *TunedModelsPermissionsPatchCall) UpdateMask(updateMask string) *TunedModelsPermissionsPatchCall {
+ 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 *TunedModelsPermissionsPatchCall) Fields(s ...googleapi.Field) *TunedModelsPermissionsPatchCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method.
+func (c *TunedModelsPermissionsPatchCall) Context(ctx context.Context) *TunedModelsPermissionsPatchCall {
+ 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 *TunedModelsPermissionsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *TunedModelsPermissionsPatchCall) 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.permission)
+ 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.tunedModels.permissions.patch" call.
+// Any non-2xx status code is an error. Response headers are in either
+// *Permission.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 *TunedModelsPermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, 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 := &Permission{
+ 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
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/README b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/README
new file mode 100644
index 000000000..c00591c44
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/README
@@ -0,0 +1,12 @@
+This directory was copied from github.com/googleapis/google-api-go-client/internal/gensupport.
+It is needed for the discovery client in ../generativelanguage.
+
+To update, first clone github.com/googleapis/google-api-go-client
+into a directory we will call DIR below.
+Then, from the repo root:
+```
+rm genai/internal/gensupport/*.go
+cp $DIR/internal/gensupport/*.go genai/internal/gensupport
+```
+Then edit the params.go and resumable.go files to replace the reference to `internal.Version`
+with the literal string from $DIR/internal/version.go, and remove the import of `internal`.
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go
new file mode 100644
index 000000000..3d0817ede
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go
@@ -0,0 +1,79 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "bytes"
+ "io"
+
+ "google.golang.org/api/googleapi"
+)
+
+// MediaBuffer buffers data from an io.Reader to support uploading media in
+// retryable chunks. It should be created with NewMediaBuffer.
+type MediaBuffer struct {
+ media io.Reader
+
+ chunk []byte // The current chunk which is pending upload. The capacity is the chunk size.
+ err error // Any error generated when populating chunk by reading media.
+
+ // The absolute position of chunk in the underlying media.
+ off int64
+}
+
+// NewMediaBuffer initializes a MediaBuffer.
+func NewMediaBuffer(media io.Reader, chunkSize int) *MediaBuffer {
+ return &MediaBuffer{media: media, chunk: make([]byte, 0, chunkSize)}
+}
+
+// Chunk returns the current buffered chunk, the offset in the underlying media
+// from which the chunk is drawn, and the size of the chunk.
+// Successive calls to Chunk return the same chunk between calls to Next.
+func (mb *MediaBuffer) Chunk() (chunk io.Reader, off int64, size int, err error) {
+ // There may already be data in chunk if Next has not been called since the previous call to Chunk.
+ if mb.err == nil && len(mb.chunk) == 0 {
+ mb.err = mb.loadChunk()
+ }
+ return bytes.NewReader(mb.chunk), mb.off, len(mb.chunk), mb.err
+}
+
+// loadChunk will read from media into chunk, up to the capacity of chunk.
+func (mb *MediaBuffer) loadChunk() error {
+ bufSize := cap(mb.chunk)
+ mb.chunk = mb.chunk[:bufSize]
+
+ read := 0
+ var err error
+ for err == nil && read < bufSize {
+ var n int
+ n, err = mb.media.Read(mb.chunk[read:])
+ read += n
+ }
+ mb.chunk = mb.chunk[:read]
+ return err
+}
+
+// Next advances to the next chunk, which will be returned by the next call to Chunk.
+// Calls to Next without a corresponding prior call to Chunk will have no effect.
+func (mb *MediaBuffer) Next() {
+ mb.off += int64(len(mb.chunk))
+ mb.chunk = mb.chunk[0:0]
+}
+
+type readerTyper struct {
+ io.Reader
+ googleapi.ContentTyper
+}
+
+// ReaderAtToReader adapts a ReaderAt to be used as a Reader.
+// If ra implements googleapi.ContentTyper, then the returned reader
+// will also implement googleapi.ContentTyper, delegating to ra.
+func ReaderAtToReader(ra io.ReaderAt, size int64) io.Reader {
+ r := io.NewSectionReader(ra, 0, size)
+ if typer, ok := ra.(googleapi.ContentTyper); ok {
+ return readerTyper{r, typer}
+ }
+ return r
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go
new file mode 100644
index 000000000..752c4b411
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go
@@ -0,0 +1,10 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package gensupport is an internal implementation detail used by code
+// generated by the google-api-go-generator tool.
+//
+// This package may be modified at any time without regard for backwards
+// compatibility. It should not be used directly by API users.
+package gensupport
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go
new file mode 100644
index 000000000..886c6532b
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go
@@ -0,0 +1,24 @@
+// Copyright 2022 Google LLC. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "errors"
+
+ "github.com/googleapis/gax-go/v2/apierror"
+ "google.golang.org/api/googleapi"
+)
+
+// WrapError creates an [apierror.APIError] from err, wraps it in err, and
+// returns err. If err is not a [googleapi.Error] (or a
+// [google.golang.org/grpc/status.Status]), it returns err without modification.
+func WrapError(err error) error {
+ var herr *googleapi.Error
+ apiError, ok := apierror.ParseError(err, false)
+ if ok && errors.As(err, &herr) {
+ herr.Wrap(apiError)
+ }
+ return err
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go
new file mode 100644
index 000000000..eab49a11e
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go
@@ -0,0 +1,236 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "encoding/json"
+ "fmt"
+ "reflect"
+ "strings"
+)
+
+// MarshalJSON returns a JSON encoding of schema containing only selected fields.
+// A field is selected if any of the following is true:
+// - it has a non-empty value
+// - its field name is present in forceSendFields and it is not a nil pointer or nil interface
+// - its field name is present in nullFields.
+//
+// The JSON key for each selected field is taken from the field's json: struct tag.
+func MarshalJSON(schema interface{}, forceSendFields, nullFields []string) ([]byte, error) {
+ if len(forceSendFields) == 0 && len(nullFields) == 0 {
+ return json.Marshal(schema)
+ }
+
+ mustInclude := make(map[string]bool)
+ for _, f := range forceSendFields {
+ mustInclude[f] = true
+ }
+ useNull := make(map[string]bool)
+ useNullMaps := make(map[string]map[string]bool)
+ for _, nf := range nullFields {
+ parts := strings.SplitN(nf, ".", 2)
+ field := parts[0]
+ if len(parts) == 1 {
+ useNull[field] = true
+ } else {
+ if useNullMaps[field] == nil {
+ useNullMaps[field] = map[string]bool{}
+ }
+ useNullMaps[field][parts[1]] = true
+ }
+ }
+
+ dataMap, err := schemaToMap(schema, mustInclude, useNull, useNullMaps)
+ if err != nil {
+ return nil, err
+ }
+ return json.Marshal(dataMap)
+}
+
+func schemaToMap(schema interface{}, mustInclude, useNull map[string]bool, useNullMaps map[string]map[string]bool) (map[string]interface{}, error) {
+ m := make(map[string]interface{})
+ s := reflect.ValueOf(schema)
+ st := s.Type()
+
+ for i := 0; i < s.NumField(); i++ {
+ jsonTag := st.Field(i).Tag.Get("json")
+ if jsonTag == "" {
+ continue
+ }
+ tag, err := parseJSONTag(jsonTag)
+ if err != nil {
+ return nil, err
+ }
+ if tag.ignore {
+ continue
+ }
+
+ v := s.Field(i)
+ f := st.Field(i)
+
+ if useNull[f.Name] {
+ if !isEmptyValue(v) {
+ return nil, fmt.Errorf("field %q in NullFields has non-empty value", f.Name)
+ }
+ m[tag.apiName] = nil
+ continue
+ }
+
+ if !includeField(v, f, mustInclude) {
+ continue
+ }
+
+ // If map fields are explicitly set to null, use a map[string]interface{}.
+ if f.Type.Kind() == reflect.Map && useNullMaps[f.Name] != nil {
+ ms, ok := v.Interface().(map[string]string)
+ if !ok {
+ mi, err := initMapSlow(v, f.Name, useNullMaps)
+ if err != nil {
+ return nil, err
+ }
+ m[tag.apiName] = mi
+ continue
+ }
+ mi := map[string]interface{}{}
+ for k, v := range ms {
+ mi[k] = v
+ }
+ for k := range useNullMaps[f.Name] {
+ mi[k] = nil
+ }
+ m[tag.apiName] = mi
+ continue
+ }
+
+ // nil maps are treated as empty maps.
+ if f.Type.Kind() == reflect.Map && v.IsNil() {
+ m[tag.apiName] = map[string]string{}
+ continue
+ }
+
+ // nil slices are treated as empty slices.
+ if f.Type.Kind() == reflect.Slice && v.IsNil() {
+ m[tag.apiName] = []bool{}
+ continue
+ }
+
+ if tag.stringFormat {
+ m[tag.apiName] = formatAsString(v, f.Type.Kind())
+ } else {
+ m[tag.apiName] = v.Interface()
+ }
+ }
+ return m, nil
+}
+
+// initMapSlow uses reflection to build up a map object. This is slower than
+// the default behavior so it should be used only as a fallback.
+func initMapSlow(rv reflect.Value, fieldName string, useNullMaps map[string]map[string]bool) (map[string]interface{}, error) {
+ mi := map[string]interface{}{}
+ iter := rv.MapRange()
+ for iter.Next() {
+ k, ok := iter.Key().Interface().(string)
+ if !ok {
+ return nil, fmt.Errorf("field %q has keys in NullFields but is not a map[string]any", fieldName)
+ }
+ v := iter.Value().Interface()
+ mi[k] = v
+ }
+ for k := range useNullMaps[fieldName] {
+ mi[k] = nil
+ }
+ return mi, nil
+}
+
+// formatAsString returns a string representation of v, dereferencing it first if possible.
+func formatAsString(v reflect.Value, kind reflect.Kind) string {
+ if kind == reflect.Ptr && !v.IsNil() {
+ v = v.Elem()
+ }
+
+ return fmt.Sprintf("%v", v.Interface())
+}
+
+// jsonTag represents a restricted version of the struct tag format used by encoding/json.
+// It is used to describe the JSON encoding of fields in a Schema struct.
+type jsonTag struct {
+ apiName string
+ stringFormat bool
+ ignore bool
+}
+
+// parseJSONTag parses a restricted version of the struct tag format used by encoding/json.
+// The format of the tag must match that generated by the Schema.writeSchemaStruct method
+// in the api generator.
+func parseJSONTag(val string) (jsonTag, error) {
+ if val == "-" {
+ return jsonTag{ignore: true}, nil
+ }
+
+ var tag jsonTag
+
+ i := strings.Index(val, ",")
+ if i == -1 || val[:i] == "" {
+ return tag, fmt.Errorf("malformed json tag: %s", val)
+ }
+
+ tag = jsonTag{
+ apiName: val[:i],
+ }
+
+ switch val[i+1:] {
+ case "omitempty":
+ case "omitempty,string":
+ tag.stringFormat = true
+ default:
+ return tag, fmt.Errorf("malformed json tag: %s", val)
+ }
+
+ return tag, nil
+}
+
+// Reports whether the struct field "f" with value "v" should be included in JSON output.
+func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]bool) bool {
+ // The regular JSON encoding of a nil pointer is "null", which means "delete this field".
+ // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set.
+ // However, many fields are not pointers, so there would be no way to delete these fields.
+ // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields.
+ // Deletion will be handled by a separate mechanism.
+ if f.Type.Kind() == reflect.Ptr && v.IsNil() {
+ return false
+ }
+
+ // The "any" type is represented as an interface{}. If this interface
+ // is nil, there is no reasonable representation to send. We ignore
+ // these fields, for the same reasons as given above for pointers.
+ if f.Type.Kind() == reflect.Interface && v.IsNil() {
+ return false
+ }
+
+ return mustInclude[f.Name] || !isEmptyValue(v)
+}
+
+// isEmptyValue reports whether v is the empty value for its type. This
+// implementation is based on that of the encoding/json package, but its
+// correctness does not depend on it being identical. What's important is that
+// this function return false in situations where v should not be sent as part
+// of a PATCH operation.
+func isEmptyValue(v reflect.Value) bool {
+ switch v.Kind() {
+ case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
+ return v.Len() == 0
+ case reflect.Bool:
+ return !v.Bool()
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return v.Int() == 0
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+ return v.Uint() == 0
+ case reflect.Float32, reflect.Float64:
+ return v.Float() == 0
+ case reflect.Interface, reflect.Ptr:
+ return v.IsNil()
+ }
+ return false
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go
new file mode 100644
index 000000000..13c2f9302
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go
@@ -0,0 +1,47 @@
+// Copyright 2016 Google LLC.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "encoding/json"
+ "errors"
+ "fmt"
+ "math"
+)
+
+// JSONFloat64 is a float64 that supports proper unmarshaling of special float
+// values in JSON, according to
+// https://developers.google.com/protocol-buffers/docs/proto3#json. Although
+// that is a proto-to-JSON spec, it applies to all Google APIs.
+//
+// The jsonpb package
+// (https://github.com/golang/protobuf/blob/master/jsonpb/jsonpb.go) has
+// similar functionality, but only for direct translation from proto messages
+// to JSON.
+type JSONFloat64 float64
+
+func (f *JSONFloat64) UnmarshalJSON(data []byte) error {
+ var ff float64
+ if err := json.Unmarshal(data, &ff); err == nil {
+ *f = JSONFloat64(ff)
+ return nil
+ }
+ var s string
+ if err := json.Unmarshal(data, &s); err == nil {
+ switch s {
+ case "NaN":
+ ff = math.NaN()
+ case "Infinity":
+ ff = math.Inf(1)
+ case "-Infinity":
+ ff = math.Inf(-1)
+ default:
+ return fmt.Errorf("google.golang.org/api/internal: bad float string %q", s)
+ }
+ *f = JSONFloat64(ff)
+ return nil
+ }
+ return errors.New("google.golang.org/api/internal: data not float or string")
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go
new file mode 100644
index 000000000..7bddd7a42
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go
@@ -0,0 +1,310 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "mime"
+ "mime/multipart"
+ "net/http"
+ "net/textproto"
+ "strings"
+ "sync"
+ "time"
+
+ gax "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+)
+
+type typeReader struct {
+ io.Reader
+ typ string
+}
+
+// multipartReader combines the contents of multiple readers to create a multipart/related HTTP body.
+// Close must be called if reads from the multipartReader are abandoned before reaching EOF.
+type multipartReader struct {
+ pr *io.PipeReader
+ ctype string
+ mu sync.Mutex
+ pipeOpen bool
+}
+
+// boundary optionally specifies the MIME boundary
+func newMultipartReader(parts []typeReader, boundary string) *multipartReader {
+ mp := &multipartReader{pipeOpen: true}
+ var pw *io.PipeWriter
+ mp.pr, pw = io.Pipe()
+ mpw := multipart.NewWriter(pw)
+ if boundary != "" {
+ mpw.SetBoundary(boundary)
+ }
+ mp.ctype = "multipart/related; boundary=" + mpw.Boundary()
+ go func() {
+ for _, part := range parts {
+ w, err := mpw.CreatePart(typeHeader(part.typ))
+ if err != nil {
+ mpw.Close()
+ pw.CloseWithError(fmt.Errorf("googleapi: CreatePart failed: %v", err))
+ return
+ }
+ _, err = io.Copy(w, part.Reader)
+ if err != nil {
+ mpw.Close()
+ pw.CloseWithError(fmt.Errorf("googleapi: Copy failed: %v", err))
+ return
+ }
+ }
+
+ mpw.Close()
+ pw.Close()
+ }()
+ return mp
+}
+
+func (mp *multipartReader) Read(data []byte) (n int, err error) {
+ return mp.pr.Read(data)
+}
+
+func (mp *multipartReader) Close() error {
+ mp.mu.Lock()
+ if !mp.pipeOpen {
+ mp.mu.Unlock()
+ return nil
+ }
+ mp.pipeOpen = false
+ mp.mu.Unlock()
+ return mp.pr.Close()
+}
+
+// CombineBodyMedia combines a json body with media content to create a multipart/related HTTP body.
+// It returns a ReadCloser containing the combined body, and the overall "multipart/related" content type, with random boundary.
+//
+// The caller must call Close on the returned ReadCloser if reads are abandoned before reaching EOF.
+func CombineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType string) (io.ReadCloser, string) {
+ return combineBodyMedia(body, bodyContentType, media, mediaContentType, "")
+}
+
+// combineBodyMedia is CombineBodyMedia but with an optional mimeBoundary field.
+func combineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType, mimeBoundary string) (io.ReadCloser, string) {
+ mp := newMultipartReader([]typeReader{
+ {body, bodyContentType},
+ {media, mediaContentType},
+ }, mimeBoundary)
+ return mp, mp.ctype
+}
+
+func typeHeader(contentType string) textproto.MIMEHeader {
+ h := make(textproto.MIMEHeader)
+ if contentType != "" {
+ h.Set("Content-Type", contentType)
+ }
+ return h
+}
+
+// PrepareUpload determines whether the data in the supplied reader should be
+// uploaded in a single request, or in sequential chunks.
+// chunkSize is the size of the chunk that media should be split into.
+//
+// If chunkSize is zero, media is returned as the first value, and the other
+// two return values are nil, true.
+//
+// Otherwise, a MediaBuffer is returned, along with a bool indicating whether the
+// contents of media fit in a single chunk.
+//
+// After PrepareUpload has been called, media should no longer be used: the
+// media content should be accessed via one of the return values.
+func PrepareUpload(media io.Reader, chunkSize int) (r io.Reader, mb *MediaBuffer, singleChunk bool) {
+ if chunkSize == 0 { // do not chunk
+ return media, nil, true
+ }
+ mb = NewMediaBuffer(media, chunkSize)
+ _, _, _, err := mb.Chunk()
+ // If err is io.EOF, we can upload this in a single request. Otherwise, err is
+ // either nil or a non-EOF error. If it is the latter, then the next call to
+ // mb.Chunk will return the same error. Returning a MediaBuffer ensures that this
+ // error will be handled at some point.
+ return nil, mb, err == io.EOF
+}
+
+// MediaInfo holds information for media uploads. It is intended for use by generated
+// code only.
+type MediaInfo struct {
+ // At most one of Media and MediaBuffer will be set.
+ media io.Reader
+ buffer *MediaBuffer
+ singleChunk bool
+ mType string
+ size int64 // mediaSize, if known. Used only for calls to progressUpdater_.
+ progressUpdater googleapi.ProgressUpdater
+ chunkRetryDeadline time.Duration
+}
+
+// NewInfoFromMedia should be invoked from the Media method of a call. It returns a
+// MediaInfo populated with chunk size and content type, and a reader or MediaBuffer
+// if needed.
+func NewInfoFromMedia(r io.Reader, options []googleapi.MediaOption) *MediaInfo {
+ mi := &MediaInfo{}
+ opts := googleapi.ProcessMediaOptions(options)
+ if !opts.ForceEmptyContentType {
+ mi.mType = opts.ContentType
+ if mi.mType == "" {
+ r, mi.mType = gax.DetermineContentType(r)
+ }
+ }
+ mi.chunkRetryDeadline = opts.ChunkRetryDeadline
+ mi.media, mi.buffer, mi.singleChunk = PrepareUpload(r, opts.ChunkSize)
+ return mi
+}
+
+// NewInfoFromResumableMedia should be invoked from the ResumableMedia method of a
+// call. It returns a MediaInfo using the given reader, size and media type.
+func NewInfoFromResumableMedia(r io.ReaderAt, size int64, mediaType string) *MediaInfo {
+ rdr := ReaderAtToReader(r, size)
+ mType := mediaType
+ if mType == "" {
+ rdr, mType = gax.DetermineContentType(rdr)
+ }
+
+ return &MediaInfo{
+ size: size,
+ mType: mType,
+ buffer: NewMediaBuffer(rdr, googleapi.DefaultUploadChunkSize),
+ media: nil,
+ singleChunk: false,
+ }
+}
+
+// SetProgressUpdater sets the progress updater for the media info.
+func (mi *MediaInfo) SetProgressUpdater(pu googleapi.ProgressUpdater) {
+ if mi != nil {
+ mi.progressUpdater = pu
+ }
+}
+
+// UploadType determines the type of upload: a single request, or a resumable
+// series of requests.
+func (mi *MediaInfo) UploadType() string {
+ if mi.singleChunk {
+ return "multipart"
+ }
+ return "resumable"
+}
+
+// UploadRequest sets up an HTTP request for media upload. It adds headers
+// as necessary, and returns a replacement for the body and a function for http.Request.GetBody.
+func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newBody io.Reader, getBody func() (io.ReadCloser, error), cleanup func()) {
+ cleanup = func() {}
+ if mi == nil {
+ return body, nil, cleanup
+ }
+ var media io.Reader
+ if mi.media != nil {
+ // This only happens when the caller has turned off chunking. In that
+ // case, we write all of media in a single non-retryable request.
+ media = mi.media
+ } else if mi.singleChunk {
+ // The data fits in a single chunk, which has now been read into the MediaBuffer.
+ // We obtain that chunk so we can write it in a single request. The request can
+ // be retried because the data is stored in the MediaBuffer.
+ media, _, _, _ = mi.buffer.Chunk()
+ }
+ toCleanup := []io.Closer{}
+ if media != nil {
+ fb := readerFunc(body)
+ fm := readerFunc(media)
+ combined, ctype := CombineBodyMedia(body, "application/json", media, mi.mType)
+ toCleanup = append(toCleanup, combined)
+ if fb != nil && fm != nil {
+ getBody = func() (io.ReadCloser, error) {
+ rb := io.NopCloser(fb())
+ rm := io.NopCloser(fm())
+ var mimeBoundary string
+ if _, params, err := mime.ParseMediaType(ctype); err == nil {
+ mimeBoundary = params["boundary"]
+ }
+ r, _ := combineBodyMedia(rb, "application/json", rm, mi.mType, mimeBoundary)
+ toCleanup = append(toCleanup, r)
+ return r, nil
+ }
+ }
+ reqHeaders.Set("Content-Type", ctype)
+ body = combined
+ }
+ if mi.buffer != nil && mi.mType != "" && !mi.singleChunk {
+ // This happens when initiating a resumable upload session.
+ // The initial request contains a JSON body rather than media.
+ // It can be retried with a getBody function that re-creates the request body.
+ fb := readerFunc(body)
+ if fb != nil {
+ getBody = func() (io.ReadCloser, error) {
+ rb := io.NopCloser(fb())
+ toCleanup = append(toCleanup, rb)
+ return rb, nil
+ }
+ }
+ reqHeaders.Set("X-Upload-Content-Type", mi.mType)
+ }
+ // Ensure that any bodies created in getBody are cleaned up.
+ cleanup = func() {
+ for _, closer := range toCleanup {
+ _ = closer.Close()
+ }
+ }
+ return body, getBody, cleanup
+}
+
+// readerFunc returns a function that always returns an io.Reader that has the same
+// contents as r, provided that can be done without consuming r. Otherwise, it
+// returns nil.
+// See http.NewRequest (in net/http/request.go).
+func readerFunc(r io.Reader) func() io.Reader {
+ switch r := r.(type) {
+ case *bytes.Buffer:
+ buf := r.Bytes()
+ return func() io.Reader { return bytes.NewReader(buf) }
+ case *bytes.Reader:
+ snapshot := *r
+ return func() io.Reader { r := snapshot; return &r }
+ case *strings.Reader:
+ snapshot := *r
+ return func() io.Reader { r := snapshot; return &r }
+ default:
+ return nil
+ }
+}
+
+// ResumableUpload returns an appropriately configured ResumableUpload value if the
+// upload is resumable, or nil otherwise.
+func (mi *MediaInfo) ResumableUpload(locURI string) *ResumableUpload {
+ if mi == nil || mi.singleChunk {
+ return nil
+ }
+ return &ResumableUpload{
+ URI: locURI,
+ Media: mi.buffer,
+ MediaType: mi.mType,
+ Callback: func(curr int64) {
+ if mi.progressUpdater != nil {
+ mi.progressUpdater(curr, mi.size)
+ }
+ },
+ ChunkRetryDeadline: mi.chunkRetryDeadline,
+ }
+}
+
+// SetGetBody sets the GetBody field of req to f. This was once needed
+// to gracefully support Go 1.7 and earlier which didn't have that
+// field.
+//
+// Deprecated: the code generator no longer uses this as of
+// 2019-02-19. Nothing else should be calling this anyway, but we
+// won't delete this immediately; it will be deleted in as early as 6
+// months.
+func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {
+ req.GetBody = f
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go
new file mode 100644
index 000000000..5f31bc12d
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go
@@ -0,0 +1,77 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "net/http"
+ "net/url"
+
+ "google.golang.org/api/googleapi"
+)
+
+// URLParams is a simplified replacement for url.Values
+// that safely builds up URL parameters for encoding.
+type URLParams map[string][]string
+
+// Get returns the first value for the given key, or "".
+func (u URLParams) Get(key string) string {
+ vs := u[key]
+ if len(vs) == 0 {
+ return ""
+ }
+ return vs[0]
+}
+
+// Set sets the key to value.
+// It replaces any existing values.
+func (u URLParams) Set(key, value string) {
+ u[key] = []string{value}
+}
+
+// SetMulti sets the key to an array of values.
+// It replaces any existing values.
+// Note that values must not be modified after calling SetMulti
+// so the caller is responsible for making a copy if necessary.
+func (u URLParams) SetMulti(key string, values []string) {
+ u[key] = values
+}
+
+// Encode encodes the values into “URL encoded” form
+// ("bar=baz&foo=quux") sorted by key.
+func (u URLParams) Encode() string {
+ return url.Values(u).Encode()
+}
+
+// SetOptions sets the URL params and any additional `CallOption` or
+// `MultiCallOption` passed in.
+func SetOptions(u URLParams, opts ...googleapi.CallOption) {
+ for _, o := range opts {
+ m, ok := o.(googleapi.MultiCallOption)
+ if ok {
+ u.SetMulti(m.GetMulti())
+ continue
+ }
+ u.Set(o.Get())
+ }
+}
+
+// SetHeaders sets common headers for all requests. The keyvals header pairs
+// should have a corresponding value for every key provided. If there is an odd
+// number of keyvals this method will panic.
+func SetHeaders(userAgent, contentType string, userHeaders http.Header, keyvals ...string) http.Header {
+ reqHeaders := make(http.Header)
+ reqHeaders.Set("x-goog-api-client", "gl-go/"+GoVersion()+" gdcl/"+"0.179.0")
+ for i := 0; i < len(keyvals); i = i + 2 {
+ reqHeaders.Set(keyvals[i], keyvals[i+1])
+ }
+ reqHeaders.Set("User-Agent", userAgent)
+ if contentType != "" {
+ reqHeaders.Set("Content-Type", contentType)
+ }
+ for k, v := range userHeaders {
+ reqHeaders[k] = v
+ }
+ return reqHeaders
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go
new file mode 100644
index 000000000..3ffa632a6
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go
@@ -0,0 +1,267 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/google/uuid"
+)
+
+// ResumableUpload is used by the generated APIs to provide resumable uploads.
+// It is not used by developers directly.
+type ResumableUpload struct {
+ Client *http.Client
+ // URI is the resumable resource destination provided by the server after specifying "&uploadType=resumable".
+ URI string
+ UserAgent string // User-Agent for header of the request
+ // Media is the object being uploaded.
+ Media *MediaBuffer
+ // MediaType defines the media type, e.g. "image/jpeg".
+ MediaType string
+
+ mu sync.Mutex // guards progress
+ progress int64 // number of bytes uploaded so far
+
+ // Callback is an optional function that will be periodically called with the cumulative number of bytes uploaded.
+ Callback func(int64)
+
+ // Retry optionally configures retries for requests made against the upload.
+ Retry *RetryConfig
+
+ // ChunkRetryDeadline configures the per-chunk deadline after which no further
+ // retries should happen.
+ ChunkRetryDeadline time.Duration
+
+ // Track current request invocation ID and attempt count for retry metrics
+ // and idempotency headers.
+ invocationID string
+ attempts int
+}
+
+// Progress returns the number of bytes uploaded at this point.
+func (rx *ResumableUpload) Progress() int64 {
+ rx.mu.Lock()
+ defer rx.mu.Unlock()
+ return rx.progress
+}
+
+// doUploadRequest performs a single HTTP request to upload data.
+// off specifies the offset in rx.Media from which data is drawn.
+// size is the number of bytes in data.
+// final specifies whether data is the final chunk to be uploaded.
+func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader, off, size int64, final bool) (*http.Response, error) {
+ req, err := http.NewRequest("POST", rx.URI, data)
+ if err != nil {
+ return nil, err
+ }
+
+ req.ContentLength = size
+ var contentRange string
+ if final {
+ if size == 0 {
+ contentRange = fmt.Sprintf("bytes */%v", off)
+ } else {
+ contentRange = fmt.Sprintf("bytes %v-%v/%v", off, off+size-1, off+size)
+ }
+ } else {
+ contentRange = fmt.Sprintf("bytes %v-%v/*", off, off+size-1)
+ }
+ req.Header.Set("Content-Range", contentRange)
+ req.Header.Set("Content-Type", rx.MediaType)
+ req.Header.Set("User-Agent", rx.UserAgent)
+
+ // TODO(b/274504690): Consider dropping gccl-invocation-id key since it
+ // duplicates the X-Goog-Gcs-Idempotency-Token header (added in v0.115.0).
+ baseXGoogHeader := "gl-go/" + GoVersion() + " gdcl/" + "0.179.0"
+ invocationHeader := fmt.Sprintf("gccl-invocation-id/%s gccl-attempt-count/%d", rx.invocationID, rx.attempts)
+ req.Header.Set("X-Goog-Api-Client", strings.Join([]string{baseXGoogHeader, invocationHeader}, " "))
+
+ // Set idempotency token header which is used by GCS uploads.
+ req.Header.Set("X-Goog-Gcs-Idempotency-Token", rx.invocationID)
+
+ // Google's upload endpoint uses status code 308 for a
+ // different purpose than the "308 Permanent Redirect"
+ // since-standardized in RFC 7238. Because of the conflict in
+ // semantics, Google added this new request header which
+ // causes it to not use "308" and instead reply with 200 OK
+ // and sets the upload-specific "X-HTTP-Status-Code-Override:
+ // 308" response header.
+ req.Header.Set("X-GUploader-No-308", "yes")
+
+ return SendRequest(ctx, rx.Client, req)
+}
+
+func statusResumeIncomplete(resp *http.Response) bool {
+ // This is how the server signals "status resume incomplete"
+ // when X-GUploader-No-308 is set to "yes":
+ return resp != nil && resp.Header.Get("X-Http-Status-Code-Override") == "308"
+}
+
+// reportProgress calls a user-supplied callback to report upload progress.
+// If old==updated, the callback is not called.
+func (rx *ResumableUpload) reportProgress(old, updated int64) {
+ if updated-old == 0 {
+ return
+ }
+ rx.mu.Lock()
+ rx.progress = updated
+ rx.mu.Unlock()
+ if rx.Callback != nil {
+ rx.Callback(updated)
+ }
+}
+
+// transferChunk performs a single HTTP request to upload a single chunk from rx.Media.
+func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, error) {
+ chunk, off, size, err := rx.Media.Chunk()
+
+ done := err == io.EOF
+ if !done && err != nil {
+ return nil, err
+ }
+
+ res, err := rx.doUploadRequest(ctx, chunk, off, int64(size), done)
+ if err != nil {
+ return res, err
+ }
+
+ // We sent "X-GUploader-No-308: yes" (see comment elsewhere in
+ // this file), so we don't expect to get a 308.
+ if res.StatusCode == 308 {
+ return nil, errors.New("unexpected 308 response status code")
+ }
+
+ if res.StatusCode == http.StatusOK {
+ rx.reportProgress(off, off+int64(size))
+ }
+
+ if statusResumeIncomplete(res) {
+ rx.Media.Next()
+ }
+ return res, nil
+}
+
+// Upload starts the process of a resumable upload with a cancellable context.
+// It retries using the provided back off strategy until cancelled or the
+// strategy indicates to stop retrying.
+// It is called from the auto-generated API code and is not visible to the user.
+// Before sending an HTTP request, Upload calls any registered hook functions,
+// and calls the returned functions after the request returns (see send.go).
+// rx is private to the auto-generated API code.
+// Exactly one of resp or err will be nil. If resp is non-nil, the caller must call resp.Body.Close.
+func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err error) {
+ // There are a couple of cases where it's possible for err and resp to both
+ // be non-nil. However, we expose a simpler contract to our callers: exactly
+ // one of resp and err will be non-nil. This means that any response body
+ // must be closed here before returning a non-nil error.
+ prepareReturn := func(resp *http.Response, err error) (*http.Response, error) {
+ if err != nil {
+ if resp != nil && resp.Body != nil {
+ resp.Body.Close()
+ }
+ return nil, err
+ }
+ // This case is very unlikely but possible only if rx.ChunkRetryDeadline is
+ // set to a very small value, in which case no requests will be sent before
+ // the deadline. Return an error to avoid causing a panic.
+ if resp == nil {
+ return nil, fmt.Errorf("upload request to %v not sent, choose larger value for ChunkRetryDealine", rx.URI)
+ }
+ return resp, nil
+ }
+ // Configure retryable error criteria.
+ errorFunc := rx.Retry.errorFunc()
+
+ // Configure per-chunk retry deadline.
+ var retryDeadline time.Duration
+ if rx.ChunkRetryDeadline != 0 {
+ retryDeadline = rx.ChunkRetryDeadline
+ } else {
+ retryDeadline = defaultRetryDeadline
+ }
+
+ // Send all chunks.
+ for {
+ var pause time.Duration
+
+ // Each chunk gets its own initialized-at-zero backoff and invocation ID.
+ bo := rx.Retry.backoff()
+ quitAfterTimer := time.NewTimer(retryDeadline)
+ rx.attempts = 1
+ rx.invocationID = uuid.New().String()
+
+ // Retry loop for a single chunk.
+ for {
+ pauseTimer := time.NewTimer(pause)
+ select {
+ case <-ctx.Done():
+ quitAfterTimer.Stop()
+ pauseTimer.Stop()
+ if err == nil {
+ err = ctx.Err()
+ }
+ return prepareReturn(resp, err)
+ case <-pauseTimer.C:
+ case <-quitAfterTimer.C:
+ pauseTimer.Stop()
+ return prepareReturn(resp, err)
+ }
+ pauseTimer.Stop()
+
+ // Check for context cancellation or timeout once more. If more than one
+ // case in the select statement above was satisfied at the same time, Go
+ // will choose one arbitrarily.
+ // That can cause an operation to go through even if the context was
+ // canceled before or the timeout was reached.
+ select {
+ case <-ctx.Done():
+ quitAfterTimer.Stop()
+ if err == nil {
+ err = ctx.Err()
+ }
+ return prepareReturn(resp, err)
+ case <-quitAfterTimer.C:
+ return prepareReturn(resp, err)
+ default:
+ }
+
+ resp, err = rx.transferChunk(ctx)
+
+ var status int
+ if resp != nil {
+ status = resp.StatusCode
+ }
+
+ // Check if we should retry the request.
+ if !errorFunc(status, err) {
+ quitAfterTimer.Stop()
+ break
+ }
+
+ rx.attempts++
+ pause = bo.Pause()
+ if resp != nil && resp.Body != nil {
+ resp.Body.Close()
+ }
+ }
+
+ // If the chunk was uploaded successfully, but there's still
+ // more to go, upload the next chunk without any delay.
+ if statusResumeIncomplete(resp) {
+ resp.Body.Close()
+ continue
+ }
+
+ return prepareReturn(resp, err)
+ }
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go
new file mode 100644
index 000000000..20b57d925
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go
@@ -0,0 +1,121 @@
+// Copyright 2021 Google LLC.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "errors"
+ "io"
+ "net"
+ "strings"
+ "time"
+
+ "github.com/googleapis/gax-go/v2"
+ "google.golang.org/api/googleapi"
+)
+
+// Backoff is an interface around gax.Backoff's Pause method, allowing tests to provide their
+// own implementation.
+type Backoff interface {
+ Pause() time.Duration
+}
+
+// These are declared as global variables so that tests can overwrite them.
+var (
+ // Default per-chunk deadline for resumable uploads.
+ defaultRetryDeadline = 32 * time.Second
+ // Default backoff timer.
+ backoff = func() Backoff {
+ return &gax.Backoff{Initial: 100 * time.Millisecond}
+ }
+ // syscallRetryable is a platform-specific hook, specified in retryable_linux.go
+ syscallRetryable func(error) bool = func(err error) bool { return false }
+)
+
+const (
+ // statusTooManyRequests is returned by the storage API if the
+ // per-project limits have been temporarily exceeded. The request
+ // should be retried.
+ // https://cloud.google.com/storage/docs/json_api/v1/status-codes#standardcodes
+ statusTooManyRequests = 429
+
+ // statusRequestTimeout is returned by the storage API if the
+ // upload connection was broken. The request should be retried.
+ statusRequestTimeout = 408
+)
+
+// shouldRetry indicates whether an error is retryable for the purposes of this
+// package, unless a ShouldRetry func is specified by the RetryConfig instead.
+// It follows guidance from
+// https://cloud.google.com/storage/docs/exponential-backoff .
+func shouldRetry(status int, err error) bool {
+ if 500 <= status && status <= 599 {
+ return true
+ }
+ if status == statusTooManyRequests || status == statusRequestTimeout {
+ return true
+ }
+ if err == io.ErrUnexpectedEOF {
+ return true
+ }
+ // Transient network errors should be retried.
+ if syscallRetryable(err) {
+ return true
+ }
+ if err, ok := err.(interface{ Temporary() bool }); ok {
+ if err.Temporary() {
+ return true
+ }
+ }
+ var opErr *net.OpError
+ if errors.As(err, &opErr) {
+ if strings.Contains(opErr.Error(), "use of closed network connection") {
+ // TODO: check against net.ErrClosed (go 1.16+) instead of string
+ return true
+ }
+ }
+
+ // If Go 1.13 error unwrapping is available, use this to examine wrapped
+ // errors.
+ if err, ok := err.(interface{ Unwrap() error }); ok {
+ return shouldRetry(status, err.Unwrap())
+ }
+ return false
+}
+
+// RetryConfig allows configuration of backoff timing and retryable errors.
+type RetryConfig struct {
+ Backoff *gax.Backoff
+ ShouldRetry func(err error) bool
+}
+
+// Get a new backoff object based on the configured values.
+func (r *RetryConfig) backoff() Backoff {
+ if r == nil || r.Backoff == nil {
+ return backoff()
+ }
+ return &gax.Backoff{
+ Initial: r.Backoff.Initial,
+ Max: r.Backoff.Max,
+ Multiplier: r.Backoff.Multiplier,
+ }
+}
+
+// This is kind of hacky; it is necessary because ShouldRetry expects to
+// handle HTTP errors via googleapi.Error, but the error has not yet been
+// wrapped with a googleapi.Error at this layer, and the ErrorFunc type
+// in the manual layer does not pass in a status explicitly as it does
+// here. So, we must wrap error status codes in a googleapi.Error so that
+// ShouldRetry can parse this correctly.
+func (r *RetryConfig) errorFunc() func(status int, err error) bool {
+ if r == nil || r.ShouldRetry == nil {
+ return shouldRetry
+ }
+ return func(status int, err error) bool {
+ if status >= 400 {
+ return r.ShouldRetry(&googleapi.Error{Code: status})
+ }
+ return r.ShouldRetry(err)
+ }
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go
new file mode 100644
index 000000000..a916c3da2
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go
@@ -0,0 +1,16 @@
+// Copyright 2020 Google LLC.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build linux
+// +build linux
+
+package gensupport
+
+import "syscall"
+
+func init() {
+ // Initialize syscallRetryable to return true on transient socket-level
+ // errors. These errors are specific to Linux.
+ syscallRetryable = func(err error) bool { return err == syscall.ECONNRESET || err == syscall.ECONNREFUSED }
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go
new file mode 100644
index 000000000..f61b00f48
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go
@@ -0,0 +1,206 @@
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "strings"
+ "time"
+
+ "github.com/google/uuid"
+ "github.com/googleapis/gax-go/v2"
+ "github.com/googleapis/gax-go/v2/callctx"
+)
+
+// Use this error type to return an error which allows introspection of both
+// the context error and the error from the service.
+type wrappedCallErr struct {
+ ctxErr error
+ wrappedErr error
+}
+
+func (e wrappedCallErr) Error() string {
+ return fmt.Sprintf("retry failed with %v; last error: %v", e.ctxErr, e.wrappedErr)
+}
+
+func (e wrappedCallErr) Unwrap() error {
+ return e.wrappedErr
+}
+
+// Is allows errors.Is to match the error from the call as well as context
+// sentinel errors.
+func (e wrappedCallErr) Is(target error) bool {
+ return errors.Is(e.ctxErr, target) || errors.Is(e.wrappedErr, target)
+}
+
+// SendRequest sends a single HTTP request using the given client.
+// If ctx is non-nil, it calls all hooks, then sends the request with
+// req.WithContext, then calls any functions returned by the hooks in
+// reverse order.
+func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {
+ // Add headers set in context metadata.
+ if ctx != nil {
+ headers := callctx.HeadersFromContext(ctx)
+ for k, vals := range headers {
+ for _, v := range vals {
+ req.Header.Add(k, v)
+ }
+ }
+ }
+
+ // Disallow Accept-Encoding because it interferes with the automatic gzip handling
+ // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219.
+ if _, ok := req.Header["Accept-Encoding"]; ok {
+ return nil, errors.New("google api: custom Accept-Encoding headers not allowed")
+ }
+ if ctx == nil {
+ return client.Do(req)
+ }
+ return send(ctx, client, req)
+}
+
+func send(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {
+ if client == nil {
+ client = http.DefaultClient
+ }
+ resp, err := client.Do(req.WithContext(ctx))
+ // If we got an error, and the context has been canceled,
+ // the context's error is probably more useful.
+ if err != nil {
+ select {
+ case <-ctx.Done():
+ err = ctx.Err()
+ default:
+ }
+ }
+ return resp, err
+}
+
+// SendRequestWithRetry sends a single HTTP request using the given client,
+// with retries if a retryable error is returned.
+// If ctx is non-nil, it calls all hooks, then sends the request with
+// req.WithContext, then calls any functions returned by the hooks in
+// reverse order.
+func SendRequestWithRetry(ctx context.Context, client *http.Client, req *http.Request, retry *RetryConfig) (*http.Response, error) {
+ // Add headers set in context metadata.
+ if ctx != nil {
+ headers := callctx.HeadersFromContext(ctx)
+ for k, vals := range headers {
+ for _, v := range vals {
+ req.Header.Add(k, v)
+ }
+ }
+ }
+
+ // Disallow Accept-Encoding because it interferes with the automatic gzip handling
+ // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219.
+ if _, ok := req.Header["Accept-Encoding"]; ok {
+ return nil, errors.New("google api: custom Accept-Encoding headers not allowed")
+ }
+ if ctx == nil {
+ return client.Do(req)
+ }
+ return sendAndRetry(ctx, client, req, retry)
+}
+
+func sendAndRetry(ctx context.Context, client *http.Client, req *http.Request, retry *RetryConfig) (*http.Response, error) {
+ if client == nil {
+ client = http.DefaultClient
+ }
+
+ var resp *http.Response
+ var err error
+ attempts := 1
+ invocationID := uuid.New().String()
+ baseXGoogHeader := req.Header.Get("X-Goog-Api-Client")
+
+ // Loop to retry the request, up to the context deadline.
+ var pause time.Duration
+ var bo Backoff
+ if retry != nil && retry.Backoff != nil {
+ bo = &gax.Backoff{
+ Initial: retry.Backoff.Initial,
+ Max: retry.Backoff.Max,
+ Multiplier: retry.Backoff.Multiplier,
+ }
+ } else {
+ bo = backoff()
+ }
+
+ errorFunc := retry.errorFunc()
+
+ for {
+ t := time.NewTimer(pause)
+ select {
+ case <-ctx.Done():
+ t.Stop()
+ // If we got an error and the context has been canceled, return an error acknowledging
+ // both the context cancelation and the service error.
+ if err != nil {
+ return resp, wrappedCallErr{ctx.Err(), err}
+ }
+ return resp, ctx.Err()
+ case <-t.C:
+ }
+
+ if ctx.Err() != nil {
+ // Check for context cancellation once more. If more than one case in a
+ // select is satisfied at the same time, Go will choose one arbitrarily.
+ // That can cause an operation to go through even if the context was
+ // canceled before.
+ if err != nil {
+ return resp, wrappedCallErr{ctx.Err(), err}
+ }
+ return resp, ctx.Err()
+ }
+
+ // Set retry metrics and idempotency headers for GCS.
+ // TODO(b/274504690): Consider dropping gccl-invocation-id key since it
+ // duplicates the X-Goog-Gcs-Idempotency-Token header (added in v0.115.0).
+ invocationHeader := fmt.Sprintf("gccl-invocation-id/%s gccl-attempt-count/%d", invocationID, attempts)
+ xGoogHeader := strings.Join([]string{invocationHeader, baseXGoogHeader}, " ")
+ req.Header.Set("X-Goog-Api-Client", xGoogHeader)
+ req.Header.Set("X-Goog-Gcs-Idempotency-Token", invocationID)
+
+ resp, err = client.Do(req.WithContext(ctx))
+
+ var status int
+ if resp != nil {
+ status = resp.StatusCode
+ }
+
+ // Check if we can retry the request. A retry can only be done if the error
+ // is retryable and the request body can be re-created using GetBody (this
+ // will not be possible if the body was unbuffered).
+ if req.GetBody == nil || !errorFunc(status, err) {
+ break
+ }
+ attempts++
+ var errBody error
+ req.Body, errBody = req.GetBody()
+ if errBody != nil {
+ break
+ }
+
+ pause = bo.Pause()
+ if resp != nil && resp.Body != nil {
+ resp.Body.Close()
+ }
+ }
+ return resp, err
+}
+
+// DecodeResponse decodes the body of res into target. If there is no body,
+// target is unchanged.
+func DecodeResponse(target interface{}, res *http.Response) error {
+ if res.StatusCode == http.StatusNoContent {
+ return nil
+ }
+ return json.NewDecoder(res.Body).Decode(target)
+}
diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go
new file mode 100644
index 000000000..23f6aa24e
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go
@@ -0,0 +1,53 @@
+// Copyright 2020 Google LLC. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gensupport
+
+import (
+ "runtime"
+ "strings"
+ "unicode"
+)
+
+// GoVersion returns the Go runtime version. The returned string
+// has no whitespace.
+func GoVersion() string {
+ return goVersion
+}
+
+var goVersion = goVer(runtime.Version())
+
+const develPrefix = "devel +"
+
+func goVer(s string) string {
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ s += "-" + prerelease
+ }
+ return s
+ }
+ return ""
+}
+
+func notSemverRune(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+}
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
new file mode 100644
index 000000000..bd549c2b6
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/internal/version.go
@@ -0,0 +1,8 @@
+// Copyright 2022 Google LLC. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package internal
+
+// Version is the current tagged release of the library.
+const Version = "0.13.0"
diff --git a/vendor/github.com/google/generative-ai-go/genai/license.txt b/vendor/github.com/google/generative-ai-go/genai/license.txt
new file mode 100644
index 000000000..b3b714d5e
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/license.txt
@@ -0,0 +1,14 @@
+// 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.
+
diff --git a/vendor/github.com/google/generative-ai-go/genai/list_models.go b/vendor/github.com/google/generative-ai-go/genai/list_models.go
new file mode 100644
index 000000000..fb232994c
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/genai/list_models.go
@@ -0,0 +1,50 @@
+// Copyright 2023 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package genai
+
+import (
+ "context"
+
+ gl "cloud.google.com/go/ai/generativelanguage/apiv1beta"
+ pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
+
+ "google.golang.org/api/iterator"
+)
+
+func (c *Client) ListModels(ctx context.Context) *ModelInfoIterator {
+ return &ModelInfoIterator{
+ it: c.mc.ListModels(ctx, &pb.ListModelsRequest{}),
+ }
+}
+
+// A ModelInfoIterator iterates over Models.
+type ModelInfoIterator struct {
+ it *gl.ModelIterator
+}
+
+// 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 *ModelInfoIterator) Next() (*ModelInfo, error) {
+ m, err := it.it.Next()
+ if err != nil {
+ return nil, err
+ }
+ return (ModelInfo{}).fromProto(m), nil
+}
+
+// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
+func (it *ModelInfoIterator) PageInfo() *iterator.PageInfo {
+ return it.it.PageInfo()
+}
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
new file mode 100644
index 000000000..e9f4b4547
--- /dev/null
+++ b/vendor/github.com/google/generative-ai-go/internal/support/support.go
@@ -0,0 +1,121 @@
+// 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/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
index 06282ce79..7a26fb5f6 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
index 958dcd87a..b8b836b00 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otelgrpc is the instrumentation library for [google.golang.org/grpc].
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
index 3b487a936..b129e3779 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
@@ -59,7 +48,7 @@ var (
)
// UnaryClientInterceptor returns a grpc.UnaryClientInterceptor suitable
-// for use in a grpc.Dial call.
+// for use in a grpc.NewClient call.
//
// Deprecated: Use [NewClientHandler] instead.
func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
@@ -196,7 +185,7 @@ func (w *clientStream) CloseSend() error {
return err
}
-func wrapClientStream(ctx context.Context, s grpc.ClientStream, desc *grpc.StreamDesc, span trace.Span, cfg *config) *clientStream {
+func wrapClientStream(s grpc.ClientStream, desc *grpc.StreamDesc, span trace.Span, cfg *config) *clientStream {
return &clientStream{
ClientStream: s,
span: span,
@@ -219,7 +208,7 @@ func (w *clientStream) endSpan(err error) {
}
// StreamClientInterceptor returns a grpc.StreamClientInterceptor suitable
-// for use in a grpc.Dial call.
+// for use in a grpc.NewClient call.
//
// Deprecated: Use [NewClientHandler] instead.
func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
@@ -270,7 +259,7 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
span.End()
return s, err
}
- stream := wrapClientStream(ctx, s, desc, span, cfg)
+ stream := wrapClientStream(s, desc, span, cfg)
return stream, nil
}
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
index f6116946b..b62f7cd7c 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
index cf32a9e97..bef07b7a3 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
index f585fb6ae..3aa37915d 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/metadata_supplier.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
index b65fab308..409c621b7 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
index 73d2b8b6b..c1c998746 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
index d633c4bef..29e6a4d9e 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/version.go
@@ -1,22 +1,11 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
// Version is the current release version of the gRPC instrumentation.
func Version() string {
- return "0.49.0"
+ return "0.51.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
index 92b8cf73c..deea14964 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
index cabf645a5..214acaf58 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
index a1b5b5e5a..c1015a9ec 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
index 38c7f01c7..56b24b982 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Package otelhttp provides an http.Handler and functions that are intended
// to be used to add tracing by wrapping existing handlers (with Handler) and
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
index 1fc15019e..c64f8beca 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go
@@ -1,32 +1,19 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
import (
- "io"
"net/http"
"time"
"github.com/felixge/httpsnoop"
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
"go.opentelemetry.io/otel"
- "go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
- semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
"go.opentelemetry.io/otel/trace"
)
@@ -46,6 +33,7 @@ type middleware struct {
publicEndpoint bool
publicEndpointFn func(*http.Request) bool
+ traceSemconv semconv.HTTPServer
requestBytesCounter metric.Int64Counter
responseBytesCounter metric.Int64Counter
serverLatencyMeasure metric.Float64Histogram
@@ -67,6 +55,8 @@ func NewHandler(handler http.Handler, operation string, opts ...Option) http.Han
func NewMiddleware(operation string, opts ...Option) func(http.Handler) http.Handler {
h := middleware{
operation: operation,
+
+ traceSemconv: semconv.NewHTTPServer(),
}
defaultOpts := []Option{
@@ -143,12 +133,9 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
ctx := h.propagators.Extract(r.Context(), propagation.HeaderCarrier(r.Header))
opts := []trace.SpanStartOption{
- trace.WithAttributes(semconvutil.HTTPServerRequest(h.server, r)...),
- }
- if h.server != "" {
- hostAttr := semconv.NetHostName(h.server)
- opts = append(opts, trace.WithAttributes(hostAttr))
+ trace.WithAttributes(h.traceSemconv.RequestTraceAttrs(h.server, r)...),
}
+
opts = append(opts, h.spanStartOptions...)
if h.publicEndpoint || (h.publicEndpointFn != nil && h.publicEndpointFn(r.WithContext(ctx))) {
opts = append(opts, trace.WithNewRoot())
@@ -224,7 +211,14 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
next.ServeHTTP(w, r.WithContext(ctx))
- setAfterServeAttributes(span, bw.read.Load(), rww.written, rww.statusCode, bw.err, rww.err)
+ span.SetStatus(semconv.ServerStatus(rww.statusCode))
+ span.SetAttributes(h.traceSemconv.ResponseTraceAttrs(semconv.ResponseTelemetry{
+ StatusCode: rww.statusCode,
+ ReadBytes: bw.read.Load(),
+ ReadError: bw.err,
+ WriteBytes: rww.written,
+ WriteError: rww.err,
+ })...)
// Add metrics
attributes := append(labeler.Get(), semconvutil.HTTPServerRequestMetrics(h.server, r)...)
@@ -241,37 +235,11 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http
h.serverLatencyMeasure.Record(ctx, elapsedTime, o)
}
-func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, rerr, werr error) {
- attributes := []attribute.KeyValue{}
-
- // TODO: Consider adding an event after each read and write, possibly as an
- // option (defaulting to off), so as to not create needlessly verbose spans.
- if read > 0 {
- attributes = append(attributes, ReadBytesKey.Int64(read))
- }
- if rerr != nil && rerr != io.EOF {
- attributes = append(attributes, ReadErrorKey.String(rerr.Error()))
- }
- if wrote > 0 {
- attributes = append(attributes, WroteBytesKey.Int64(wrote))
- }
- if statusCode > 0 {
- attributes = append(attributes, semconv.HTTPStatusCode(statusCode))
- }
- span.SetStatus(semconvutil.HTTPServerStatus(statusCode))
-
- if werr != nil && werr != io.EOF {
- attributes = append(attributes, WriteErrorKey.String(werr.Error()))
- }
- span.SetAttributes(attributes...)
-}
-
// WithRouteTag annotates spans and metrics with the provided route name
// with HTTP route attribute.
func WithRouteTag(route string, h http.Handler) http.Handler {
+ attr := semconv.NewHTTPServer().Route(route)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- attr := semconv.HTTPRouteKey.String(route)
-
span := trace.SpanFromContext(r.Context())
span.SetAttributes(attr)
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
new file mode 100644
index 000000000..9be3feef2
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go
@@ -0,0 +1,69 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "fmt"
+ "net/http"
+
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/codes"
+)
+
+type ResponseTelemetry struct {
+ StatusCode int
+ ReadBytes int64
+ ReadError error
+ WriteBytes int64
+ WriteError error
+}
+
+type HTTPServer interface {
+ // RequestTraceAttrs returns trace attributes for an HTTP request received by a
+ // server.
+ //
+ // The server must be the primary server name if it is known. For example this
+ // would be the ServerName directive
+ // (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+ // server, and the server_name directive
+ // (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+ // nginx server. More generically, the primary server name would be the host
+ // header value that matches the default virtual host of an HTTP server. It
+ // should include the host identifier and if a port is used to route to the
+ // server that port identifier should be included as an appropriate port
+ // suffix.
+ //
+ // If the primary server name is not known, server should be an empty string.
+ // The req Host will be used to determine the server instead.
+ RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue
+
+ // ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+ //
+ // If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+ ResponseTraceAttrs(ResponseTelemetry) []attribute.KeyValue
+
+ // Route returns the attribute for the route.
+ Route(string) attribute.KeyValue
+}
+
+// var warnOnce = sync.Once{}
+
+func NewHTTPServer() HTTPServer {
+ // TODO (#5331): Detect version based on environment variable OTEL_HTTP_CLIENT_COMPATIBILITY_MODE.
+ // TODO (#5331): Add warning of use of a deprecated version of Semantic Versions.
+ return oldHTTPServer{}
+}
+
+// ServerStatus returns a span status code and message for an HTTP status code
+// value returned by a server. Status codes in the 400-499 range are not
+// returned as errors.
+func ServerStatus(code int) (codes.Code, string) {
+ if code < 100 || code >= 600 {
+ return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code)
+ }
+ if code >= 500 {
+ return codes.Error, ""
+ }
+ return codes.Unset, ""
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
new file mode 100644
index 000000000..c92076bc3
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go
@@ -0,0 +1,49 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "net"
+ "strconv"
+ "strings"
+)
+
+// splitHostPort splits a network address hostport of the form "host",
+// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port",
+// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and
+// port.
+//
+// An empty host is returned if it is not provided or unparsable. A negative
+// port is returned if it is not provided or unparsable.
+func splitHostPort(hostport string) (host string, port int) {
+ port = -1
+
+ if strings.HasPrefix(hostport, "[") {
+ addrEnd := strings.LastIndex(hostport, "]")
+ if addrEnd < 0 {
+ // Invalid hostport.
+ return
+ }
+ if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 {
+ host = hostport[1:addrEnd]
+ return
+ }
+ } else {
+ if i := strings.LastIndex(hostport, ":"); i < 0 {
+ host = hostport
+ return
+ }
+ }
+
+ host, pStr, err := net.SplitHostPort(hostport)
+ if err != nil {
+ return
+ }
+
+ p, err := strconv.ParseUint(pStr, 10, 16)
+ if err != nil {
+ return
+ }
+ return host, int(p)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
new file mode 100644
index 000000000..d753083b7
--- /dev/null
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go
@@ -0,0 +1,75 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package semconv // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv"
+
+import (
+ "io"
+ "net/http"
+
+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
+ "go.opentelemetry.io/otel/attribute"
+ semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
+)
+
+type oldHTTPServer struct{}
+
+var _ HTTPServer = oldHTTPServer{}
+
+// RequestTraceAttrs returns trace attributes for an HTTP request received by a
+// server.
+//
+// The server must be the primary server name if it is known. For example this
+// would be the ServerName directive
+// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache
+// server, and the server_name directive
+// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an
+// nginx server. More generically, the primary server name would be the host
+// header value that matches the default virtual host of an HTTP server. It
+// should include the host identifier and if a port is used to route to the
+// server that port identifier should be included as an appropriate port
+// suffix.
+//
+// If the primary server name is not known, server should be an empty string.
+// The req Host will be used to determine the server instead.
+func (o oldHTTPServer) RequestTraceAttrs(server string, req *http.Request) []attribute.KeyValue {
+ return semconvutil.HTTPServerRequest(server, req)
+}
+
+// ResponseTraceAttrs returns trace attributes for telemetry from an HTTP response.
+//
+// If any of the fields in the ResponseTelemetry are not set the attribute will be omitted.
+func (o oldHTTPServer) ResponseTraceAttrs(resp ResponseTelemetry) []attribute.KeyValue {
+ attributes := []attribute.KeyValue{}
+
+ if resp.ReadBytes > 0 {
+ attributes = append(attributes, semconv.HTTPRequestContentLength(int(resp.ReadBytes)))
+ }
+ if resp.ReadError != nil && resp.ReadError != io.EOF {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.read_error", resp.ReadError.Error()))
+ }
+ if resp.WriteBytes > 0 {
+ attributes = append(attributes, semconv.HTTPResponseContentLength(int(resp.WriteBytes)))
+ }
+ if resp.StatusCode > 0 {
+ attributes = append(attributes, semconv.HTTPStatusCode(resp.StatusCode))
+ }
+ if resp.WriteError != nil && resp.WriteError != io.EOF {
+ // This is not in the semantic conventions, but is historically provided
+ attributes = append(attributes, attribute.String("http.write_error", resp.WriteError.Error()))
+ }
+
+ return attributes
+}
+
+// Route returns the attribute for the route.
+func (o oldHTTPServer) Route(route string) attribute.KeyValue {
+ return semconv.HTTPRoute(route)
+}
+
+// HTTPStatusCode returns the attribute for the HTTP status code.
+// This is a temporary function needed by metrics. This will be removed when MetricsRequest is added.
+func HTTPStatusCode(status int) attribute.KeyValue {
+ return semconv.HTTPStatusCode(status)
+}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
index edf4ce3d3..7aa5f99e8 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
index 0efd5261f..a73bb06e9 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go
@@ -2,18 +2,7 @@
// source: internal/shared/semconvutil/httpconv.go.tmpl
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
index d3a06e0ca..d5c0093fc 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go
@@ -2,17 +2,7 @@
// source: internal/shared/semconvutil/netconv.go.tmpl
// Copyright The OpenTelemetry Authors
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
index 26a51a180..1548b2db6 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
index 43e937a67..8a25e5865 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
index 35254e888..0fcc279de 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
@@ -1,22 +1,11 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
// Version is the current release version of the otelhttp instrumentation.
func Version() string {
- return "0.49.0"
+ return "0.51.0"
// This string is updated by the pre_release.sh script during release
}
diff --git a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
index 2852ec971..2f4cc124d 100644
--- a/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
+++ b/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/wrap.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
diff --git a/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
index 98f2d2043..cb28b36b9 100644
--- a/vendor/go.opentelemetry.io/otel/CHANGELOG.md
+++ b/vendor/go.opentelemetry.io/otel/CHANGELOG.md
@@ -8,6 +8,77 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
+## [1.26.0/0.48.0/0.2.0-alpha] 2024-04-24
+
+### Added
+
+- Add `Recorder` in `go.opentelemetry.io/otel/log/logtest` to facilitate testing the log bridge implementations. (#5134)
+- Add span flags to OTLP spans and links exported by `go.opentelemetry.io/otel/exporters/otlp/otlptrace`. (#5194)
+- Make the initial alpha release of `go.opentelemetry.io/otel/sdk/log`.
+ This new module contains the Go implementation of the OpenTelemetry Logs SDK.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`.
+ This new module contains an OTLP exporter that transmits log telemetry using HTTP.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- Make the initial alpha release of `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`.
+ This new module contains an exporter prints log records to STDOUT.
+ This module is unstable and breaking changes may be introduced.
+ See our [versioning policy](VERSIONING.md) for more information about these stability guarantees. (#5240)
+- The `go.opentelemetry.io/otel/semconv/v1.25.0` package.
+ The package contains semantic conventions from the `v1.25.0` version of the OpenTelemetry Semantic Conventions. (#5254)
+
+### Changed
+
+- Update `go.opentelemetry.io/proto/otlp` from v1.1.0 to v1.2.0. (#5177)
+- Improve performance of baggage member character validation in `go.opentelemetry.io/otel/baggage`. (#5214)
+
+## [1.25.0/0.47.0/0.0.8/0.1.0-alpha] 2024-04-05
+
+### Added
+
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4906)
+- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp`. (#4906)
+- Add `AddLink` method to the `Span` interface in `go.opentelemetry.io/otel/trace`. (#5032)
+- The `Enabled` method is added to the `Logger` interface in `go.opentelemetry.io/otel/log`.
+ This method is used to notify users if a log record will be emitted or not. (#5071)
+- Add `SeverityUndefined` `const` to `go.opentelemetry.io/otel/log`.
+ This value represents an unset severity level. (#5072)
+- Add `Empty` function in `go.opentelemetry.io/otel/log` to return a `KeyValue` for an empty value. (#5076)
+- Add `go.opentelemetry.io/otel/log/global` to manage the global `LoggerProvider`.
+ This package is provided with the anticipation that all functionality will be migrate to `go.opentelemetry.io/otel` when `go.opentelemetry.io/otel/log` stabilizes.
+ At which point, users will be required to migrage their code, and this package will be deprecated then removed. (#5085)
+- Add support for `Summary` metrics in the `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` exporters. (#5100)
+- Add `otel.scope.name` and `otel.scope.version` tags to spans exported by `go.opentelemetry.io/otel/exporters/zipkin`. (#5108)
+- Add support for `AddLink` to `go.opentelemetry.io/otel/bridge/opencensus`. (#5116)
+- Add `String` method to `Value` and `KeyValue` in `go.opentelemetry.io/otel/log`. (#5117)
+- Add Exemplar support to `go.opentelemetry.io/otel/exporters/prometheus`. (#5111)
+- Add metric semantic conventions to `go.opentelemetry.io/otel/semconv/v1.24.0`. Future `semconv` packages will include metric semantic conventions as well. (#4528)
+
+### Changed
+
+- `SpanFromContext` and `SpanContextFromContext` in `go.opentelemetry.io/otel/trace` no longer make a heap allocation when the passed context has no span. (#5049)
+- `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` now create a gRPC client in idle mode and with "dns" as the default resolver using [`grpc.NewClient`](https://pkg.go.dev/google.golang.org/grpc#NewClient). (#5151)
+ Because of that `WithDialOption` ignores [`grpc.WithBlock`](https://pkg.go.dev/google.golang.org/grpc#WithBlock), [`grpc.WithTimeout`](https://pkg.go.dev/google.golang.org/grpc#WithTimeout), and [`grpc.WithReturnConnectionError`](https://pkg.go.dev/google.golang.org/grpc#WithReturnConnectionError).
+ Notice that [`grpc.DialContext`](https://pkg.go.dev/google.golang.org/grpc#DialContext) which was used before is now deprecated.
+
+### Fixed
+
+- Clarify the documentation about equivalence guarantees for the `Set` and `Distinct` types in `go.opentelemetry.io/otel/attribute`. (#5027)
+- Prevent default `ErrorHandler` self-delegation. (#5137)
+- Update all dependencies to address [GO-2024-2687]. (#5139)
+
+### Removed
+
+- Drop support for [Go 1.20]. (#4967)
+
+### Deprecated
+
+- Deprecate `go.opentelemetry.io/otel/attribute.Sortable` type. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortable` function. (#4734)
+- Deprecate `go.opentelemetry.io/otel/attribute.NewSetWithSortableFiltered` function. (#4734)
+
## [1.24.0/0.46.0/0.0.1-alpha] 2024-02-23
This release is the last to support [Go 1.20].
@@ -22,6 +93,7 @@ The next release will require at least [Go 1.21].
This module includes OpenTelemetry Go's implementation of the Logs Bridge API.
This module is in an alpha state, it is subject to breaking changes.
See our [versioning policy](./VERSIONING.md) for more info. (#4961)
+- ARM64 platform to the compatibility testing suite. (#4994)
### Fixed
@@ -2849,7 +2921,9 @@ It contains api and sdk for trace and meter.
- CircleCI build CI manifest files.
- CODEOWNERS file to track owners of this project.
-[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.24.0...HEAD
+[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.26.0...HEAD
+[1.26.0/0.48.0/0.2.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.26.0
+[1.25.0/0.47.0/0.0.8/0.1.0-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.25.0
[1.24.0/0.46.0/0.0.1-alpha]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.24.0
[1.23.1]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.1
[1.23.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.23.0
@@ -2937,3 +3011,5 @@ It contains api and sdk for trace and meter.
[metric API]:https://pkg.go.dev/go.opentelemetry.io/otel/metric
[metric SDK]:https://pkg.go.dev/go.opentelemetry.io/otel/sdk/metric
[trace API]:https://pkg.go.dev/go.opentelemetry.io/otel/trace
+
+[GO-2024-2687]: https://pkg.go.dev/vuln/GO-2024-2687
diff --git a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
index c9f2bac55..7847b4590 100644
--- a/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
+++ b/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md
@@ -201,6 +201,16 @@ You can install and run a "local Go Doc site" in the following way:
[`go.opentelemetry.io/otel/metric`](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
is an example of a very well-documented package.
+### README files
+
+Each (non-internal, non-test, non-documentation) package must contain a
+`README.md` file containing at least a title, and a `pkg.go.dev` badge.
+
+The README should not be a repetition of Go doc comments.
+
+You can verify the presence of all README files with the `make verify-readmes`
+command.
+
## Style Guide
One of the primary goals of this project is that it is actually used by
diff --git a/vendor/go.opentelemetry.io/otel/Makefile b/vendor/go.opentelemetry.io/otel/Makefile
index 6de95219b..ca2f0ad03 100644
--- a/vendor/go.opentelemetry.io/otel/Makefile
+++ b/vendor/go.opentelemetry.io/otel/Makefile
@@ -1,16 +1,5 @@
# Copyright The OpenTelemetry Authors
-#
-# 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.
+# SPDX-License-Identifier: Apache-2.0
TOOLS_MOD_DIR := ./internal/tools
@@ -25,8 +14,8 @@ TIMEOUT = 60
.DEFAULT_GOAL := precommit
.PHONY: precommit ci
-precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix test-default
-ci: generate dependabot-check license-check lint vanity-import-check build test-default check-clean-work-tree test-coverage
+precommit: generate dependabot-generate license-check misspell go-mod-tidy golangci-lint-fix verify-readmes test-default
+ci: generate dependabot-check license-check lint vanity-import-check verify-readmes build test-default check-clean-work-tree test-coverage
# Tools
@@ -34,7 +23,7 @@ TOOLS = $(CURDIR)/.tools
$(TOOLS):
@mkdir -p $@
-$(TOOLS)/%: | $(TOOLS)
+$(TOOLS)/%: $(TOOLS_MOD_DIR)/go.mod | $(TOOLS)
cd $(TOOLS_MOD_DIR) && \
$(GO) build -o $@ $(PACKAGE)
@@ -110,7 +99,7 @@ $(PYTOOLS):
@$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip"
# Install python packages into the virtual environment.
-$(PYTOOLS)/%: | $(PYTOOLS)
+$(PYTOOLS)/%: $(PYTOOLS)
@$(DOCKERPY) $(PIP) install -r requirements.txt
CODESPELL = $(PYTOOLS)/codespell
@@ -124,18 +113,18 @@ generate: go-generate vanity-import-fix
.PHONY: go-generate
go-generate: $(OTEL_GO_MOD_DIRS:%=go-generate/%)
go-generate/%: DIR=$*
-go-generate/%: | $(STRINGER) $(GOTMPL)
+go-generate/%: $(STRINGER) $(GOTMPL)
@echo "$(GO) generate $(DIR)/..." \
&& cd $(DIR) \
&& PATH="$(TOOLS):$${PATH}" $(GO) generate ./...
.PHONY: vanity-import-fix
-vanity-import-fix: | $(PORTO)
+vanity-import-fix: $(PORTO)
@$(PORTO) --include-internal -w .
# Generate go.work file for local development.
.PHONY: go-work
-go-work: | $(CROSSLINK)
+go-work: $(CROSSLINK)
$(CROSSLINK) work --root=$(shell pwd)
# Build
@@ -178,7 +167,7 @@ test/%:
COVERAGE_MODE = atomic
COVERAGE_PROFILE = coverage.out
.PHONY: test-coverage
-test-coverage: | $(GOCOVMERGE)
+test-coverage: $(GOCOVMERGE)
@set -e; \
printf "" > coverage.txt; \
for dir in $(ALL_COVERAGE_MOD_DIRS); do \
@@ -209,23 +198,23 @@ golangci-lint-fix: ARGS=--fix
golangci-lint-fix: golangci-lint
golangci-lint: $(OTEL_GO_MOD_DIRS:%=golangci-lint/%)
golangci-lint/%: DIR=$*
-golangci-lint/%: | $(GOLANGCI_LINT)
+golangci-lint/%: $(GOLANGCI_LINT)
@echo 'golangci-lint $(if $(ARGS),$(ARGS) ,)$(DIR)' \
&& cd $(DIR) \
&& $(GOLANGCI_LINT) run --allow-serial-runners $(ARGS)
.PHONY: crosslink
-crosslink: | $(CROSSLINK)
+crosslink: $(CROSSLINK)
@echo "Updating intra-repository dependencies in all go modules" \
&& $(CROSSLINK) --root=$(shell pwd) --prune
.PHONY: go-mod-tidy
go-mod-tidy: $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%)
go-mod-tidy/%: DIR=$*
-go-mod-tidy/%: | crosslink
+go-mod-tidy/%: crosslink
@echo "$(GO) mod tidy in $(DIR)" \
&& cd $(DIR) \
- && $(GO) mod tidy -compat=1.20
+ && $(GO) mod tidy -compat=1.21
.PHONY: lint-modules
lint-modules: go-mod-tidy
@@ -234,23 +223,23 @@ lint-modules: go-mod-tidy
lint: misspell lint-modules golangci-lint govulncheck
.PHONY: vanity-import-check
-vanity-import-check: | $(PORTO)
+vanity-import-check: $(PORTO)
@$(PORTO) --include-internal -l . || ( echo "(run: make vanity-import-fix)"; exit 1 )
.PHONY: misspell
-misspell: | $(MISSPELL)
+misspell: $(MISSPELL)
@$(MISSPELL) -w $(ALL_DOCS)
.PHONY: govulncheck
govulncheck: $(OTEL_GO_MOD_DIRS:%=govulncheck/%)
govulncheck/%: DIR=$*
-govulncheck/%: | $(GOVULNCHECK)
+govulncheck/%: $(GOVULNCHECK)
@echo "govulncheck ./... in $(DIR)" \
&& cd $(DIR) \
&& $(GOVULNCHECK) ./...
.PHONY: codespell
-codespell: | $(CODESPELL)
+codespell: $(CODESPELL)
@$(DOCKERPY) $(CODESPELL)
.PHONY: license-check
@@ -265,11 +254,11 @@ license-check:
DEPENDABOT_CONFIG = .github/dependabot.yml
.PHONY: dependabot-check
-dependabot-check: | $(DBOTCONF)
+dependabot-check: $(DBOTCONF)
@$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || ( echo "(run: make dependabot-generate)"; exit 1 )
.PHONY: dependabot-generate
-dependabot-generate: | $(DBOTCONF)
+dependabot-generate: $(DBOTCONF)
@$(DBOTCONF) generate > $(DEPENDABOT_CONFIG)
.PHONY: check-clean-work-tree
@@ -284,13 +273,14 @@ check-clean-work-tree:
SEMCONVPKG ?= "semconv/"
.PHONY: semconv-generate
-semconv-generate: | $(SEMCONVGEN) $(SEMCONVKIT)
+semconv-generate: $(SEMCONVGEN) $(SEMCONVKIT)
[ "$(TAG)" ] || ( echo "TAG unset: missing opentelemetry semantic-conventions tag"; exit 1 )
[ "$(OTEL_SEMCONV_REPO)" ] || ( echo "OTEL_SEMCONV_REPO unset: missing path to opentelemetry semantic-conventions repo"; exit 1 )
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=span -p conventionType=trace -f trace.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=attribute_group -p conventionType=trace -f attribute_group.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=event -p conventionType=event -f event.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
$(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=resource -p conventionType=resource -f resource.go -t "$(SEMCONVPKG)/template.j2" -s "$(TAG)"
+ $(SEMCONVGEN) -i "$(OTEL_SEMCONV_REPO)/model/." --only=metric -f metric.go -t "$(SEMCONVPKG)/metric_template.j2" -s "$(TAG)"
$(SEMCONVKIT) -output "$(SEMCONVPKG)/$(TAG)" -tag "$(TAG)"
.PHONY: gorelease
@@ -303,16 +293,20 @@ gorelease/%:| $(GORELEASE)
|| echo ""
.PHONY: prerelease
-prerelease: | $(MULTIMOD)
+prerelease: $(MULTIMOD)
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
$(MULTIMOD) verify && $(MULTIMOD) prerelease -m ${MODSET}
COMMIT ?= "HEAD"
.PHONY: add-tags
-add-tags: | $(MULTIMOD)
+add-tags: $(MULTIMOD)
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
$(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
.PHONY: lint-markdown
-lint-markdown:
+lint-markdown:
docker run -v "$(CURDIR):$(WORKDIR)" avtodev/markdown-lint:v1 -c $(WORKDIR)/.markdownlint.yaml $(WORKDIR)/**/*.md
+
+.PHONY: verify-readmes
+verify-readmes:
+ ./verify_readmes.sh
diff --git a/vendor/go.opentelemetry.io/otel/README.md b/vendor/go.opentelemetry.io/otel/README.md
index 7766259a5..47f9a41f6 100644
--- a/vendor/go.opentelemetry.io/otel/README.md
+++ b/vendor/go.opentelemetry.io/otel/README.md
@@ -51,19 +51,16 @@ Currently, this project supports the following environments.
|---------|------------|--------------|
| Ubuntu | 1.22 | amd64 |
| Ubuntu | 1.21 | amd64 |
-| Ubuntu | 1.20 | amd64 |
| Ubuntu | 1.22 | 386 |
| Ubuntu | 1.21 | 386 |
-| Ubuntu | 1.20 | 386 |
+| Linux | 1.22 | arm64 |
+| Linux | 1.21 | arm64 |
| MacOS | 1.22 | amd64 |
| MacOS | 1.21 | amd64 |
-| MacOS | 1.20 | amd64 |
| Windows | 1.22 | amd64 |
| Windows | 1.21 | amd64 |
-| Windows | 1.20 | amd64 |
| Windows | 1.22 | 386 |
| Windows | 1.21 | 386 |
-| Windows | 1.20 | 386 |
While this project should work for other systems, no compatibility guarantees
are made for those systems currently.
diff --git a/vendor/go.opentelemetry.io/otel/attribute/README.md b/vendor/go.opentelemetry.io/otel/attribute/README.md
new file mode 100644
index 000000000..5b3da8f14
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/attribute/README.md
@@ -0,0 +1,3 @@
+# Attribute
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/attribute)](https://pkg.go.dev/go.opentelemetry.io/otel/attribute)
diff --git a/vendor/go.opentelemetry.io/otel/attribute/doc.go b/vendor/go.opentelemetry.io/otel/attribute/doc.go
index dafe7424d..eef51ebc2 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/doc.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Package attribute provides key and value attributes.
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/encoder.go b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
index fe2bc5766..318e42fca 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/encoder.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/encoder.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/filter.go b/vendor/go.opentelemetry.io/otel/attribute/filter.go
index 638c213d5..be9cd922d 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/filter.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/filter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/iterator.go b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
index 841b271fb..f2ba89ce4 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/iterator.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/iterator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/key.go b/vendor/go.opentelemetry.io/otel/attribute/key.go
index 0656a04e4..d9a22c650 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/key.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/key.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/kv.go b/vendor/go.opentelemetry.io/otel/attribute/kv.go
index 1ddf3ce05..3028f9a40 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/kv.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/kv.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/attribute/set.go b/vendor/go.opentelemetry.io/otel/attribute/set.go
index fb6da5145..bff9c7fdb 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/set.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/set.go
@@ -1,24 +1,14 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
+ "cmp"
"encoding/json"
"reflect"
+ "slices"
"sort"
- "sync"
)
type (
@@ -26,23 +16,33 @@ type (
// immutable set of attributes, with an internal cache for storing
// attribute encodings.
//
- // This type supports the Equivalent method of comparison using values of
- // type Distinct.
+ // This type will remain comparable for backwards compatibility. The
+ // equivalence of Sets across versions is not guaranteed to be stable.
+ // Prior versions may find two Sets to be equal or not when compared
+ // directly (i.e. ==), but subsequent versions may not. Users should use
+ // the Equals method to ensure stable equivalence checking.
+ //
+ // Users should also use the Distinct returned from Equivalent as a map key
+ // instead of a Set directly. In addition to that type providing guarantees
+ // on stable equivalence, it may also provide performance improvements.
Set struct {
equivalent Distinct
}
- // Distinct wraps a variable-size array of KeyValue, constructed with keys
- // in sorted order. This can be used as a map key or for equality checking
- // between Sets.
+ // Distinct is a unique identifier of a Set.
+ //
+ // Distinct is designed to be ensures equivalence stability: comparisons
+ // will return the save value across versions. For this reason, Distinct
+ // should always be used as a map key instead of a Set.
Distinct struct {
iface interface{}
}
- // Sortable implements sort.Interface, used for sorting KeyValue. This is
- // an exported type to support a memory optimization. A pointer to one of
- // these is needed for the call to sort.Stable(), which the caller may
- // provide in order to avoid an allocation. See NewSetWithSortable().
+ // Sortable implements sort.Interface, used for sorting KeyValue.
+ //
+ // Deprecated: This type is no longer used. It was added as a performance
+ // optimization for Go < 1.21 that is no longer needed (Go < 1.21 is no
+ // longer supported by the module).
Sortable []KeyValue
)
@@ -56,12 +56,6 @@ var (
iface: [0]KeyValue{},
},
}
-
- // sortables is a pool of Sortables used to create Sets with a user does
- // not provide one.
- sortables = sync.Pool{
- New: func() interface{} { return new(Sortable) },
- }
)
// EmptySet returns a reference to a Set with no elements.
@@ -187,13 +181,7 @@ func empty() Set {
// Except for empty sets, this method adds an additional allocation compared
// with calls that include a Sortable.
func NewSet(kvs ...KeyValue) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- srt := sortables.Get().(*Sortable)
- s, _ := NewSetWithSortableFiltered(kvs, srt, nil)
- sortables.Put(srt)
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -201,12 +189,10 @@ func NewSet(kvs ...KeyValue) Set {
// NewSetWithSortableFiltered for more details.
//
// This call includes a Sortable option as a memory optimization.
-func NewSetWithSortable(kvs []KeyValue, tmp *Sortable) Set {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty()
- }
- s, _ := NewSetWithSortableFiltered(kvs, tmp, nil)
+//
+// Deprecated: Use [NewSet] instead.
+func NewSetWithSortable(kvs []KeyValue, _ *Sortable) Set {
+ s, _ := NewSetWithFiltered(kvs, nil)
return s
}
@@ -220,48 +206,12 @@ func NewSetWithFiltered(kvs []KeyValue, filter Filter) (Set, []KeyValue) {
if len(kvs) == 0 {
return empty(), nil
}
- srt := sortables.Get().(*Sortable)
- s, filtered := NewSetWithSortableFiltered(kvs, srt, filter)
- sortables.Put(srt)
- return s, filtered
-}
-
-// NewSetWithSortableFiltered returns a new Set.
-//
-// Duplicate keys are eliminated by taking the last value. This
-// re-orders the input slice so that unique last-values are contiguous
-// at the end of the slice.
-//
-// This ensures the following:
-//
-// - Last-value-wins semantics
-// - Caller sees the reordering, but doesn't lose values
-// - Repeated call preserve last-value wins.
-//
-// Note that methods are defined on Set, although this returns Set. Callers
-// can avoid memory allocations by:
-//
-// - allocating a Sortable for use as a temporary in this method
-// - allocating a Set for storing the return value of this constructor.
-//
-// The result maintains a cache of encoded attributes, by attribute.EncoderID.
-// This value should not be copied after its first use.
-//
-// The second []KeyValue return value is a list of attributes that were
-// excluded by the Filter (if non-nil).
-func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (Set, []KeyValue) {
- // Check for empty set.
- if len(kvs) == 0 {
- return empty(), nil
- }
-
- *tmp = kvs
// Stable sort so the following de-duplication can implement
// last-value-wins semantics.
- sort.Stable(tmp)
-
- *tmp = nil
+ slices.SortStableFunc(kvs, func(a, b KeyValue) int {
+ return cmp.Compare(a.Key, b.Key)
+ })
position := len(kvs) - 1
offset := position - 1
@@ -289,6 +239,35 @@ func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (S
return Set{equivalent: computeDistinct(kvs)}, nil
}
+// NewSetWithSortableFiltered returns a new Set.
+//
+// Duplicate keys are eliminated by taking the last value. This
+// re-orders the input slice so that unique last-values are contiguous
+// at the end of the slice.
+//
+// This ensures the following:
+//
+// - Last-value-wins semantics
+// - Caller sees the reordering, but doesn't lose values
+// - Repeated call preserve last-value wins.
+//
+// Note that methods are defined on Set, although this returns Set. Callers
+// can avoid memory allocations by:
+//
+// - allocating a Sortable for use as a temporary in this method
+// - allocating a Set for storing the return value of this constructor.
+//
+// The result maintains a cache of encoded attributes, by attribute.EncoderID.
+// This value should not be copied after its first use.
+//
+// The second []KeyValue return value is a list of attributes that were
+// excluded by the Filter (if non-nil).
+//
+// Deprecated: Use [NewSetWithFiltered] instead.
+func NewSetWithSortableFiltered(kvs []KeyValue, _ *Sortable, filter Filter) (Set, []KeyValue) {
+ return NewSetWithFiltered(kvs, filter)
+}
+
// filteredToFront filters slice in-place using keep function. All KeyValues that need to
// be removed are moved to the front. All KeyValues that need to be kept are
// moved (in-order) to the back. The index for the first KeyValue to be kept is
diff --git a/vendor/go.opentelemetry.io/otel/attribute/value.go b/vendor/go.opentelemetry.io/otel/attribute/value.go
index cb21dd5c0..b32031413 100644
--- a/vendor/go.opentelemetry.io/otel/attribute/value.go
+++ b/vendor/go.opentelemetry.io/otel/attribute/value.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
diff --git a/vendor/go.opentelemetry.io/otel/baggage/README.md b/vendor/go.opentelemetry.io/otel/baggage/README.md
new file mode 100644
index 000000000..7d798435e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/baggage/README.md
@@ -0,0 +1,3 @@
+# Baggage
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/baggage)](https://pkg.go.dev/go.opentelemetry.io/otel/baggage)
diff --git a/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
index 7d27cf77d..75773bc1c 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
@@ -19,6 +8,7 @@ import (
"fmt"
"net/url"
"strings"
+ "unicode/utf8"
"go.opentelemetry.io/otel/internal/baggage"
)
@@ -67,10 +57,10 @@ func NewKeyProperty(key string) (Property, error) {
// NewKeyValueProperty returns a new Property for key with value.
//
// The passed key must be compliant with W3C Baggage specification.
-// The passed value must be precent-encoded as defined in W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
//
// Notice: Consider using [NewKeyValuePropertyRaw] instead
-// that does not require precent-encoding of the value.
+// that does not require percent-encoding of the value.
func NewKeyValueProperty(key, value string) (Property, error) {
if !validateValue(value) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value)
@@ -232,13 +222,13 @@ type Member struct {
hasData bool
}
-// NewMemberRaw returns a new Member from the passed arguments.
+// NewMember returns a new Member from the passed arguments.
//
// The passed key must be compliant with W3C Baggage specification.
-// The passed value must be precent-encoded as defined in W3C Baggage specification.
+// The passed value must be percent-encoded as defined in W3C Baggage specification.
//
// Notice: Consider using [NewMemberRaw] instead
-// that does not require precent-encoding of the value.
+// that does not require percent-encoding of the value.
func NewMember(key, value string, props ...Property) (Member, error) {
if !validateValue(value) {
return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value)
@@ -309,7 +299,7 @@ func parseMember(member string) (Member, error) {
return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v)
}
- // Decode a precent-encoded value.
+ // Decode a percent-encoded value.
value, err := url.PathUnescape(val)
if err != nil {
return newInvalidMember(), fmt.Errorf("%w: %v", errInvalidValue, err)
@@ -616,7 +606,7 @@ func parsePropertyInternal(s string) (p Property, ok bool) {
return
}
- // Decode a precent-encoded value.
+ // Decode a percent-encoded value.
value, err := url.PathUnescape(s[valueStart:valueEnd])
if err != nil {
return
@@ -641,6 +631,95 @@ func skipSpace(s string, offset int) int {
return i
}
+var safeKeyCharset = [utf8.RuneSelf]bool{
+ // 0x23 to 0x27
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+
+ // 0x30 to 0x39
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+
+ // 0x41 to 0x5a
+ 'A': true,
+ 'B': true,
+ 'C': true,
+ 'D': true,
+ 'E': true,
+ 'F': true,
+ 'G': true,
+ 'H': true,
+ 'I': true,
+ 'J': true,
+ 'K': true,
+ 'L': true,
+ 'M': true,
+ 'N': true,
+ 'O': true,
+ 'P': true,
+ 'Q': true,
+ 'R': true,
+ 'S': true,
+ 'T': true,
+ 'U': true,
+ 'V': true,
+ 'W': true,
+ 'X': true,
+ 'Y': true,
+ 'Z': true,
+
+ // 0x5e to 0x7a
+ '^': true,
+ '_': true,
+ '`': true,
+ 'a': true,
+ 'b': true,
+ 'c': true,
+ 'd': true,
+ 'e': true,
+ 'f': true,
+ 'g': true,
+ 'h': true,
+ 'i': true,
+ 'j': true,
+ 'k': true,
+ 'l': true,
+ 'm': true,
+ 'n': true,
+ 'o': true,
+ 'p': true,
+ 'q': true,
+ 'r': true,
+ 's': true,
+ 't': true,
+ 'u': true,
+ 'v': true,
+ 'w': true,
+ 'x': true,
+ 'y': true,
+ 'z': true,
+
+ // remainder
+ '!': true,
+ '*': true,
+ '+': true,
+ '-': true,
+ '.': true,
+ '|': true,
+ '~': true,
+}
+
func validateKey(s string) bool {
if len(s) == 0 {
return false
@@ -656,17 +735,7 @@ func validateKey(s string) bool {
}
func validateKeyChar(c int32) bool {
- return (c >= 0x23 && c <= 0x27) ||
- (c >= 0x30 && c <= 0x39) ||
- (c >= 0x41 && c <= 0x5a) ||
- (c >= 0x5e && c <= 0x7a) ||
- c == 0x21 ||
- c == 0x2a ||
- c == 0x2b ||
- c == 0x2d ||
- c == 0x2e ||
- c == 0x7c ||
- c == 0x7e
+ return c >= 0 && c <= int32(utf8.RuneSelf) && safeKeyCharset[c]
}
func validateValue(s string) bool {
@@ -679,12 +748,109 @@ func validateValue(s string) bool {
return true
}
+var safeValueCharset = [utf8.RuneSelf]bool{
+ '!': true, // 0x21
+
+ // 0x23 to 0x2b
+ '#': true,
+ '$': true,
+ '%': true,
+ '&': true,
+ '\'': true,
+ '(': true,
+ ')': true,
+ '*': true,
+ '+': true,
+
+ // 0x2d to 0x3a
+ '-': true,
+ '.': true,
+ '/': true,
+ '0': true,
+ '1': true,
+ '2': true,
+ '3': true,
+ '4': true,
+ '5': true,
+ '6': true,
+ '7': true,
+ '8': true,
+ '9': true,
+ ':': true,
+
+ // 0x3c to 0x5b
+ '<': true, // 0x3C
+ '=': true, // 0x3D
+ '>': true, // 0x3E
+ '?': true, // 0x3F
+ '@': true, // 0x40
+ 'A': true, // 0x41
+ 'B': true, // 0x42
+ 'C': true, // 0x43
+ 'D': true, // 0x44
+ 'E': true, // 0x45
+ 'F': true, // 0x46
+ 'G': true, // 0x47
+ 'H': true, // 0x48
+ 'I': true, // 0x49
+ 'J': true, // 0x4A
+ 'K': true, // 0x4B
+ 'L': true, // 0x4C
+ 'M': true, // 0x4D
+ 'N': true, // 0x4E
+ 'O': true, // 0x4F
+ 'P': true, // 0x50
+ 'Q': true, // 0x51
+ 'R': true, // 0x52
+ 'S': true, // 0x53
+ 'T': true, // 0x54
+ 'U': true, // 0x55
+ 'V': true, // 0x56
+ 'W': true, // 0x57
+ 'X': true, // 0x58
+ 'Y': true, // 0x59
+ 'Z': true, // 0x5A
+ '[': true, // 0x5B
+
+ // 0x5d to 0x7e
+ ']': true, // 0x5D
+ '^': true, // 0x5E
+ '_': true, // 0x5F
+ '`': true, // 0x60
+ 'a': true, // 0x61
+ 'b': true, // 0x62
+ 'c': true, // 0x63
+ 'd': true, // 0x64
+ 'e': true, // 0x65
+ 'f': true, // 0x66
+ 'g': true, // 0x67
+ 'h': true, // 0x68
+ 'i': true, // 0x69
+ 'j': true, // 0x6A
+ 'k': true, // 0x6B
+ 'l': true, // 0x6C
+ 'm': true, // 0x6D
+ 'n': true, // 0x6E
+ 'o': true, // 0x6F
+ 'p': true, // 0x70
+ 'q': true, // 0x71
+ 'r': true, // 0x72
+ 's': true, // 0x73
+ 't': true, // 0x74
+ 'u': true, // 0x75
+ 'v': true, // 0x76
+ 'w': true, // 0x77
+ 'x': true, // 0x78
+ 'y': true, // 0x79
+ 'z': true, // 0x7A
+ '{': true, // 0x7B
+ '|': true, // 0x7C
+ '}': true, // 0x7D
+ '~': true, // 0x7E
+}
+
func validateValueChar(c int32) bool {
- return c == 0x21 ||
- (c >= 0x23 && c <= 0x2b) ||
- (c >= 0x2d && c <= 0x3a) ||
- (c >= 0x3c && c <= 0x5b) ||
- (c >= 0x5d && c <= 0x7e)
+ return c >= 0 && c <= int32(utf8.RuneSelf) && safeValueCharset[c]
}
// valueEscape escapes the string so it can be safely placed inside a baggage value,
diff --git a/vendor/go.opentelemetry.io/otel/baggage/context.go b/vendor/go.opentelemetry.io/otel/baggage/context.go
index 24b34b756..a572461a0 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/baggage/doc.go b/vendor/go.opentelemetry.io/otel/baggage/doc.go
index 4545100df..b51d87cab 100644
--- a/vendor/go.opentelemetry.io/otel/baggage/doc.go
+++ b/vendor/go.opentelemetry.io/otel/baggage/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides functionality for storing and retrieving
diff --git a/vendor/go.opentelemetry.io/otel/codes/README.md b/vendor/go.opentelemetry.io/otel/codes/README.md
new file mode 100644
index 000000000..24c52b387
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/codes/README.md
@@ -0,0 +1,3 @@
+# Codes
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/codes)](https://pkg.go.dev/go.opentelemetry.io/otel/codes)
diff --git a/vendor/go.opentelemetry.io/otel/codes/codes.go b/vendor/go.opentelemetry.io/otel/codes/codes.go
index 587ebae4e..df29d96a6 100644
--- a/vendor/go.opentelemetry.io/otel/codes/codes.go
+++ b/vendor/go.opentelemetry.io/otel/codes/codes.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package codes // import "go.opentelemetry.io/otel/codes"
diff --git a/vendor/go.opentelemetry.io/otel/codes/doc.go b/vendor/go.opentelemetry.io/otel/codes/doc.go
index 4e328fbb4..ee8db448b 100644
--- a/vendor/go.opentelemetry.io/otel/codes/doc.go
+++ b/vendor/go.opentelemetry.io/otel/codes/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package codes defines the canonical error codes used by OpenTelemetry.
diff --git a/vendor/go.opentelemetry.io/otel/doc.go b/vendor/go.opentelemetry.io/otel/doc.go
index 36d7c24e8..441c59501 100644
--- a/vendor/go.opentelemetry.io/otel/doc.go
+++ b/vendor/go.opentelemetry.io/otel/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package otel provides global access to the OpenTelemetry API. The subpackages of
diff --git a/vendor/go.opentelemetry.io/otel/error_handler.go b/vendor/go.opentelemetry.io/otel/error_handler.go
index 72fad8541..67414c71e 100644
--- a/vendor/go.opentelemetry.io/otel/error_handler.go
+++ b/vendor/go.opentelemetry.io/otel/error_handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
index 9a58fb1d3..93e80ea30 100644
--- a/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
+++ b/vendor/go.opentelemetry.io/otel/get_main_pkgs.sh
@@ -1,18 +1,7 @@
#!/usr/bin/env bash
# Copyright The OpenTelemetry Authors
-#
-# 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.
+# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
diff --git a/vendor/go.opentelemetry.io/otel/handler.go b/vendor/go.opentelemetry.io/otel/handler.go
index 4115fe3bb..07623b679 100644
--- a/vendor/go.opentelemetry.io/otel/handler.go
+++ b/vendor/go.opentelemetry.io/otel/handler.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
@@ -18,12 +7,8 @@ import (
"go.opentelemetry.io/otel/internal/global"
)
-var (
- // Compile-time check global.ErrDelegator implements ErrorHandler.
- _ ErrorHandler = (*global.ErrDelegator)(nil)
- // Compile-time check global.ErrLogger implements ErrorHandler.
- _ ErrorHandler = (*global.ErrLogger)(nil)
-)
+// Compile-time check global.ErrDelegator implements ErrorHandler.
+var _ ErrorHandler = (*global.ErrDelegator)(nil)
// GetErrorHandler returns the global ErrorHandler instance.
//
@@ -44,5 +29,5 @@ func GetErrorHandler() ErrorHandler { return global.GetErrorHandler() }
// delegate errors to h.
func SetErrorHandler(h ErrorHandler) { global.SetErrorHandler(h) }
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) { global.Handle(err) }
+// Handle is a convenience function for GetErrorHandler().Handle(err).
+func Handle(err error) { global.GetErrorHandler().Handle(err) }
diff --git a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
index 622c3ee3f..f32766e57 100644
--- a/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
+++ b/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package attribute provide several helper functions for some commonly used
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
index b96e5408e..b4f85f44a 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides base types and functionality to store and retrieve
diff --git a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
index 4469700d9..3aea9c491 100644
--- a/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
+++ b/vendor/go.opentelemetry.io/otel/internal/baggage/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/internal/baggage"
diff --git a/vendor/go.opentelemetry.io/otel/internal/gen.go b/vendor/go.opentelemetry.io/otel/internal/gen.go
index f532f07e9..4259f0320 100644
--- a/vendor/go.opentelemetry.io/otel/internal/gen.go
+++ b/vendor/go.opentelemetry.io/otel/internal/gen.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
index 5e9b83047..c657ff8e7 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/handler.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/handler.go
@@ -1,38 +1,13 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
import (
"log"
- "os"
"sync/atomic"
)
-var (
- // GlobalErrorHandler provides an ErrorHandler that can be used
- // throughout an OpenTelemetry instrumented project. When a user
- // specified ErrorHandler is registered (`SetErrorHandler`) all calls to
- // `Handle` and will be delegated to the registered ErrorHandler.
- GlobalErrorHandler = defaultErrorHandler()
-
- // Compile-time check that delegator implements ErrorHandler.
- _ ErrorHandler = (*ErrDelegator)(nil)
- // Compile-time check that errLogger implements ErrorHandler.
- _ ErrorHandler = (*ErrLogger)(nil)
-)
-
// ErrorHandler handles irremediable events.
type ErrorHandler interface {
// Handle handles any error deemed irremediable by an OpenTelemetry
@@ -44,59 +19,18 @@ type ErrDelegator struct {
delegate atomic.Pointer[ErrorHandler]
}
-func (d *ErrDelegator) Handle(err error) {
- d.getDelegate().Handle(err)
-}
+// Compile-time check that delegator implements ErrorHandler.
+var _ ErrorHandler = (*ErrDelegator)(nil)
-func (d *ErrDelegator) getDelegate() ErrorHandler {
- return *d.delegate.Load()
+func (d *ErrDelegator) Handle(err error) {
+ if eh := d.delegate.Load(); eh != nil {
+ (*eh).Handle(err)
+ return
+ }
+ log.Print(err)
}
// setDelegate sets the ErrorHandler delegate.
func (d *ErrDelegator) setDelegate(eh ErrorHandler) {
d.delegate.Store(&eh)
}
-
-func defaultErrorHandler() *ErrDelegator {
- d := &ErrDelegator{}
- d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)})
- return d
-}
-
-// ErrLogger logs errors if no delegate is set, otherwise they are delegated.
-type ErrLogger struct {
- l *log.Logger
-}
-
-// Handle logs err if no delegate is set, otherwise it is delegated.
-func (h *ErrLogger) Handle(err error) {
- h.l.Print(err)
-}
-
-// GetErrorHandler returns the global ErrorHandler instance.
-//
-// The default ErrorHandler instance returned will log all errors to STDERR
-// until an override ErrorHandler is set with SetErrorHandler. All
-// ErrorHandler returned prior to this will automatically forward errors to
-// the set instance instead of logging.
-//
-// Subsequent calls to SetErrorHandler after the first will not forward errors
-// to the new ErrorHandler for prior returned instances.
-func GetErrorHandler() ErrorHandler {
- return GlobalErrorHandler
-}
-
-// SetErrorHandler sets the global ErrorHandler to h.
-//
-// The first time this is called all ErrorHandler previously returned from
-// GetErrorHandler will send errors to h instead of the default logging
-// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
-// delegate errors to h.
-func SetErrorHandler(h ErrorHandler) {
- GlobalErrorHandler.setDelegate(h)
-}
-
-// Handle is a convenience function for ErrorHandler().Handle(err).
-func Handle(err error) {
- GetErrorHandler().Handle(err)
-}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
index ebb13c206..0c8ed20a5 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/instruments.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
index c6f305a2b..adbca7d34 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -23,17 +12,20 @@ import (
"github.com/go-logr/stdr"
)
-// globalLogger is the logging interface used within the otel api and sdk provide details of the internals.
+// globalLogger holds a reference to the [logr.Logger] used within
+// go.opentelemetry.io/otel.
//
// The default logger uses stdr which is backed by the standard `log.Logger`
// interface. This logger will only show messages at the Error Level.
-var globalLogger atomic.Pointer[logr.Logger]
+var globalLogger = func() *atomic.Pointer[logr.Logger] {
+ l := stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))
-func init() {
- SetLogger(stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile)))
-}
+ p := new(atomic.Pointer[logr.Logger])
+ p.Store(&l)
+ return p
+}()
-// SetLogger overrides the globalLogger with l.
+// SetLogger sets the global Logger to l.
//
// To see Warn messages use a logger with `l.V(1).Enabled() == true`
// To see Info messages use a logger with `l.V(4).Enabled() == true`
@@ -42,28 +34,29 @@ func SetLogger(l logr.Logger) {
globalLogger.Store(&l)
}
-func getLogger() logr.Logger {
+// GetLogger returns the global logger.
+func GetLogger() logr.Logger {
return *globalLogger.Load()
}
// Info prints messages about the general state of the API or SDK.
// This should usually be less than 5 messages a minute.
func Info(msg string, keysAndValues ...interface{}) {
- getLogger().V(4).Info(msg, keysAndValues...)
+ GetLogger().V(4).Info(msg, keysAndValues...)
}
// Error prints messages about exceptional states of the API or SDK.
func Error(err error, msg string, keysAndValues ...interface{}) {
- getLogger().Error(err, msg, keysAndValues...)
+ GetLogger().Error(err, msg, keysAndValues...)
}
// Debug prints messages about all internal changes in the API or SDK.
func Debug(msg string, keysAndValues ...interface{}) {
- getLogger().V(8).Info(msg, keysAndValues...)
+ GetLogger().V(8).Info(msg, keysAndValues...)
}
// Warn prints messages about warnings in the API or SDK.
// Not an error but is likely more important than an informational event.
func Warn(msg string, keysAndValues ...interface{}) {
- getLogger().V(1).Info(msg, keysAndValues...)
+ GetLogger().V(1).Info(msg, keysAndValues...)
}
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
index 7ed61c0e2..f21898591 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/meter.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/meter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
index 06bac35c2..38560ff99 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/propagator.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/state.go b/vendor/go.opentelemetry.io/otel/internal/global/state.go
index 386c8bfdc..204ea142a 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/state.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/state.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -25,6 +14,10 @@ import (
)
type (
+ errorHandlerHolder struct {
+ eh ErrorHandler
+ }
+
tracerProviderHolder struct {
tp trace.TracerProvider
}
@@ -39,15 +32,59 @@ type (
)
var (
+ globalErrorHandler = defaultErrorHandler()
globalTracer = defaultTracerValue()
globalPropagators = defaultPropagatorsValue()
globalMeterProvider = defaultMeterProvider()
+ delegateErrorHandlerOnce sync.Once
delegateTraceOnce sync.Once
delegateTextMapPropagatorOnce sync.Once
delegateMeterOnce sync.Once
)
+// GetErrorHandler returns the global ErrorHandler instance.
+//
+// The default ErrorHandler instance returned will log all errors to STDERR
+// until an override ErrorHandler is set with SetErrorHandler. All
+// ErrorHandler returned prior to this will automatically forward errors to
+// the set instance instead of logging.
+//
+// Subsequent calls to SetErrorHandler after the first will not forward errors
+// to the new ErrorHandler for prior returned instances.
+func GetErrorHandler() ErrorHandler {
+ return globalErrorHandler.Load().(errorHandlerHolder).eh
+}
+
+// SetErrorHandler sets the global ErrorHandler to h.
+//
+// The first time this is called all ErrorHandler previously returned from
+// GetErrorHandler will send errors to h instead of the default logging
+// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not
+// delegate errors to h.
+func SetErrorHandler(h ErrorHandler) {
+ current := GetErrorHandler()
+
+ if _, cOk := current.(*ErrDelegator); cOk {
+ if _, ehOk := h.(*ErrDelegator); ehOk && current == h {
+ // Do not assign to the delegate of the default ErrDelegator to be
+ // itself.
+ Error(
+ errors.New("no ErrorHandler delegate configured"),
+ "ErrorHandler remains its current value.",
+ )
+ return
+ }
+ }
+
+ delegateErrorHandlerOnce.Do(func() {
+ if def, ok := current.(*ErrDelegator); ok {
+ def.setDelegate(h)
+ }
+ })
+ globalErrorHandler.Store(errorHandlerHolder{eh: h})
+}
+
// TracerProvider is the internal implementation for global.TracerProvider.
func TracerProvider() trace.TracerProvider {
return globalTracer.Load().(tracerProviderHolder).tp
@@ -137,6 +174,12 @@ func SetMeterProvider(mp metric.MeterProvider) {
globalMeterProvider.Store(meterProviderHolder{mp: mp})
}
+func defaultErrorHandler() *atomic.Value {
+ v := &atomic.Value{}
+ v.Store(errorHandlerHolder{eh: &ErrDelegator{}})
+ return v
+}
+
func defaultTracerValue() *atomic.Value {
v := &atomic.Value{}
v.Store(tracerProviderHolder{tp: &tracerProvider{}})
diff --git a/vendor/go.opentelemetry.io/otel/internal/global/trace.go b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
index 3f61ec12a..596f716f4 100644
--- a/vendor/go.opentelemetry.io/otel/internal/global/trace.go
+++ b/vendor/go.opentelemetry.io/otel/internal/global/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
@@ -193,6 +182,9 @@ func (nonRecordingSpan) RecordError(error, ...trace.EventOption) {}
// AddEvent does nothing.
func (nonRecordingSpan) AddEvent(string, ...trace.EventOption) {}
+// AddLink does nothing.
+func (nonRecordingSpan) AddLink(trace.Link) {}
+
// SetName does nothing.
func (nonRecordingSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
index e07e79400..3e7bb3b35 100644
--- a/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
+++ b/vendor/go.opentelemetry.io/otel/internal/rawhelpers.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package internal // import "go.opentelemetry.io/otel/internal"
diff --git a/vendor/go.opentelemetry.io/otel/internal_logging.go b/vendor/go.opentelemetry.io/otel/internal_logging.go
index c4f8acd5d..6de7f2e4d 100644
--- a/vendor/go.opentelemetry.io/otel/internal_logging.go
+++ b/vendor/go.opentelemetry.io/otel/internal_logging.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric.go b/vendor/go.opentelemetry.io/otel/metric.go
index f95517195..1e6473b32 100644
--- a/vendor/go.opentelemetry.io/otel/metric.go
+++ b/vendor/go.opentelemetry.io/otel/metric.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/metric/README.md b/vendor/go.opentelemetry.io/otel/metric/README.md
new file mode 100644
index 000000000..0cf902e01
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/README.md
@@ -0,0 +1,3 @@
+# Metric API
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric)](https://pkg.go.dev/go.opentelemetry.io/otel/metric)
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
index 072baa8e8..c7234f4bc 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
index 9bd6ebf02..c82ba5324 100644
--- a/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/asyncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/config.go b/vendor/go.opentelemetry.io/otel/metric/config.go
index 778ad2d74..d9e3b13e4 100644
--- a/vendor/go.opentelemetry.io/otel/metric/config.go
+++ b/vendor/go.opentelemetry.io/otel/metric/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/doc.go b/vendor/go.opentelemetry.io/otel/metric/doc.go
index 54716e13b..075234b33 100644
--- a/vendor/go.opentelemetry.io/otel/metric/doc.go
+++ b/vendor/go.opentelemetry.io/otel/metric/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package metric provides the OpenTelemetry API used to measure metrics about
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/README.md b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
new file mode 100644
index 000000000..1f6e0efa7
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/README.md
@@ -0,0 +1,3 @@
+# Metric Embedded
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
index ae0bdbd2e..15bebae08 100644
--- a/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
+++ b/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Package embedded provides interfaces embedded within the [OpenTelemetry
// metric API].
diff --git a/vendor/go.opentelemetry.io/otel/metric/instrument.go b/vendor/go.opentelemetry.io/otel/metric/instrument.go
index be89cd533..451413192 100644
--- a/vendor/go.opentelemetry.io/otel/metric/instrument.go
+++ b/vendor/go.opentelemetry.io/otel/metric/instrument.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/meter.go b/vendor/go.opentelemetry.io/otel/metric/meter.go
index 2520bc74a..7aa82e0c1 100644
--- a/vendor/go.opentelemetry.io/otel/metric/meter.go
+++ b/vendor/go.opentelemetry.io/otel/metric/meter.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/README.md b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
new file mode 100644
index 000000000..bb8969435
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/README.md
@@ -0,0 +1,3 @@
+# Metric Noop
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/metric/noop)](https://pkg.go.dev/go.opentelemetry.io/otel/metric/noop)
diff --git a/vendor/go.opentelemetry.io/otel/metric/noop/noop.go b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
index acc9a670b..4524a57d2 100644
--- a/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
+++ b/vendor/go.opentelemetry.io/otel/metric/noop/noop.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Package noop provides an implementation of the OpenTelemetry metric API that
// produces no telemetry and minimizes used computation resources.
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
index 0a4825ae6..5420d546e 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
index 56667d32f..0dcbf06db 100644
--- a/vendor/go.opentelemetry.io/otel/metric/syncint64.go
+++ b/vendor/go.opentelemetry.io/otel/metric/syncint64.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package metric // import "go.opentelemetry.io/otel/metric"
diff --git a/vendor/go.opentelemetry.io/otel/propagation.go b/vendor/go.opentelemetry.io/otel/propagation.go
index d29aaa32c..2fd949733 100644
--- a/vendor/go.opentelemetry.io/otel/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/README.md b/vendor/go.opentelemetry.io/otel/propagation/README.md
new file mode 100644
index 000000000..e2959ac74
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/propagation/README.md
@@ -0,0 +1,3 @@
+# Propagation
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/propagation)](https://pkg.go.dev/go.opentelemetry.io/otel/propagation)
diff --git a/vendor/go.opentelemetry.io/otel/propagation/baggage.go b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
index 303cdf1cb..552263ba7 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/baggage.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/baggage.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/doc.go b/vendor/go.opentelemetry.io/otel/propagation/doc.go
index c119eb285..33a3baf15 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/doc.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package propagation contains OpenTelemetry context propagators.
diff --git a/vendor/go.opentelemetry.io/otel/propagation/propagation.go b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
index c94438f73..8c8286aab 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/propagation.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/propagation.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
diff --git a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
index 63e5d6222..6870e316d 100644
--- a/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
+++ b/vendor/go.opentelemetry.io/otel/propagation/trace_context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
@@ -46,7 +35,7 @@ var (
versionPart = fmt.Sprintf("%.2X", supportedVersion)
)
-// Inject set tracecontext from the Context into the carrier.
+// Inject injects the trace context from ctx into carrier.
func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
sc := trace.SpanContextFromContext(ctx)
if !sc.IsValid() {
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md
new file mode 100644
index 000000000..87b842c5d
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.17.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.17.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.17.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
index 71a1f7748..e087c9c04 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
index 679c40c4d..c7b804bbe 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/event.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
index 9b8c559de..137acc67d 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/exception.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
index d5c4b5c13..d318221e5 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
index 39a2eab3a..7e365e82c 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
index 42fc525d1..634a1dce0 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/schema.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
index 8c4a7299d..21497bb6b 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.17.0/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
new file mode 100644
index 000000000..82e1f46b4
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md
@@ -0,0 +1,3 @@
+# Semconv v1.20.0
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/semconv/v1.20.0)](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.20.0)
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
index 67d1d4c44..6685c392b 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
index 359c5a696..0d1f55a8f 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
index 8ac9350d2..637763932 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
index 09ff4dfdb..f40c97825 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
index 342aede95..9c1840631 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
index a2b906742..3d44dae27 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
index e449e5c3b..95d0210e3 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
index 851774148..90b1b0452 100644
--- a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
+++ b/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
diff --git a/vendor/go.opentelemetry.io/otel/trace.go b/vendor/go.opentelemetry.io/otel/trace.go
index caf7249de..6836c6547 100644
--- a/vendor/go.opentelemetry.io/otel/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
diff --git a/vendor/go.opentelemetry.io/otel/trace/README.md b/vendor/go.opentelemetry.io/otel/trace/README.md
new file mode 100644
index 000000000..58ccaba69
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/README.md
@@ -0,0 +1,3 @@
+# Trace API
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace)](https://pkg.go.dev/go.opentelemetry.io/otel/trace)
diff --git a/vendor/go.opentelemetry.io/otel/trace/config.go b/vendor/go.opentelemetry.io/otel/trace/config.go
index 3aadc66cf..273d58e00 100644
--- a/vendor/go.opentelemetry.io/otel/trace/config.go
+++ b/vendor/go.opentelemetry.io/otel/trace/config.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/context.go b/vendor/go.opentelemetry.io/otel/trace/context.go
index 76f9a083c..5650a174b 100644
--- a/vendor/go.opentelemetry.io/otel/trace/context.go
+++ b/vendor/go.opentelemetry.io/otel/trace/context.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -47,12 +36,12 @@ func ContextWithRemoteSpanContext(parent context.Context, rsc SpanContext) conte
// performs no operations is returned.
func SpanFromContext(ctx context.Context) Span {
if ctx == nil {
- return noopSpan{}
+ return noopSpanInstance
}
if span, ok := ctx.Value(currentSpanKey).(Span); ok {
return span
}
- return noopSpan{}
+ return noopSpanInstance
}
// SpanContextFromContext returns the current Span's SpanContext.
diff --git a/vendor/go.opentelemetry.io/otel/trace/doc.go b/vendor/go.opentelemetry.io/otel/trace/doc.go
index 440f3d756..d661c5d10 100644
--- a/vendor/go.opentelemetry.io/otel/trace/doc.go
+++ b/vendor/go.opentelemetry.io/otel/trace/doc.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
/*
Package trace provides an implementation of the tracing part of the
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/README.md b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
new file mode 100644
index 000000000..7754a239e
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/README.md
@@ -0,0 +1,3 @@
+# Trace Embedded
+
+[![PkgGoDev](https://pkg.go.dev/badge/go.opentelemetry.io/otel/trace/embedded)](https://pkg.go.dev/go.opentelemetry.io/otel/trace/embedded)
diff --git a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
index 898db5a75..3e359a00b 100644
--- a/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
+++ b/vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
// Package embedded provides interfaces embedded within the [OpenTelemetry
// trace API].
diff --git a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
index 88fcb8161..c00221e7b 100644
--- a/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
+++ b/vendor/go.opentelemetry.io/otel/trace/nonrecording.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/trace/noop.go b/vendor/go.opentelemetry.io/otel/trace/noop.go
index c125491ca..ca20e9997 100644
--- a/vendor/go.opentelemetry.io/otel/trace/noop.go
+++ b/vendor/go.opentelemetry.io/otel/trace/noop.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -52,7 +41,7 @@ func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption
span := SpanFromContext(ctx)
if _, ok := span.(nonRecordingSpan); !ok {
// span is likely already a noopSpan, but let's be sure
- span = noopSpan{}
+ span = noopSpanInstance
}
return ContextWithSpan(ctx, span), span
}
@@ -60,7 +49,7 @@ func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption
// noopSpan is an implementation of Span that performs no operations.
type noopSpan struct{ embedded.Span }
-var _ Span = noopSpan{}
+var noopSpanInstance Span = noopSpan{}
// SpanContext returns an empty span context.
func (noopSpan) SpanContext() SpanContext { return SpanContext{} }
@@ -86,6 +75,9 @@ func (noopSpan) RecordError(error, ...EventOption) {}
// AddEvent does nothing.
func (noopSpan) AddEvent(string, ...EventOption) {}
+// AddLink does nothing.
+func (noopSpan) AddLink(Link) {}
+
// SetName does nothing.
func (noopSpan) SetName(string) {}
diff --git a/vendor/go.opentelemetry.io/otel/trace/trace.go b/vendor/go.opentelemetry.io/otel/trace/trace.go
index 26a4b2260..28877d4ab 100644
--- a/vendor/go.opentelemetry.io/otel/trace/trace.go
+++ b/vendor/go.opentelemetry.io/otel/trace/trace.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
@@ -361,6 +350,12 @@ type Span interface {
// AddEvent adds an event with the provided name and options.
AddEvent(name string, options ...EventOption)
+ // AddLink adds a link.
+ // Adding links at span creation using WithLinks is preferred to calling AddLink
+ // later, for contexts that are available during span creation, because head
+ // sampling decisions can only consider information present during span creation.
+ AddLink(link Link)
+
// IsRecording returns the recording state of the Span. It will return
// true if the Span is active and events can be recorded.
IsRecording() bool
diff --git a/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
index db936ba5b..20b5cf243 100644
--- a/vendor/go.opentelemetry.io/otel/trace/tracestate.go
+++ b/vendor/go.opentelemetry.io/otel/trace/tracestate.go
@@ -1,16 +1,5 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/trace"
diff --git a/vendor/go.opentelemetry.io/otel/verify_examples.sh b/vendor/go.opentelemetry.io/otel/verify_examples.sh
index dbb61a422..e57bf57fc 100644
--- a/vendor/go.opentelemetry.io/otel/verify_examples.sh
+++ b/vendor/go.opentelemetry.io/otel/verify_examples.sh
@@ -1,18 +1,7 @@
#!/bin/bash
# Copyright The OpenTelemetry Authors
-#
-# 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.
+# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
diff --git a/vendor/go.opentelemetry.io/otel/verify_readmes.sh b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
new file mode 100644
index 000000000..1e87855ee
--- /dev/null
+++ b/vendor/go.opentelemetry.io/otel/verify_readmes.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+set -euo pipefail
+
+dirs=$(find . -type d -not -path "*/internal*" -not -path "*/test*" -not -path "*/example*" -not -path "*/.*" | sort)
+
+missingReadme=false
+for dir in $dirs; do
+ if [ ! -f "$dir/README.md" ]; then
+ echo "couldn't find README.md for $dir"
+ missingReadme=true
+ fi
+done
+
+if [ "$missingReadme" = true ] ; then
+ echo "Error: some READMEs couldn't be found."
+ exit 1
+fi
diff --git a/vendor/go.opentelemetry.io/otel/version.go b/vendor/go.opentelemetry.io/otel/version.go
index 7b2993a1f..ef97d30f9 100644
--- a/vendor/go.opentelemetry.io/otel/version.go
+++ b/vendor/go.opentelemetry.io/otel/version.go
@@ -1,20 +1,9 @@
// Copyright The OpenTelemetry Authors
-//
-// 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.
+// SPDX-License-Identifier: Apache-2.0
package otel // import "go.opentelemetry.io/otel"
// Version is the current release version of OpenTelemetry in use.
func Version() string {
- return "1.24.0"
+ return "1.26.0"
}
diff --git a/vendor/go.opentelemetry.io/otel/versions.yaml b/vendor/go.opentelemetry.io/otel/versions.yaml
index 1b556e678..ecd2734e0 100644
--- a/vendor/go.opentelemetry.io/otel/versions.yaml
+++ b/vendor/go.opentelemetry.io/otel/versions.yaml
@@ -1,20 +1,9 @@
# Copyright The OpenTelemetry Authors
-#
-# 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.
+# SPDX-License-Identifier: Apache-2.0
module-sets:
stable-v1:
- version: v1.24.0
+ version: v1.26.0
modules:
- go.opentelemetry.io/otel
- go.opentelemetry.io/otel/bridge/opencensus
@@ -40,16 +29,19 @@ module-sets:
- go.opentelemetry.io/otel/sdk/metric
- go.opentelemetry.io/otel/trace
experimental-metrics:
- version: v0.46.0
+ version: v0.48.0
modules:
- go.opentelemetry.io/otel/example/prometheus
- go.opentelemetry.io/otel/exporters/prometheus
experimental-logs:
- version: v0.0.1-alpha
+ version: v0.2.0-alpha
modules:
- go.opentelemetry.io/otel/log
+ - go.opentelemetry.io/otel/sdk/log
+ - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
+ - go.opentelemetry.io/otel/exporters/stdout/stdoutlog
experimental-schema:
- version: v0.0.7
+ version: v0.0.8
modules:
- go.opentelemetry.io/otel/schema
excluded-modules:
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 251a98c06..d18ccf39a 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -7,12 +7,18 @@
# cloud.google.com/go v0.114.0
## explicit; go 1.20
cloud.google.com/go
+cloud.google.com/go/civil
cloud.google.com/go/internal
cloud.google.com/go/internal/detect
cloud.google.com/go/internal/optional
cloud.google.com/go/internal/pubsub
cloud.google.com/go/internal/trace
cloud.google.com/go/internal/version
+# cloud.google.com/go/ai v0.5.0
+## explicit; go 1.19
+cloud.google.com/go/ai/generativelanguage/apiv1beta
+cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb
+cloud.google.com/go/ai/internal
# cloud.google.com/go/auth v0.4.2
## explicit; go 1.20
cloud.google.com/go/auth
@@ -358,6 +364,13 @@ github.com/golangci/unconvert
# github.com/google/flatbuffers v24.3.25+incompatible
## explicit
github.com/google/flatbuffers/go
+# github.com/google/generative-ai-go v0.13.0
+## explicit; go 1.21
+github.com/google/generative-ai-go/genai
+github.com/google/generative-ai-go/genai/internal
+github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta
+github.com/google/generative-ai-go/genai/internal/gensupport
+github.com/google/generative-ai-go/internal/support
# github.com/google/go-cmp v0.6.0
## explicit; go 1.13
github.com/google/go-cmp/cmp
@@ -842,16 +855,17 @@ go.opencensus.io/trace
go.opencensus.io/trace/internal
go.opencensus.io/trace/propagation
go.opencensus.io/trace/tracestate
-# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0
-## explicit; go 1.20
+# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0
+## explicit; go 1.21
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal
-# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0
-## explicit; go 1.20
+# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0
+## explicit; go 1.21
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil
-# go.opentelemetry.io/otel v1.24.0
-## explicit; go 1.20
+# go.opentelemetry.io/otel v1.26.0
+## explicit; go 1.21
go.opentelemetry.io/otel
go.opentelemetry.io/otel/attribute
go.opentelemetry.io/otel/baggage
@@ -863,13 +877,13 @@ go.opentelemetry.io/otel/internal/global
go.opentelemetry.io/otel/propagation
go.opentelemetry.io/otel/semconv/v1.17.0
go.opentelemetry.io/otel/semconv/v1.20.0
-# go.opentelemetry.io/otel/metric v1.24.0
-## explicit; go 1.20
+# go.opentelemetry.io/otel/metric v1.26.0
+## explicit; go 1.21
go.opentelemetry.io/otel/metric
go.opentelemetry.io/otel/metric/embedded
go.opentelemetry.io/otel/metric/noop
-# go.opentelemetry.io/otel/trace v1.24.0
-## explicit; go 1.20
+# go.opentelemetry.io/otel/trace v1.26.0
+## explicit; go 1.21
go.opentelemetry.io/otel/trace
go.opentelemetry.io/otel/trace/embedded
# go.uber.org/atomic v1.10.0