Record Class VertexAiPaLm2Api.Message

java.lang.Object
java.lang.Record
org.springframework.ai.vertexai.palm2.api.VertexAiPaLm2Api.Message
Record Components:
author - (optional) Author of the message. This serves as a key for tagging the content of this Message when it is fed to the model as text.The author can be any alphanumeric string.
content - The text content of the structured Message.
citationMetadata - (output only) Citation information for model-generated content in this Message. If this Message was generated as output from the model, this field may be populated with attribution information for any text included in the content. This field is used only on output.
Enclosing class:
VertexAiPaLm2Api

public static record VertexAiPaLm2Api.Message(String author, String content, VertexAiPaLm2Api.Message.CitationMetadata citationMetadata) extends Record
The base unit of structured text. A Message includes an author and the content of the Message. The author is used to tag messages when they are fed to the model as text.
  • Constructor Details

    • Message

      public Message(String author, String content)
      Short-hand constructor for a message without citation metadata.
      Parameters:
      author - (optional) Author of the message.
      content - The text content of the structured Message.
    • Message

      public Message(String author, String content, VertexAiPaLm2Api.Message.CitationMetadata citationMetadata)
      Creates an instance of a Message record class.
      Parameters:
      author - the value for the author record component
      content - the value for the content record component
      citationMetadata - the value for the citationMetadata 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.
    • author

      public String author()
      Returns the value of the author record component.
      Returns:
      the value of the author record component
    • content

      public String content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • citationMetadata

      public VertexAiPaLm2Api.Message.CitationMetadata citationMetadata()
      Returns the value of the citationMetadata record component.
      Returns:
      the value of the citationMetadata record component