Class GenerationConfig (3.37.0)

public final class GenerationConfig extends GeneratedMessageV3 implements GenerationConfigOrBuilder

Generation config.

Protobuf type google.cloud.aiplatform.v1.GenerationConfig

Static Fields

CANDIDATE_COUNT_FIELD_NUMBER

public static final int CANDIDATE_COUNT_FIELD_NUMBER
Field Value
TypeDescription
int

MAX_OUTPUT_TOKENS_FIELD_NUMBER

public static final int MAX_OUTPUT_TOKENS_FIELD_NUMBER
Field Value
TypeDescription
int

STOP_SEQUENCES_FIELD_NUMBER

public static final int STOP_SEQUENCES_FIELD_NUMBER
Field Value
TypeDescription
int

TEMPERATURE_FIELD_NUMBER

public static final int TEMPERATURE_FIELD_NUMBER
Field Value
TypeDescription
int

TOP_K_FIELD_NUMBER

public static final int TOP_K_FIELD_NUMBER
Field Value
TypeDescription
int

TOP_P_FIELD_NUMBER

public static final int TOP_P_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static GenerationConfig getDefaultInstance()
Returns
TypeDescription
GenerationConfig

getDescriptor()

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

newBuilder()

public static GenerationConfig.Builder newBuilder()
Returns
TypeDescription
GenerationConfig.Builder

newBuilder(GenerationConfig prototype)

public static GenerationConfig.Builder newBuilder(GenerationConfig prototype)
Parameter
NameDescription
prototypeGenerationConfig
Returns
TypeDescription
GenerationConfig.Builder

parseDelimitedFrom(InputStream input)

public static GenerationConfig parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GenerationConfig parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static GenerationConfig parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static GenerationConfig parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static GenerationConfig parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static GenerationConfig parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static GenerationConfig parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static GenerationConfig parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static GenerationConfig parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GenerationConfig parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static GenerationConfig parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static GenerationConfig parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerationConfig
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<GenerationConfig> parser()
Returns
TypeDescription
Parser<GenerationConfig>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCandidateCount()

public int getCandidateCount()

Optional. Number of candidates to generate.

optional int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The candidateCount.

getDefaultInstanceForType()

public GenerationConfig getDefaultInstanceForType()
Returns
TypeDescription
GenerationConfig

getMaxOutputTokens()

public int getMaxOutputTokens()

Optional. The maximum number of output tokens to generate per message.

optional int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The maxOutputTokens.

getParserForType()

public Parser<GenerationConfig> getParserForType()
Returns
TypeDescription
Parser<GenerationConfig>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getStopSequences(int index)

public String getStopSequences(int index)

Optional. Stop sequences.

repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The stopSequences at the given index.

getStopSequencesBytes(int index)

public ByteString getStopSequencesBytes(int index)

Optional. Stop sequences.

repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the stopSequences at the given index.

getStopSequencesCount()

public int getStopSequencesCount()

Optional. Stop sequences.

repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The count of stopSequences.

getStopSequencesList()

public ProtocolStringList getStopSequencesList()

Optional. Stop sequences.

repeated string stop_sequences = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ProtocolStringList

A list containing the stopSequences.

getTemperature()

public float getTemperature()

Optional. Controls the randomness of predictions.

optional float temperature = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
float

The temperature.

getTopK()

public float getTopK()

Optional. If specified, top-k sampling will be used.

optional float top_k = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
float

The topK.

getTopP()

public float getTopP()

Optional. If specified, nucleus sampling will be used.

optional float top_p = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
float

The topP.

hasCandidateCount()

public boolean hasCandidateCount()

Optional. Number of candidates to generate.

optional int32 candidate_count = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the candidateCount field is set.

hasMaxOutputTokens()

public boolean hasMaxOutputTokens()

Optional. The maximum number of output tokens to generate per message.

optional int32 max_output_tokens = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the maxOutputTokens field is set.

hasTemperature()

public boolean hasTemperature()

Optional. Controls the randomness of predictions.

optional float temperature = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the temperature field is set.

hasTopK()

public boolean hasTopK()

Optional. If specified, top-k sampling will be used.

optional float top_k = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the topK field is set.

hasTopP()

public boolean hasTopP()

Optional. If specified, nucleus sampling will be used.

optional float top_p = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
boolean

Whether the topP field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public GenerationConfig.Builder newBuilderForType()
Returns
TypeDescription
GenerationConfig.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected GenerationConfig.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
GenerationConfig.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public GenerationConfig.Builder toBuilder()
Returns
TypeDescription
GenerationConfig.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException