Class GenerateGroundedContentRequest.GenerationSpec.Builder (0.49.0)

public static final class GenerateGroundedContentRequest.GenerationSpec.Builder extends GeneratedMessageV3.Builder<GenerateGroundedContentRequest.GenerationSpec.Builder> implements GenerateGroundedContentRequest.GenerationSpecOrBuilder

Content generation specification.

Protobuf type google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GenerateGroundedContentRequest.GenerationSpec.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

build()

public GenerateGroundedContentRequest.GenerationSpec build()
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec

buildPartial()

public GenerateGroundedContentRequest.GenerationSpec buildPartial()
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec

clear()

public GenerateGroundedContentRequest.GenerationSpec.Builder clear()
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public GenerateGroundedContentRequest.GenerationSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

clearFrequencyPenalty()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearFrequencyPenalty()

If specified, custom value for frequency penalty will be used.

optional float frequency_penalty = 8;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clearLanguageCode()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearLanguageCode()

Language code for content. Use language tags defined by BCP47.

string language_code = 2;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clearMaxOutputTokens()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearMaxOutputTokens()

If specified, custom value for max output tokens will be used.

optional int32 max_output_tokens = 10;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clearModelId()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearModelId()

Specifies which Vertex model id to use for generation.

string model_id = 3;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public GenerateGroundedContentRequest.GenerationSpec.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

clearPresencePenalty()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearPresencePenalty()

If specified, custom value for presence penalty will be used.

optional float presence_penalty = 9;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clearTemperature()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearTemperature()

If specified, custom value for the temperature will be used.

optional float temperature = 4;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clearTopK()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearTopK()

If specified, custom value for top-k sampling will be used.

optional int32 top_k = 7;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clearTopP()

public GenerateGroundedContentRequest.GenerationSpec.Builder clearTopP()

If specified, custom value for nucleus sampling will be used.

optional float top_p = 5;

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

clone()

public GenerateGroundedContentRequest.GenerationSpec.Builder clone()
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

getDefaultInstanceForType()

public GenerateGroundedContentRequest.GenerationSpec getDefaultInstanceForType()
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getFrequencyPenalty()

public float getFrequencyPenalty()

If specified, custom value for frequency penalty will be used.

optional float frequency_penalty = 8;

Returns
Type Description
float

The frequencyPenalty.

getLanguageCode()

public String getLanguageCode()

Language code for content. Use language tags defined by BCP47.

string language_code = 2;

Returns
Type Description
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

Language code for content. Use language tags defined by BCP47.

string language_code = 2;

Returns
Type Description
ByteString

The bytes for languageCode.

getMaxOutputTokens()

public int getMaxOutputTokens()

If specified, custom value for max output tokens will be used.

optional int32 max_output_tokens = 10;

Returns
Type Description
int

The maxOutputTokens.

getModelId()

public String getModelId()

Specifies which Vertex model id to use for generation.

string model_id = 3;

Returns
Type Description
String

The modelId.

getModelIdBytes()

public ByteString getModelIdBytes()

Specifies which Vertex model id to use for generation.

string model_id = 3;

Returns
Type Description
ByteString

The bytes for modelId.

getPresencePenalty()

public float getPresencePenalty()

If specified, custom value for presence penalty will be used.

optional float presence_penalty = 9;

Returns
Type Description
float

The presencePenalty.

getTemperature()

public float getTemperature()

If specified, custom value for the temperature will be used.

optional float temperature = 4;

Returns
Type Description
float

The temperature.

getTopK()

public int getTopK()

If specified, custom value for top-k sampling will be used.

optional int32 top_k = 7;

Returns
Type Description
int

The topK.

getTopP()

public float getTopP()

If specified, custom value for nucleus sampling will be used.

optional float top_p = 5;

Returns
Type Description
float

The topP.

hasFrequencyPenalty()

public boolean hasFrequencyPenalty()

If specified, custom value for frequency penalty will be used.

optional float frequency_penalty = 8;

Returns
Type Description
boolean

Whether the frequencyPenalty field is set.

hasMaxOutputTokens()

public boolean hasMaxOutputTokens()

If specified, custom value for max output tokens will be used.

optional int32 max_output_tokens = 10;

Returns
Type Description
boolean

Whether the maxOutputTokens field is set.

hasPresencePenalty()

public boolean hasPresencePenalty()

If specified, custom value for presence penalty will be used.

optional float presence_penalty = 9;

Returns
Type Description
boolean

Whether the presencePenalty field is set.

hasTemperature()

public boolean hasTemperature()

If specified, custom value for the temperature will be used.

optional float temperature = 4;

Returns
Type Description
boolean

Whether the temperature field is set.

hasTopK()

public boolean hasTopK()

If specified, custom value for top-k sampling will be used.

optional int32 top_k = 7;

Returns
Type Description
boolean

Whether the topK field is set.

hasTopP()

public boolean hasTopP()

If specified, custom value for nucleus sampling will be used.

optional float top_p = 5;

Returns
Type Description
boolean

Whether the topP field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(GenerateGroundedContentRequest.GenerationSpec other)

public GenerateGroundedContentRequest.GenerationSpec.Builder mergeFrom(GenerateGroundedContentRequest.GenerationSpec other)
Parameter
Name Description
other GenerateGroundedContentRequest.GenerationSpec
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GenerateGroundedContentRequest.GenerationSpec.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public GenerateGroundedContentRequest.GenerationSpec.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GenerateGroundedContentRequest.GenerationSpec.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

setFrequencyPenalty(float value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setFrequencyPenalty(float value)

If specified, custom value for frequency penalty will be used.

optional float frequency_penalty = 8;

Parameter
Name Description
value float

The frequencyPenalty to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setLanguageCode(String value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setLanguageCode(String value)

Language code for content. Use language tags defined by BCP47.

string language_code = 2;

Parameter
Name Description
value String

The languageCode to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setLanguageCodeBytes(ByteString value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setLanguageCodeBytes(ByteString value)

Language code for content. Use language tags defined by BCP47.

string language_code = 2;

Parameter
Name Description
value ByteString

The bytes for languageCode to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setMaxOutputTokens(int value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setMaxOutputTokens(int value)

If specified, custom value for max output tokens will be used.

optional int32 max_output_tokens = 10;

Parameter
Name Description
value int

The maxOutputTokens to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setModelId(String value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setModelId(String value)

Specifies which Vertex model id to use for generation.

string model_id = 3;

Parameter
Name Description
value String

The modelId to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setModelIdBytes(ByteString value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setModelIdBytes(ByteString value)

Specifies which Vertex model id to use for generation.

string model_id = 3;

Parameter
Name Description
value ByteString

The bytes for modelId to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setPresencePenalty(float value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setPresencePenalty(float value)

If specified, custom value for presence penalty will be used.

optional float presence_penalty = 9;

Parameter
Name Description
value float

The presencePenalty to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

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

public GenerateGroundedContentRequest.GenerationSpec.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides

setTemperature(float value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setTemperature(float value)

If specified, custom value for the temperature will be used.

optional float temperature = 4;

Parameter
Name Description
value float

The temperature to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setTopK(int value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setTopK(int value)

If specified, custom value for top-k sampling will be used.

optional int32 top_k = 7;

Parameter
Name Description
value int

The topK to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setTopP(float value)

public GenerateGroundedContentRequest.GenerationSpec.Builder setTopP(float value)

If specified, custom value for nucleus sampling will be used.

optional float top_p = 5;

Parameter
Name Description
value float

The topP to set.

Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final GenerateGroundedContentRequest.GenerationSpec.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateGroundedContentRequest.GenerationSpec.Builder
Overrides