Record Class Communication

java.lang.Object
java.lang.Record
com.tnsai.models.agent.Communication
Record Components:
tone - the emotional tone of responses
formality - the level of formal vs casual language
verbosity - the preferred response length

public record Communication(Tone tone, Formality formality, Verbosity verbosity) extends Record
Represents the communication style and persona of an agent.

Communication style defines how an agent expresses itself when interacting with users or other agents.

Usage Example


 Communication style = new Communication(
     Tone.FRIENDLY,
     Formality.CASUAL,
     Verbosity.CONCISE
 );
 

This record is immutable and thread-safe.

See Also:
  • Constructor Details

    • Communication

      public Communication(Tone tone, Formality formality, Verbosity verbosity)
      Creates an instance of a Communication record class.
      Parameters:
      tone - the value for the tone record component
      formality - the value for the formality record component
      verbosity - the value for the verbosity record component
  • Method Details

    • defaultStyle

      public static Communication defaultStyle()
      Creates a default communication style.
    • getDescription

      public String getDescription()
      Gets a description of the communication style.
    • generatePromptSection

      public String generatePromptSection()
      Generates a prompt section for LLM.
    • 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.
    • tone

      public Tone tone()
      Returns the value of the tone record component.
      Returns:
      the value of the tone record component
    • formality

      public Formality formality()
      Returns the value of the formality record component.
      Returns:
      the value of the formality record component
    • verbosity

      public Verbosity verbosity()
      Returns the value of the verbosity record component.
      Returns:
      the value of the verbosity record component