Class AgentPromptBuilder

java.lang.Object
com.tnsai.prompt.AgentPromptBuilder

public class AgentPromptBuilder extends Object
Builds system prompts for agents.

Generates natural language descriptions from agent configuration. Note: BDI (Belief-Desire-Intention) and Capability concepts have been moved to Role level. Goals and state are now defined via @Goal, @State, and @Action annotations on Role classes.

  • Constructor Details

    • AgentPromptBuilder

      public AgentPromptBuilder()
  • Method Details

    • buildSystemPrompt

      public static String buildSystemPrompt(String name, List<AgentIdentity> identities, Communication communication, List<Plan> plans, List<ErrorRecoveryScenario> errorRecoveryScenarios, List<String> toolActionNames)
      Builds a complete system prompt for an agent.
      Parameters:
      name - Agent name
      identities - Agent identity traits
      communication - Communication style
      plans - Predefined execution plans
      errorRecoveryScenarios - Error recovery strategies
      toolActionNames - List of tool action names for multi-tool instructions
      Returns:
      Generated system prompt
    • buildSystemPrompt

      public static String buildSystemPrompt(String name, List<AgentIdentity> identities, Communication communication, List<Plan> plans, List<ErrorRecoveryScenario> errorRecoveryScenarios, List<String> toolActionNames, ModelFamily family)
      Family-aware overload (issue #13). The family argument shades sections whose enforcement language varies by model family — currently only the tool-usage block. ModelFamily.OTHER preserves the historical wording byte-for-byte; callers that don't know their model can either pass OTHER or call the legacy overload.
      Parameters:
      family - target LLM family — see ModelFamily.fromModelId(String) for a best-effort mapper from common model id strings
      Since:
      0.5.0 (issue #13)
    • buildMinimalPrompt

      public static String buildMinimalPrompt(String name, List<AgentIdentity> identities)
      Builds a minimal prompt with just identity.
    • buildContextualPrompt

      public static String buildContextualPrompt(String name, List<AgentIdentity> identities, Communication communication)
      Builds a prompt with identity and communication style only.