Record Class VertexAiPaLm2Api.GenerateMessageRequest
java.lang.Object
java.lang.Record
org.springframework.ai.vertexai.palm2.api.VertexAiPaLm2Api.GenerateMessageRequest
- Record Components:
prompt
- 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.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.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.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 topP.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 topK most probable tokens.
- Enclosing class:
VertexAiPaLm2Api
public static record VertexAiPaLm2Api.GenerateMessageRequest(VertexAiPaLm2Api.MessagePrompt prompt, Float temperature, Integer candidateCount, Float topP, Integer topK)
extends Record
Message generation request body.
-
Constructor Summary
ConstructorsConstructorDescriptionShortcut constructor to create a GenerateMessageRequest with only the prompt parameter.GenerateMessageRequest
(VertexAiPaLm2Api.MessagePrompt prompt, Float temperature, Integer topK) Shortcut constructor to create a GenerateMessageRequest with only the prompt and temperature parameters.GenerateMessageRequest
(VertexAiPaLm2Api.MessagePrompt prompt, Float temperature, Integer candidateCount, Float topP, Integer topK) Creates an instance of aGenerateMessageRequest
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecandidateCount
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.prompt()
Returns the value of theprompt
record component.Returns the value of thetemperature
record component.topK()
Returns the value of thetopK
record component.topP()
Returns the value of thetopP
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
GenerateMessageRequest
Shortcut constructor to create a GenerateMessageRequest with only the prompt parameter.- Parameters:
prompt
- The structured textual input given to the model as a prompt.
-
GenerateMessageRequest
public GenerateMessageRequest(VertexAiPaLm2Api.MessagePrompt prompt, Float temperature, Integer topK) Shortcut constructor to create a GenerateMessageRequest with only the prompt and temperature parameters.- Parameters:
prompt
- The structured textual input given to the model as a prompt.temperature
- (optional) Controls the randomness of the output.topK
- (optional) The maximum number of tokens to consider when sampling.
-
GenerateMessageRequest
public GenerateMessageRequest(VertexAiPaLm2Api.MessagePrompt prompt, Float temperature, Integer candidateCount, Float topP, Integer topK) Creates an instance of aGenerateMessageRequest
record class.- Parameters:
prompt
- the value for theprompt
record componenttemperature
- the value for thetemperature
record componentcandidateCount
- the value for thecandidateCount
record componenttopP
- the value for thetopP
record componenttopK
- the value for thetopK
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
prompt
Returns the value of theprompt
record component.- Returns:
- the value of the
prompt
record component
-
temperature
Returns the value of thetemperature
record component.- Returns:
- the value of the
temperature
record component
-
candidateCount
Returns the value of thecandidateCount
record component.- Returns:
- the value of the
candidateCount
record component
-
topP
Returns the value of thetopP
record component.- Returns:
- the value of the
topP
record component
-
topK
Returns the value of thetopK
record component.- Returns:
- the value of the
topK
record component
-