Record Class ContextSnapshot.ContextMessage
java.lang.Object
java.lang.Record
io.agentscope.extensions.aistio.model.ContextSnapshot.ContextMessage
- Enclosing class:
- ContextSnapshot
public static record ContextSnapshot.ContextMessage(String role, String content, boolean isCompaction)
extends Record
One message in the effective context.
-
Constructor Summary
ConstructorsConstructorDescriptionContextMessage(String role, String content, boolean isCompaction) Creates an instance of aContextMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisCompactionrecord component.role()Returns the value of therolerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ContextMessage
Creates an instance of aContextMessagerecord class.- Parameters:
role- the value for therolerecord componentcontent- the value for thecontentrecord componentisCompaction- the value for theisCompactionrecord component
-
-
Method Details
-
of
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
role
Returns the value of therolerecord component.- Returns:
- the value of the
rolerecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
isCompaction
public boolean isCompaction()Returns the value of theisCompactionrecord component.- Returns:
- the value of the
isCompactionrecord component
-