Class CountTokensRequest.Builder (3.41.0)

public static final class CountTokensRequest.Builder extends GeneratedMessageV3.Builder<CountTokensRequest.Builder> implements CountTokensRequestOrBuilder

Request message for PredictionService.CountTokens.

Protobuf type google.cloud.aiplatform.v1beta1.CountTokensRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllContents(Iterable<? extends Content> values)

public CountTokensRequest.Builder addAllContents(Iterable<? extends Content> values)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1beta1.Content>
Returns
TypeDescription
CountTokensRequest.Builder

addAllInstances(Iterable<? extends Value> values)

public CountTokensRequest.Builder addAllInstances(Iterable<? extends Value> values)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuesIterable<? extends com.google.protobuf.Value>
Returns
TypeDescription
CountTokensRequest.Builder

addContents(Content value)

public CountTokensRequest.Builder addContents(Content value)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueContent
Returns
TypeDescription
CountTokensRequest.Builder

addContents(Content.Builder builderForValue)

public CountTokensRequest.Builder addContents(Content.Builder builderForValue)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueContent.Builder
Returns
TypeDescription
CountTokensRequest.Builder

addContents(int index, Content value)

public CountTokensRequest.Builder addContents(int index, Content value)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueContent
Returns
TypeDescription
CountTokensRequest.Builder

addContents(int index, Content.Builder builderForValue)

public CountTokensRequest.Builder addContents(int index, Content.Builder builderForValue)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueContent.Builder
Returns
TypeDescription
CountTokensRequest.Builder

addContentsBuilder()

public Content.Builder addContentsBuilder()

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Content.Builder

addContentsBuilder(int index)

public Content.Builder addContentsBuilder(int index)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
Content.Builder

addInstances(Value value)

public CountTokensRequest.Builder addInstances(Value value)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueValue
Returns
TypeDescription
CountTokensRequest.Builder

addInstances(Value.Builder builderForValue)

public CountTokensRequest.Builder addInstances(Value.Builder builderForValue)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
CountTokensRequest.Builder

addInstances(int index, Value value)

public CountTokensRequest.Builder addInstances(int index, Value value)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueValue
Returns
TypeDescription
CountTokensRequest.Builder

addInstances(int index, Value.Builder builderForValue)

public CountTokensRequest.Builder addInstances(int index, Value.Builder builderForValue)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueBuilder
Returns
TypeDescription
CountTokensRequest.Builder

addInstancesBuilder()

public Value.Builder addInstancesBuilder()

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Builder

addInstancesBuilder(int index)

public Value.Builder addInstancesBuilder(int index)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CountTokensRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

build()

public CountTokensRequest build()
Returns
TypeDescription
CountTokensRequest

buildPartial()

public CountTokensRequest buildPartial()
Returns
TypeDescription
CountTokensRequest

clear()

public CountTokensRequest.Builder clear()
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

clearContents()

public CountTokensRequest.Builder clearContents()

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CountTokensRequest.Builder

clearEndpoint()

public CountTokensRequest.Builder clearEndpoint()

Required. The name of the Endpoint requested to perform token counting. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
CountTokensRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CountTokensRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

clearInstances()

public CountTokensRequest.Builder clearInstances()

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CountTokensRequest.Builder

clearModel()

public CountTokensRequest.Builder clearModel()

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
CountTokensRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CountTokensRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

clone()

public CountTokensRequest.Builder clone()
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

getContents(int index)

public Content getContents(int index)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
Content

getContentsBuilder(int index)

public Content.Builder getContentsBuilder(int index)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
Content.Builder

getContentsBuilderList()

public List<Content.Builder> getContentsBuilderList()

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<Builder>

getContentsCount()

public int getContentsCount()

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

getContentsList()

public List<Content> getContentsList()

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<Content>

getContentsOrBuilder(int index)

public ContentOrBuilder getContentsOrBuilder(int index)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
ContentOrBuilder

getContentsOrBuilderList()

public List<? extends ContentOrBuilder> getContentsOrBuilderList()

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1beta1.ContentOrBuilder>

getDefaultInstanceForType()

public CountTokensRequest getDefaultInstanceForType()
Returns
TypeDescription
CountTokensRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEndpoint()

public String getEndpoint()

Required. The name of the Endpoint requested to perform token counting. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The endpoint.

getEndpointBytes()

public ByteString getEndpointBytes()

Required. The name of the Endpoint requested to perform token counting. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for endpoint.

getInstances(int index)

public Value getInstances(int index)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
Value

getInstancesBuilder(int index)

public Value.Builder getInstancesBuilder(int index)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
Builder

getInstancesBuilderList()

public List<Value.Builder> getInstancesBuilderList()

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<Builder>

getInstancesCount()

public int getInstancesCount()

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
int

getInstancesList()

public List<Value> getInstancesList()

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<Value>

getInstancesOrBuilder(int index)

public ValueOrBuilder getInstancesOrBuilder(int index)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
ValueOrBuilder

getInstancesOrBuilderList()

public List<? extends ValueOrBuilder> getInstancesOrBuilderList()

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<? extends com.google.protobuf.ValueOrBuilder>

getModel()

public String getModel()

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The model.

getModelBytes()

public ByteString getModelBytes()

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for model.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CountTokensRequest other)

public CountTokensRequest.Builder mergeFrom(CountTokensRequest other)
Parameter
NameDescription
otherCountTokensRequest
Returns
TypeDescription
CountTokensRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CountTokensRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CountTokensRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public CountTokensRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CountTokensRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

removeContents(int index)

public CountTokensRequest.Builder removeContents(int index)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
CountTokensRequest.Builder

removeInstances(int index)

public CountTokensRequest.Builder removeInstances(int index)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
CountTokensRequest.Builder

setContents(int index, Content value)

public CountTokensRequest.Builder setContents(int index, Content value)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueContent
Returns
TypeDescription
CountTokensRequest.Builder

setContents(int index, Content.Builder builderForValue)

public CountTokensRequest.Builder setContents(int index, Content.Builder builderForValue)

Required. Input content.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 4 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueContent.Builder
Returns
TypeDescription
CountTokensRequest.Builder

setEndpoint(String value)

public CountTokensRequest.Builder setEndpoint(String value)

Required. The name of the Endpoint requested to perform token counting. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The endpoint to set.

Returns
TypeDescription
CountTokensRequest.Builder

This builder for chaining.

setEndpointBytes(ByteString value)

public CountTokensRequest.Builder setEndpointBytes(ByteString value)

Required. The name of the Endpoint requested to perform token counting. Format: projects/{project}/locations/{location}/endpoints/{endpoint}

string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for endpoint to set.

Returns
TypeDescription
CountTokensRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public CountTokensRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

setInstances(int index, Value value)

public CountTokensRequest.Builder setInstances(int index, Value value)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
valueValue
Returns
TypeDescription
CountTokensRequest.Builder

setInstances(int index, Value.Builder builderForValue)

public CountTokensRequest.Builder setInstances(int index, Value.Builder builderForValue)

Required. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.

repeated .google.protobuf.Value instances = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
NameDescription
indexint
builderForValueBuilder
Returns
TypeDescription
CountTokensRequest.Builder

setModel(String value)

public CountTokensRequest.Builder setModel(String value)

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The model to set.

Returns
TypeDescription
CountTokensRequest.Builder

This builder for chaining.

setModelBytes(ByteString value)

public CountTokensRequest.Builder setModelBytes(ByteString value)

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for model to set.

Returns
TypeDescription
CountTokensRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CountTokensRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
CountTokensRequest.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final CountTokensRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CountTokensRequest.Builder
Overrides