Annotation Interface Communication


@Documented @Retention(RUNTIME) @Target(TYPE) public @interface Communication
Configures communication style and messaging for agents and roles.

Defines how an agent communicates with users and other agents, including tone, formality, language preferences, and messaging channels.

Usage


 @Communication(
     style = @Style(tone = Tone.PROFESSIONAL, formality = Formality.FORMAL),
     messaging = @Messaging(
         channels = {"research-updates", "team-notifications"},
         topics = {"papers", "findings"}
     ),
     languages = {"en", "tr"},  // English primary, Turkish also allowed
     responseFormat = ResponseFormat.MARKDOWN
 )
 public class ResearchAgent extends Agent { ... }
 
Author:
TnsAI Team
  • Element Details

    • style

      Communication style configuration.
      Returns:
      style settings
      Default:
      @com.tnsai.annotations.Communication.Style
    • messaging

      Messaging configuration.
      Returns:
      messaging settings
      Default:
      @com.tnsai.annotations.Communication.Messaging
    • languages

      String[] languages
      Allowed languages for communication (ENFORCED).

      The agent/role can ONLY respond in these languages. First element is the primary (default) language.

      ISO 639-1 codes (e.g., "en", "tr", "de").

      This is enforced as a guardrail - responses in other languages will be rejected or translated.

      Example:

      
       @Communication(languages = {"tr", "en"})  // Primary: Turkish
       
      Returns:
      array of allowed language codes
      Default:
      {"en"}
    • responseFormat

      Preferred response format.
      Returns:
      response format
      Default:
      TEXT
    • maxResponseLength

      int maxResponseLength
      Maximum response length in characters.

      0 means no limit.

      Returns:
      max length
      Default:
      0
    • includeSources

      boolean includeSources
      Whether to include citations/sources in responses.
      Returns:
      true to include sources
      Default:
      false