Class LLMServiceProvider

java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.llm.LLMServiceProvider
Direct Known Subclasses:
BasicLLMServiceProvider, SocialTRLLMServiceProvider, UnitySpaceStationLLMServiceProvider

public abstract class LLMServiceProvider extends DiarcComponent
  • Field Details

    • language

      protected String language
    • agentHierarchy

      protected Map<Symbol,Set<Symbol>> agentHierarchy
    • trackDialogueHistory

      protected boolean trackDialogueHistory
    • conversationMappings

      protected Map<Symbol,Set<Integer>> conversationMappings
    • currentConversations

      protected Map<Integer,List<Utterance>> currentConversations
    • counter

      protected AtomicInteger counter
    • trackLearnedActions

      protected boolean trackLearnedActions
    • learnedActions

      protected List<ActionDBEntry> learnedActions
  • Constructor Details

    • LLMServiceProvider

      public LLMServiceProvider()
  • Method Details

    • parseUtteranceLLMService

      public abstract Utterance parseUtteranceLLMService(Utterance utterance)
    • parseUtteranceLLMService

      public abstract Utterance parseUtteranceLLMService(Utterance utterance, boolean streamingGeneration)
    • convertSemanticsToTextLLMService

      public abstract Utterance convertSemanticsToTextLLMService(Utterance u)
    • convertSemanticsToTextLLMService

      public abstract Utterance convertSemanticsToTextLLMService(Utterance u, boolean streamingGeneration)
    • inExtendedParseLoop

      public abstract boolean inExtendedParseLoop(Symbol user, Symbol agentTeam)
    • init

      protected void init()
      Description copied from class: DiarcComponent
      Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.
      Overrides:
      init in class DiarcComponent
    • executionLoop

      protected void executionLoop()
      Description copied from class: DiarcComponent
      This is where any code that needs to be called repeatedly in a dedicated thread should live. It is not called by default and you must set shouldRunExecutionLoop to true in your constructor.
      Overrides:
      executionLoop in class DiarcComponent
    • callChatEndpoint

      protected Completion callChatEndpoint(Chat chat)
    • getLLMConversationLength

      public int getLLMConversationLength(Symbol user, Symbol agentTeam)
    • updateLLMConversationHistory

      public void updateLLMConversationHistory(Utterance utterance, boolean newUtterance)
    • getConversationHistory

      protected List<Utterance> getConversationHistory(Symbol user, Symbol agentTeam)
    • getConversationHistory

      protected List<Utterance> getConversationHistory(Set<Symbol> members)
    • startLLMConversation

      public List<Utterance> startLLMConversation(Symbol speaker, Symbol agentTeam)
      Start shared dialogue history between a user and an AgentTeam
    • startLLMConversation

      public List<Utterance> startLLMConversation(Set<Symbol> speakers, Set<Symbol> agentTeams)
      Start a shared dialogue history between a set of users and a set of AgentTeams
    • startLLMConversation

      public List<Utterance> startLLMConversation(Set<Symbol> members)
      Start shared dialogue history between a set of entities
    • endLLMConversation

      public void endLLMConversation(Symbol speaker, Symbol agentTeam)
      End shared dialogue history between a user and an AgentTeam
    • endLLMConversation

      public void endLLMConversation(Set<Symbol> speakers, Set<Symbol> agentTeams)
      End a shared dialogue history between a set of users and a set of AgentTeams
    • endLLMConversation

      public void endLLMConversation(Set<Symbol> members)
      End shared dialogue history between a set of entities
    • endLLMConversation

      public void endLLMConversation(Set<Symbol> members, Integer id)
    • clearConversationHistory

      public void clearConversationHistory()
    • registerForNotifications

      public void registerForNotifications()
    • initLearnedActions

      protected void initLearnedActions()
    • handleDatabaseAddition

      public void handleDatabaseAddition(ActionDBEntry entry) throws ai.thinkingrobots.trade.TRADEException
      Throws:
      ai.thinkingrobots.trade.TRADEException
    • handleDatabaseRemoval

      public void handleDatabaseRemoval(ActionDBEntry entry) throws ai.thinkingrobots.trade.TRADEException
      Throws:
      ai.thinkingrobots.trade.TRADEException
    • shutdownComponent

      public void shutdownComponent()
      Description copied from class: DiarcComponent
      Any component that needs particular shutdown logic needs to override this method and
      Overrides:
      shutdownComponent in class DiarcComponent
    • getDescendants

      protected Set<Symbol> getDescendants(Symbol agentTeam)
    • getUntypedSymbol

      protected Symbol getUntypedSymbol(Symbol s)
    • setLanguage

      public void setLanguage(String language)