Class GenerationConfig.Builder (0.4.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicstaticfinalclass GenerationConfig.BuilderextendsGeneratedMessageV3.Builder<GenerationConfig.Builder>implementsGenerationConfigOrBuilderGeneration config.
Protobuf type google.cloud.vertexai.v1.GenerationConfig
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > GenerationConfig.BuilderImplements
GenerationConfigOrBuilderInherited Members
Static Methods
getDescriptor()
publicstaticfinalDescriptors.DescriptorgetDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
addAllStopSequences(Iterable<String> values)
publicGenerationConfig.BuilderaddAllStopSequences(Iterable<String>values)Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<String>The stopSequences to add. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
publicGenerationConfig.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)| Parameters | |
|---|---|
| Name | Description |
field |
FieldDescriptor |
value |
Object |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
addStopSequences(String value)
publicGenerationConfig.BuilderaddStopSequences(Stringvalue)Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
String The stopSequences to add. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
addStopSequencesBytes(ByteString value)
publicGenerationConfig.BuilderaddStopSequencesBytes(ByteStringvalue)Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteString The bytes of the stopSequences to add. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
build()
publicGenerationConfigbuild()| Returns | |
|---|---|
| Type | Description |
GenerationConfig |
|
buildPartial()
publicGenerationConfigbuildPartial()| Returns | |
|---|---|
| Type | Description |
GenerationConfig |
|
clear()
publicGenerationConfig.Builderclear()| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
clearCandidateCount()
publicGenerationConfig.BuilderclearCandidateCount()Optional. Number of candidates to generate.
optional int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
publicGenerationConfig.BuilderclearField(Descriptors.FieldDescriptorfield)| Parameter | |
|---|---|
| Name | Description |
field |
FieldDescriptor |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
clearMaxOutputTokens()
publicGenerationConfig.BuilderclearMaxOutputTokens()Optional. The maximum number of output tokens to generate per message.
optional int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
publicGenerationConfig.BuilderclearOneof(Descriptors.OneofDescriptoroneof)| Parameter | |
|---|---|
| Name | Description |
oneof |
OneofDescriptor |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
clearStopSequences()
publicGenerationConfig.BuilderclearStopSequences()Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
clearTemperature()
publicGenerationConfig.BuilderclearTemperature()Optional. Controls the randomness of predictions.
optional float temperature = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
clearTopK()
publicGenerationConfig.BuilderclearTopK()Optional. If specified, top-k sampling will be used.
optional float top_k = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
clearTopP()
publicGenerationConfig.BuilderclearTopP()Optional. If specified, nucleus sampling will be used.
optional float top_p = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
clone()
publicGenerationConfig.Builderclone()| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
getCandidateCount()
publicintgetCandidateCount()Optional. Number of candidates to generate.
optional int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The candidateCount. |
getDefaultInstanceForType()
publicGenerationConfiggetDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
GenerationConfig |
|
getDescriptorForType()
publicDescriptors.DescriptorgetDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getMaxOutputTokens()
publicintgetMaxOutputTokens()Optional. The maximum number of output tokens to generate per message.
optional int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The maxOutputTokens. |
getStopSequences(int index)
publicStringgetStopSequences(intindex)Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
int The index of the element to return. |
| Returns | |
|---|---|
| Type | Description |
String |
The stopSequences at the given index. |
getStopSequencesBytes(int index)
publicByteStringgetStopSequencesBytes(intindex)Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
index |
int The index of the value to return. |
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes of the stopSequences at the given index. |
getStopSequencesCount()
publicintgetStopSequencesCount()Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The count of stopSequences. |
getStopSequencesList()
publicProtocolStringListgetStopSequencesList()Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
ProtocolStringList |
A list containing the stopSequences. |
getTemperature()
publicfloatgetTemperature()Optional. Controls the randomness of predictions.
optional float temperature = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
float |
The temperature. |
getTopK()
publicfloatgetTopK()Optional. If specified, top-k sampling will be used.
optional float top_k = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
float |
The topK. |
getTopP()
publicfloatgetTopP()Optional. If specified, nucleus sampling will be used.
optional float top_p = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
float |
The topP. |
hasCandidateCount()
publicbooleanhasCandidateCount()Optional. Number of candidates to generate.
optional int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the candidateCount field is set. |
hasMaxOutputTokens()
publicbooleanhasMaxOutputTokens()Optional. The maximum number of output tokens to generate per message.
optional int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the maxOutputTokens field is set. |
hasTemperature()
publicbooleanhasTemperature()Optional. Controls the randomness of predictions.
optional float temperature = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the temperature field is set. |
hasTopK()
publicbooleanhasTopK()Optional. If specified, top-k sampling will be used.
optional float top_k = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the topK field is set. |
hasTopP()
publicbooleanhasTopP()Optional. If specified, nucleus sampling will be used.
optional float top_p = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the topP field is set. |
internalGetFieldAccessorTable()
protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
publicfinalbooleanisInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(GenerationConfig other)
publicGenerationConfig.BuildermergeFrom(GenerationConfigother)| Parameter | |
|---|---|
| Name | Description |
other |
GenerationConfig |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
publicGenerationConfig.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
publicGenerationConfig.BuildermergeFrom(Messageother)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
mergeUnknownFields(UnknownFieldSet unknownFields)
publicfinalGenerationConfig.BuildermergeUnknownFields(UnknownFieldSetunknownFields)| Parameter | |
|---|---|
| Name | Description |
unknownFields |
UnknownFieldSet |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
setCandidateCount(int value)
publicGenerationConfig.BuildersetCandidateCount(intvalue)Optional. Number of candidates to generate.
optional int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
int The candidateCount to set. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
publicGenerationConfig.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)| Parameters | |
|---|---|
| Name | Description |
field |
FieldDescriptor |
value |
Object |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
setMaxOutputTokens(int value)
publicGenerationConfig.BuildersetMaxOutputTokens(intvalue)Optional. The maximum number of output tokens to generate per message.
optional int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
int The maxOutputTokens to set. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
publicGenerationConfig.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)| Parameters | |
|---|---|
| Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|
setStopSequences(int index, String value)
publicGenerationConfig.BuildersetStopSequences(intindex,Stringvalue)Optional. Stop sequences.
repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];
| Parameters | |
|---|---|
| Name | Description |
index |
int The index to set the value at. |
value |
String The stopSequences to set. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
setTemperature(float value)
publicGenerationConfig.BuildersetTemperature(floatvalue)Optional. Controls the randomness of predictions.
optional float temperature = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
float The temperature to set. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
setTopK(float value)
publicGenerationConfig.BuildersetTopK(floatvalue)Optional. If specified, top-k sampling will be used.
optional float top_k = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
float The topK to set. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
setTopP(float value)
publicGenerationConfig.BuildersetTopP(floatvalue)Optional. If specified, nucleus sampling will be used.
optional float top_p = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
float The topP to set. |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
This builder for chaining. |
setUnknownFields(UnknownFieldSet unknownFields)
publicfinalGenerationConfig.BuildersetUnknownFields(UnknownFieldSetunknownFields)| Parameter | |
|---|---|
| Name | Description |
unknownFields |
UnknownFieldSet |
| Returns | |
|---|---|
| Type | Description |
GenerationConfig.Builder |
|