Package edu.tufts.hrilab.llm
Class LLMServiceProvider
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.llm.LLMServiceProvider
- Direct Known Subclasses:
BasicLLMServiceProvider,SocialTRLLMServiceProvider,UnitySpaceStationLLMServiceProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicIntegerprotected Stringprotected List<ActionDBEntry>protected booleanprotected booleanFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletioncallChatEndpoint(Chat chat) voidabstract Utteranceabstract UtteranceconvertSemanticsToTextLLMService(Utterance u, boolean streamingGeneration) voidendLLMConversation(Symbol speaker, Symbol agentTeam) End shared dialogue history between a user and an AgentTeamvoidendLLMConversation(Set<Symbol> members) End shared dialogue history between a set of entitiesvoidendLLMConversation(Set<Symbol> members, Integer id) voidendLLMConversation(Set<Symbol> speakers, Set<Symbol> agentTeams) End a shared dialogue history between a set of users and a set of AgentTeamsprotected voidThis is where any code that needs to be called repeatedly in a dedicated thread should live.getConversationHistory(Symbol user, Symbol agentTeam) getConversationHistory(Set<Symbol> members) getDescendants(Symbol agentTeam) intgetLLMConversationLength(Symbol user, Symbol agentTeam) protected Symbolvoidvoidabstract booleaninExtendedParseLoop(Symbol user, Symbol agentTeam) protected voidinit()Perform any component initialization.protected voidabstract UtteranceparseUtteranceLLMService(Utterance utterance) abstract UtteranceparseUtteranceLLMService(Utterance utterance, boolean streamingGeneration) voidvoidsetLanguage(String language) voidAny component that needs particular shutdown logic needs to override this method andstartLLMConversation(Symbol speaker, Symbol agentTeam) Start shared dialogue history between a user and an AgentTeamstartLLMConversation(Set<Symbol> members) Start shared dialogue history between a set of entitiesstartLLMConversation(Set<Symbol> speakers, Set<Symbol> agentTeams) Start a shared dialogue history between a set of users and a set of AgentTeamsvoidupdateLLMConversationHistory(Utterance utterance, boolean newUtterance) Methods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
additionalUsageInfo, attachShutdownHook, createInstance, createInstance, createInstance, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, parseArgs, postRegistrationInit, shutdown
-
Field Details
-
language
-
agentHierarchy
-
trackDialogueHistory
protected boolean trackDialogueHistory -
conversationMappings
-
currentConversations
-
counter
-
trackLearnedActions
protected boolean trackLearnedActions -
learnedActions
-
-
Constructor Details
-
LLMServiceProvider
public LLMServiceProvider()
-
-
Method Details
-
parseUtteranceLLMService
-
parseUtteranceLLMService
-
convertSemanticsToTextLLMService
-
convertSemanticsToTextLLMService
-
inExtendedParseLoop
-
init
protected void init()Description copied from class:DiarcComponentPerform 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:
initin classDiarcComponent
-
executionLoop
protected void executionLoop()Description copied from class:DiarcComponentThis 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:
executionLoopin classDiarcComponent
-
callChatEndpoint
-
getLLMConversationLength
-
updateLLMConversationHistory
-
getConversationHistory
-
getConversationHistory
-
startLLMConversation
Start shared dialogue history between a user and an AgentTeam -
startLLMConversation
Start a shared dialogue history between a set of users and a set of AgentTeams -
startLLMConversation
Start shared dialogue history between a set of entities -
endLLMConversation
End shared dialogue history between a user and an AgentTeam -
endLLMConversation
End a shared dialogue history between a set of users and a set of AgentTeams -
endLLMConversation
End shared dialogue history between a set of entities -
endLLMConversation
-
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:DiarcComponentAny component that needs particular shutdown logic needs to override this method and- Overrides:
shutdownComponentin classDiarcComponent
-
getDescendants
-
getUntypedSymbol
-
setLanguage
-