Record Class VertexAiPaLm2Api.Message
java.lang.Object
java.lang.Record
org.springframework.ai.vertexai.palm2.api.VertexAiPaLm2Api.Message
- Record Components:
- (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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
A collection of source attributions for a piece of content.static final record
A citation to a source for a portion of a specific response. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthor()
Returns the value of theauthor
record component.Returns the value of thecitationMetadata
record component.content()
Returns the value of thecontent
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.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Message
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 aMessage
record class.- Parameters:
author
- the value for theauthor
record componentcontent
- the value for thecontent
record componentcitationMetadata
- the value for thecitationMetadata
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)
. -
author
Returns the value of theauthor
record component.- Returns:
- the value of the
author
record component
-
content
Returns the value of thecontent
record component.- Returns:
- the value of the
content
record component
-
citationMetadata
Returns the value of thecitationMetadata
record component.- Returns:
- the value of the
citationMetadata
record component
-