Class ClassConfig.Level

java.lang.Object
com.tnsai.annotations.ClassConfig.Level
Enclosing class:
ClassConfig

public static final class ClassConfig.Level extends Object
One level of a file: an agent, a role in an agent's file, or a role's own file.
  • Method Details

    • llm

      public Map<String,Object> llm()
      The llm fields this level gives: text as String, numbers as Number.
      Returns:
      field name to value, in file order; empty when absent
    • hasKnowledge

      public boolean hasKnowledge()
      Returns:
      true when this level gives knowledge
    • knowledgeNames

      public Set<String> knowledgeNames()
      Returns:
      the knowledge names this level gives
    • knowledgeMembers

      public Set<String> knowledgeMembers(String name)
      The members this level gives for one knowledge name, by their Knowledge attribute names, such as path, unit or use. A search object is the one member search. Only the names are given; the layered values are on the declared knowledge. A host can ask, for example, whether any level of a role gives a path for a name.
      Parameters:
      name - a knowledge name
      Returns:
      the attribute names, unmodifiable; empty when this level gives no entry for name
      Since:
      0.18.0
    • layer

      public List<Knowledge> layer(List<Knowledge> declared)
      This level's knowledge over the declared one: a declared name is overridden member by member, search included, and an entry that changes use keeps the declared maxTokens or search only when the new use applies to it (KnowledgeDeclarations.keepsMaxTokens(com.tnsai.annotations.Knowledge.Use, com.tnsai.annotations.Knowledge.Use), KnowledgeDeclarations.keepsSearch(com.tnsai.annotations.Knowledge.Use, com.tnsai.annotations.Knowledge.Use)); a name the declared entries lack follows them as a full declaration, in name order. The declared entries are everything below this level, so a name a lower file added is overridden member by member too. A relative FILE path this level gives resolves against the base directory the file was read with, when one was set.
      Parameters:
      declared - the entries below this level
      Returns:
      the layered entries
    • where

      public String where()
      Returns:
      where this level is, for messages