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 Details

    • GenerateMessageRequest

      public GenerateMessageRequest(VertexAiPaLm2Api.MessagePrompt prompt)
      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 a GenerateMessageRequest record class.
      Parameters:
      prompt - the value for the prompt record component
      temperature - the value for the temperature record component
      candidateCount - the value for the candidateCount record component
      topP - the value for the topP record component
      topK - the value for the topK record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • prompt

      Returns the value of the prompt record component.
      Returns:
      the value of the prompt record component
    • temperature

      public Float temperature()
      Returns the value of the temperature record component.
      Returns:
      the value of the temperature record component
    • candidateCount

      public Integer candidateCount()
      Returns the value of the candidateCount record component.
      Returns:
      the value of the candidateCount record component
    • topP

      public Float topP()
      Returns the value of the topP record component.
      Returns:
      the value of the topP record component
    • topK

      public Integer topK()
      Returns the value of the topK record component.
      Returns:
      the value of the topK record component