Package com.tnsai.annotations
Annotation 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic @interfaceMessaging channel configuration.static enumstatic @interfaceCommunication style settings.static enumstatic enum -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether to include citations/sources in responses.String[]Allowed languages for communication (ENFORCED).intMaximum response length in characters.Messaging configuration.Preferred response format.Communication style configuration.
-
Element Details
-
style
Communication.Style styleCommunication style configuration.- Returns:
- style settings
- Default:
@com.tnsai.annotations.Communication.Style
-
messaging
Communication.Messaging messagingMessaging configuration.- Returns:
- messaging settings
- Default:
@com.tnsai.annotations.Communication.Messaging
-
languages
String[] languagesAllowed 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
Communication.ResponseFormat responseFormatPreferred response format.- Returns:
- response format
- Default:
TEXT
-
maxResponseLength
int maxResponseLengthMaximum response length in characters.0 means no limit.
- Returns:
- max length
- Default:
0
-
includeSources
boolean includeSourcesWhether to include citations/sources in responses.- Returns:
- true to include sources
- Default:
false
-